/* Cheers Homes 財務諮詢系統 - 報告專用樣式 */

/* 財務摘要樣式 */
.financial-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.summary-card {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    padding: 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 5px solid #ddd;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    transform: translateX(-100%);
    transition: transform 0.8s;
}

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

.summary-card:hover::before {
    transform: translateX(100%);
}

.summary-card.positive {
    border-left-color: #27ae60;
    background: linear-gradient(135deg, #ffffff 0%, #f1fcf4 100%);
}

.summary-card.positive::after {
    content: "📈";
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.summary-card.negative {
    border-left-color: #e74c3c;
    background: linear-gradient(135deg, #ffffff 0%, #fdf2f2 100%);
}

.summary-card.negative::after {
    content: "📉";
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.summary-card.info {
    border-left-color: #3498db;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
}

.summary-card.info::after {
    content: "💼";
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.summary-card h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-card .amount {
    font-size: 1.8rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 風險評估結果樣式 */
.risk-result-container {
    background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 3rem;
    margin-top: 2rem;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    position: relative;
    overflow: hidden;
}

.risk-result-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, #e74c3c, #f39c12, #f1c40f, #2ecc71, #3498db);
}

.risk-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #ecf0f1;
}

.risk-badge {
    padding: 1.2rem 2.5rem;
    color: white;
    border-radius: 50px;
    font-size: 1.4rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.risk-badge::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.6s ease;
}

.risk-badge:hover::after {
    width: 200%;
    height: 200%;
}

.risk-score {
    font-size: 1.3rem;
    color: #2c3e50;
    font-weight: 600;
    background: linear-gradient(135deg, #ecf0f1 0%, #bdc3c7 100%);
    padding: 1rem 2rem;
    border-radius: 25px;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.1);
}

.risk-description {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 15px;
    margin: 2rem 0;
    border-left: 5px solid #9b59b6;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
}

.risk-description h4 {
    color: #9b59b6;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.risk-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.risk-detail-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid #ecf0f1;
    transition: all 0.3s ease;
    position: relative;
}

.risk-detail-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(52, 152, 219, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.risk-detail-card:hover {
    transform: translateY(-3px);
    border-color: #3498db;
    box-shadow: 0 10px 30px rgba(52, 152, 219, 0.15);
}

.risk-detail-card:hover::before {
    opacity: 1;
}

.risk-detail-card h5 {
    color: #7f8c8d;
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
}

.risk-detail-card .highlight {
    color: #2c3e50;
    font-weight: 700;
    font-size: 1.3rem;
    position: relative;
    z-index: 1;
}

/* 推薦配置樣式 */
.recommended-allocation {
    background: linear-gradient(135deg, #fff 0%, #f8fbff 100%);
    border: 3px solid #3498db;
    border-radius: 20px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 15px 35px rgba(52, 152, 219, 0.15);
    position: relative;
}

.recommended-allocation::before {
    content: '⭐';
    position: absolute;
    top: -10px;
    left: 2rem;
    background: #3498db;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 15px;
    font-size: 1rem;
}

.recommended-allocation h4 {
    color: #3498db;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    text-align: center;
}

.allocation-preview {
    display: grid;
    gap: 1rem;
    margin-top: 1.5rem;
}

.allocation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 10px;
    border-left: 4px solid #3498db;
    transition: all 0.3s ease;
}

.allocation-item:hover {
    transform: translateX(10px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.allocation-item .percentage {
    font-weight: 700;
    color: #3498db;
    font-size: 1.2rem;
    background: rgba(52, 152, 219, 0.1);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
}

/* 風險建議樣式 */
.risk-recommendations {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 2rem;
    margin: 2rem 0;
    border-left: 5px solid #e67e22;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
}

.risk-recommendations h4 {
    color: #e67e22;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
    display: flex;
    align-items: center;
}

.risk-recommendations h4::before {
    content: '💡';
    margin-right: 0.8rem;
    font-size: 1.2rem;
}

.risk-recommendations ul {
    margin: 1.5rem 0;
    padding-left: 0;
    list-style: none;
}

.risk-recommendations li {
    margin: 1rem 0;
    padding: 1rem 1rem 1rem 3rem;
    background: linear-gradient(135deg, #fff 0%, #fef9e7 100%);
    border-radius: 10px;
    position: relative;
    line-height: 1.6;
    color: #2c3e50;
    box-shadow: 0 3px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.risk-recommendations li::before {
    content: '✓';
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #27ae60;
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(39, 174, 96, 0.1);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.risk-recommendations li:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(230, 126, 34, 0.15);
}

/* 下一步按鈕 */
.next-steps {
    text-align: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #ecf0f1;
}

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

.btn-primary::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;
}

.btn-primary:hover::before {
    left: 100%;
}

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

/* 響應式調整 */
@media (max-width: 768px) {
    .financial-summary-grid {
        grid-template-columns: 1fr;
    }
    
    .risk-header {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .risk-details-grid {
        grid-template-columns: 1fr;
    }
    
    .allocation-item {
        font-size: 0.9rem;
        padding: 1rem;
    }
    
    .summary-card {
        padding: 1.5rem;
    }
    
    .summary-card .amount {
        font-size: 1.5rem;
    }
    
    .risk-result-container {
        padding: 2rem 1.5rem;
    }
    
    .risk-badge {
        padding: 1rem 2rem;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .summary-card .amount {
        font-size: 1.3rem;
    }
    
    .risk-badge {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }
    
    .risk-score {
        font-size: 1.1rem;
        padding: 0.8rem 1.5rem;
    }
    
    .allocation-item .percentage {
        font-size: 1rem;
    }
    
    .btn-primary {
        width: 100%;
        padding: 1rem 2rem;
    }
}

/* 動畫效果 */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

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

.bounce-in {
    animation: bounceIn 0.8s ease-out;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.05);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* 進度指示器 */
.progress-indicator {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(52, 152, 219, 0.2);
    z-index: 10000;
}

.progress-indicator .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    width: 0%;
    transition: width 0.3s ease;
}

/* 載入狀態 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    backdrop-filter: blur(5px);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #ecf0f1;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}