/* Cheers Homes 財務諮詢系統 - 主要樣式表 */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0,0,0,0.2);
}

/* Header 樣式 */
.main-header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-section i {
    font-size: 3rem;
    color: #f39c12;
    text-shadow: 0 2px 10px rgba(243, 156, 18, 0.3);
}

.logo-section h1 {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 300;
    color: #ecf0f1;
}

.advisor-info {
    text-align: right;
    background: rgba(255,255,255,0.1);
    padding: 1.5rem;
    border-radius: 15px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.advisor-details h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #f39c12;
}

.advisor-details p {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-bottom: 0.3rem;
}

/* Navigation 樣式 */
.main-nav {
    background: #34495e;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-nav ul {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-nav li {
    flex: 1;
}

.nav-link {
    display: block;
    padding: 1.2rem 1.5rem;
    color: white;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    border-right: 1px solid #2c3e50;
    font-weight: 500;
    position: relative;
}

.nav-link:hover {
    background: #2c3e50;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.nav-link.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: inset 0 4px 0 #f39c12;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #3498db;
}

/* Main Content 樣式 */
.main-content {
    padding: 3rem 2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    min-height: calc(100vh - 200px);
}

.content-section {
    display: none;
    animation: fadeIn 0.6s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(30px);
    }
    to { 
        opacity: 1; 
        transform: translateY(0);
    }
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid rgba(52, 152, 219, 0.1);
}

.section-header h2 {
    font-size: 2.2rem;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.section-header i {
    margin-right: 0.8rem;
    color: #3498db;
    text-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
}

.section-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Form 樣式 */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 0.8rem;
    font-size: 1rem;
    text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1rem 1.2rem;
    border: 2px solid #ecf0f1;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.15), 0 4px 20px rgba(52, 152, 219, 0.1);
    transform: translateY(-2px);
}

.form-group input:valid {
    border-color: #27ae60;
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.6;
}

/* Financial Tabs 樣式 */
.financial-tabs {
    display: flex;
    margin-bottom: 3rem;
    background: #ecf0f1;
    border-radius: 15px;
    padding: 0.5rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.tab-btn {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    color: #7f8c8d;
    position: relative;
}

.tab-btn.active {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
    transform: translateY(-2px);
}

.tab-btn:hover:not(.active) {
    background: rgba(52, 152, 219, 0.1);
    color: #3498db;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Asset Categories 樣式 */
.asset-categories,
.liability-categories {
    display: grid;
    gap: 2.5rem;
}

.asset-category,
.liability-category {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 20px;
    border-left: 6px solid #3498db;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.asset-category:hover,
.liability-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.asset-category h3,
.liability-category h3 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
}

.asset-category h3::before {
    content: "💰";
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.liability-category h3::before {
    content: "📋";
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

/* Income Expense Grid */
.income-expense-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.income-section,
.expense-section {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

.income-section {
    border-left: 6px solid #27ae60;
}

.expense-section {
    border-left: 6px solid #e74c3c;
}

.income-section:hover,
.expense-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.income-section h3 {
    color: #27ae60;
    display: flex;
    align-items: center;
}

.income-section h3::before {
    content: "💚";
    margin-right: 0.8rem;
}

.expense-section h3 {
    color: #e74c3c;
    display: flex;
    align-items: center;
}

.expense-section h3::before {
    content: "💸";
    margin-right: 0.8rem;
}

/* Financial Summary */
.financial-summary {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.calculate-btn,
.btn-next,
.btn-prev {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.calculate-btn::before,
.btn-next::before,
.btn-prev::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.calculate-btn:hover::before,
.btn-next:hover::before,
.btn-prev:hover::before {
    left: 100%;
}

.calculate-btn:hover,
.btn-next:hover,
.btn-prev:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(52, 152, 219, 0.4);
}

.btn-prev {
    background: linear-gradient(135deg, #95a5a6 0%, #7f8c8d 100%);
    box-shadow: 0 8px 25px rgba(149, 165, 166, 0.3);
}

.btn-prev:hover {
    box-shadow: 0 12px 35px rgba(149, 165, 166, 0.4);
}

/* Section Navigation */
.section-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #ecf0f1;
}

.btn-restart {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    box-shadow: 0 8px 25px rgba(155, 89, 182, 0.3);
}

.btn-restart:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(155, 89, 182, 0.4);
}

.clear-btn {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.3);
}

.clear-btn:hover {
    box-shadow: 0 12px 35px rgba(231, 76, 60, 0.4);
}

.generate-btn,
.preview-btn,
.save-btn,
.assess-btn {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    padding: 1.2rem 2.5rem;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.5rem;
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

.generate-btn:hover,
.preview-btn:hover,
.save-btn:hover,
.assess-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(52, 152, 219, 0.4);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .main-header {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        padding: 1.5rem;
    }
    
    .advisor-info {
        text-align: center;
    }
    
    .main-nav ul {
        flex-wrap: wrap;
    }
    
    .nav-link {
        font-size: 0.9rem;
        padding: 1rem 0.8rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .income-expense-grid {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        padding: 2rem 1rem;
    }
    
    .section-navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-section i {
        font-size: 2rem;
    }
    
    .logo-section h1 {
        font-size: 1.8rem;
    }
}

@media (max-width: 480px) {
    .section-header h2 {
        font-size: 1.8rem;
    }
    
    .calculate-btn,
    .btn-next,
    .btn-prev {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .asset-category,
    .liability-category,
    .income-section,
    .expense-section {
        padding: 1.5rem;
    }
}

/* 載入動畫 */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 成功/錯誤訊息樣式 */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.notification.success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
}

.notification.error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
}

.notification.warning {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.notification.info {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}
/* Report Controls and Additional Styles */
.report-controls {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.recommendations-container {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.recommendation-category {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid #3498db;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.recommendation-category:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.recommendation-category h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.custom-notes {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 15px;
    border-left: 5px solid #e67e22;
    margin-top: 2rem;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
}

.custom-notes h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

