/* style.css */

/* --- デザイン設定 --- */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --accent-color: #ff6b6b;
    --bg-color: #f0f2f5;
    --card-bg: #ffffff;
    --text-main: #333;
    --text-sub: #555;
    --radius: 16px;
}

body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

header {
    text-align: center;
    margin-bottom: 20px;
}

.app-logo {
    max-width: 70%;
    height: auto;
    width: 350px;
    display: block;
    margin: 0 auto;
}

h1.title {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 15px;
    padding: 0 10px;
}

.app-description {
    text-align: center;
    font-size: 0.75rem;
    color: #666;
    margin-top: -10px;
    margin-bottom: 20px;
    padding: 0 15px;
    font-weight: normal;
}

.backup-area {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 25px;
}

.btn-sm {
    font-size: 0.85rem;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    background: white;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    text-decoration: none;
}

.btn-sm:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
}

/* トップへ戻るリンクのエリア */
.site-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    text-align: left;
}

.back-link {
    text-decoration: none;
    color: #888;
    font-size: 0.85rem;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: color 0.2s;
    font-weight: bold;
}

.back-link:hover {
    color: #764ba2;
}

/* アコーディオン */
details {
    margin-bottom: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    text-align: left;
}

summary {
    padding: 16px 20px;
    font-weight: bold;
    cursor: pointer;
    color: #444;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

summary::after {
    content: "▼";
    font-size: 0.8rem;
    color: #999;
    transition: transform 0.3s;
}

details[open] summary::after {
    transform: rotate(180deg);
}

.guide-content {
    padding: 0 20px 25px 20px;
    font-size: 0.95rem;
    color: var(--text-sub);
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.guide-content h3 {
    font-size: 1rem;
    color: #764ba2;
    margin: 20px 0 10px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-content ul {
    padding-left: 20px;
    margin: 5px 0;
}

.guide-content li {
    margin-bottom: 8px;
}

.card {
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    margin-bottom: 24px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    font-size: 0.95rem;
}

input[type="text"],
select {
    width: 100%;
    padding: 14px;
    border: 2px solid #eee;
    border-radius: 12px;
    box-sizing: border-box;
    font-size: 1rem;
    background: #fafafa;
}

/* 音声入力ボタン共通 */
.voice-input-wrapper {
    display: flex;
    gap: 10px;
}

.voice-btn {
    background: #eee;
    border: none;
    border-radius: 12px;
    width: 54px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.voice-btn.listening {
    background: var(--accent-color);
    color: white;
    animation: pulse 1.5s infinite;
}

#addBtn {
    width: 100%;
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
}

/* リスト */
#boxList {
    flex: 1;
}

.box-card {
    background: var(--card-bg);
    border-left: 6px solid #ccc;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
    position: relative;
}

.box-header {
    display: flex;
    justify-content: flex-start;
    gap: 15px;
    align-items: center;
    margin-bottom: 10px;
    padding-right: 90px;
}

.box-num {
    font-weight: 800;
    font-size: 1.4rem;
    color: #444;
}

.box-room {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: #f0f0f0;
    font-weight: bold;
}

.delete-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 編集ボタン（削除ボタンの隣に配置） */
.edit-btn {
    position: absolute;
    top: 15px;
    right: 55px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f0f0f0;
    border: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
}

.edit-btn:hover {
    background: #e0e0e0;
    color: #764ba2;
}

.fragile-mark {
    color: #e74c3c;
    background: #ffebeb;
    font-weight: bold;
    font-size: 0.9rem;
    padding: 2px 8px;
    border-radius: 4px;
    display: none;
    margin-right: 5px;
    border: 1px solid #ffcccc;
}

.box-card.is-fragile .fragile-mark {
    display: inline-block;
}

/* フッター */
footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    text-align: center;
    color: #999;
    font-size: 0.8rem;
}

.footer-links {
    margin-bottom: 10px;
}

.footer-links a {
    color: #888;
    text-decoration: none;
    margin: 0 8px;
    display: inline-block;
}

.footer-links a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.copyright {
    color: #bbb;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}

.btn-pdf {
    color: #e74c3c;
    border: 1px solid #e74c3c;
}
.btn-pdf:hover {
    background: #fff5f5;
}
        /* モーダル用スタイル追加 */
        .modal {
            display: none; 
            position: fixed; z-index: 1000; left: 0; top: 0;
            width: 100%; height: 100%; overflow: auto;
            background-color: rgba(0,0,0,0.5);
        }
        .modal-content {
            background-color: #fefefe; margin: 15% auto; padding: 20px;
            border: 1px solid #888; width: 80%; max-width: 400px;
            border-radius: 10px; text-align: center;
        }
        .close {
            color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;
        }
        .close:hover { color: black; }
        .auth-status { font-weight: bold; color: #764ba2; margin-bottom: 10px; }

/* スマホ表示用（画面幅が768px以下の場合） */
@media screen and (max-width: 768px) {
    .site-nav {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }

    .back-link {
        width: 100%;
        justify-content: left;
    }

    #userArea {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}