/* ============================================
   style.css - メインスタイルシート
   ============================================ */

/* ----- リセット & ベース ----- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Noto Sans JP', 'Hiragino Sans', sans-serif;
    background: #f5f0eb;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ----- ヘッダー / ナビゲーション ----- */
.header {
    background: #2c1810;
    color: #f5f0eb;
    padding: 0.8rem 2rem;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.nav-brand .brand-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #f5f0eb;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: bold;
}

.brand-icon {
    font-size: 1.8rem;
}

.brand-sub {
    font-size: 0.85rem;
    font-weight: normal;
    color: #d4c5b0;
    padding-left: 0.5rem;
    border-left: 1px solid #5a4a3a;
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 0.9rem;
}

.user-name {
    color: #f5f0eb;
}

.dev-badge {
    background: #e67e22;
    color: #fff;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: bold;
}

.logout-btn, .login-btn {
    color: #d4c5b0;
    text-decoration: none;
    padding: 0.3rem 0.8rem;
    border: 1px solid #d4c5b0;
    border-radius: 4px;
    transition: all 0.2s;
}

.logout-btn:hover, .login-btn:hover {
    color: #f5f0eb;
    border-color: #f5f0eb;
}

/* ----- メインコンテンツ ----- */
.main-content {
    flex: 1;
    max-width: 1400px;
    margin: 0 auto;
    padding: 1.5rem 2rem;
    width: 100%;
}

/* ----- ヒーローセクション ----- */
.hero-section {
    text-align: center;
    padding: 2rem 1rem 2.5rem;
    background: linear-gradient(135deg, #f5f0eb, #e8e0d8);
    border-radius: 12px;
    margin-bottom: 2rem;
}

.hero-title {
    font-size: 2.4rem;
    color: #2c1810;
    margin-bottom: 0.6rem;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #5a4a3a;
    line-height: 1.6;
}

/* ----- タブコンテナ ----- */
.tab-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

.tab-nav {
    display: flex;
    background: #faf8f5;
    border-bottom: 2px solid #e8e0d8;
    overflow-x: auto;
}

.tab-nav.single-tab {
    justify-content: center;
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 1.8rem;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.95rem;
    color: #8a7a6a;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}

.tab-btn:hover {
    background: rgba(44, 24, 16, 0.05);
    color: #2c1810;
}

.tab-btn.active {
    color: #2c1810;
    border-bottom-color: #2c1810;
    font-weight: 600;
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-content-wrapper {
    padding: 1.5rem 2rem 2rem;
    min-height: 500px;
}

.tab-content {
    min-height: 400px;
}

/* ----- ローディング ----- */
.tab-loading, .loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0;
    color: #8a7a6a;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e8e0d8;
    border-top-color: #2c1810;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ----- 空の状態 ----- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #8a7a6a;
}

.empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

.empty-sub {
    font-size: 0.9rem;
    color: #b0a090;
    margin-top: 0.3rem;
}

/* ----- エラー状態 ----- */
.error-state {
    text-align: center;
    padding: 2rem 1rem;
    color: #c0392b;
}

.error-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 1rem;
}

/* ----- フォーム ----- */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 180px;
}

.form-group.full-width {
    flex: 0 0 100%;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #5a4a3a;
    margin-bottom: 0.3rem;
}

.form-select, .form-input, .form-textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid #d4c5b0;
    border-radius: 6px;
    font-size: 0.95rem;
    background: #fff;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-select:focus, .form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: #2c1810;
    box-shadow: 0 0 0 3px rgba(44, 24, 16, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 0.8rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

/* ----- ボタン ----- */
.btn {
    padding: 0.6rem 1.6rem;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: inherit;
}

.btn-primary {
    background: #2c1810;
    color: #f5f0eb;
}

.btn-primary:hover {
    background: #1a0e08;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 24, 16, 0.3);
}

.btn-secondary {
    background: #e8e0d8;
    color: #2c1810;
}

.btn-secondary:hover {
    background: #d4c5b0;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* ----- フッター ----- */
.footer {
    background: #2c1810;
    color: #8a7a6a;
    padding: 1.2rem 2rem;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ----- 通知 ----- */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    padding: 0.8rem 1.6rem;
    border-radius: 8px;
    color: #fff;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease;
    max-width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.notification-info {
    background: #2c1810;
}

.notification-success {
    background: #27ae60;
}

.notification-warning {
    background: #f39c12;
}

.notification-error {
    background: #e74c3c;
}

.notification.fade-out {
    animation: slideOut 0.3s ease forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* ----- レスポンシブ ----- */
@media (max-width: 768px) {
    .nav {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .brand-sub {
        display: none;
    }
    
    .tab-content-wrapper {
        padding: 1rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        min-width: auto;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.3rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 0.5rem 1rem;
    }
    
    .hero-title {
        font-size: 1.4rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
    }
    
    .nav-brand .brand-link {
        font-size: 1.1rem;
    }
}