/* ============================================
   index.html 모바일 최적화 CSS v7.12.0
   PC 디자인 유지, 모바일(768px 이하)만 개선
   v7.12.0: 그래프 터치 최적화 추가
   ============================================ */

/* 그래프 터치 최적화 (전체 화면) */
canvas {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.chart-container {
    position: relative;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

/* 모바일 전용 미디어 쿼리 */
@media (max-width: 768px) {
    
    /* ========== 그래프 모바일 최적화 (v7.12.0) ========== */
    canvas {
        max-width: 100%;
        height: auto !important;
        min-height: 250px;
    }
    
    .chart-container {
        padding: 10px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Chart.js 툴팁 모바일 최적화 */
    .chartjs-tooltip {
        font-size: 13px !important;
        padding: 10px !important;
        max-width: 90vw !important;
    }
    
    /* ========== 1. Hero Section 모바일 최적화 ========== */
    .hero {
        padding: 60px 0 50px;
        background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
        color: #ffffff !important;
    }
    
    .hero-content {
        color: #ffffff !important;
    }
    
    .hero-title {
        font-size: 28px !important;
        line-height: 1.4 !important;
        margin-bottom: 20px !important;
        color: #ffffff !important;
    }
    
    .hero-title .highlight {
        font-size: 28px !important;
        display: block;
        margin-bottom: 10px;
        color: #ffd700 !important;
        text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    }
    
    .hero-title span {
        color: #ffffff !important;
    }
    
    .hero-subtitle {
        font-size: 16px !important;
        line-height: 1.7 !important;
        margin-bottom: 30px !important;
        color: #e0e0e0 !important;
    }
    
    .hero-subtitle strong {
        color: #ffd700 !important;
        font-weight: 700 !important;
    }
    
    /* ========== 2. 문제 제기 섹션 (새로운 Hero 컨셉) ========== */
    .problem-section {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        padding: 60px 20px;
        text-align: center;
        color: white;
    }
    
    .problem-section .section-title {
        font-size: 26px !important;
        line-height: 1.5 !important;
        margin-bottom: 20px !important;
        font-weight: 700 !important;
    }
    
    .problem-section .section-subtitle {
        font-size: 17px !important;
        line-height: 1.7 !important;
    }
    
    .problem-section strong {
        font-size: 19px !important;
        color: #d4af37 !important;
        display: block;
        margin-top: 20px;
        padding: 15px;
        background: rgba(212, 175, 55, 0.1);
        border-radius: 8px;
        border-left: 4px solid #d4af37;
    }
    
    /* ========== 3. 핵심 솔루션 섹션 (Active vs Passive) ========== */
    .services {
        padding: 50px 20px;
    }
    
    .services .section-title {
        font-size: 24px !important;
        margin-bottom: 15px !important;
    }
    
    .services .section-subtitle {
        font-size: 15px !important;
        margin-bottom: 30px !important;
    }
    
    .solution-boxes {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .solution-box {
        background: white;
        border-radius: 16px;
        padding: 25px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        border: 2px solid #e0e0e0;
        transition: all 0.3s ease;
    }
    
    .solution-box:first-child {
        border-left: 5px solid #dc3545;
    }
    
    .solution-box:last-child {
        border-left: 5px solid #007bff;
    }
    
    .solution-label {
        font-size: 18px;
        font-weight: 700;
        margin-bottom: 15px;
        color: #333;
    }
    
    .solution-box p {
        font-size: 15px;
        line-height: 1.7;
        color: #555;
    }
    
    .solution-box strong {
        display: block;
        margin-bottom: 10px;
        font-size: 16px;
        color: #222;
    }
    
    /* ========== 4. 전문 분야 6개 박스 ========== */
    .services-subtitle {
        font-size: 20px !important;
        margin: 40px 0 25px !important;
        text-align: center;
        font-weight: 700;
    }
    
    .services-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }
    
    .service-card {
        padding: 25px 20px !important;
        text-align: center;
    }
    
    .service-card i {
        font-size: 32px !important;
        margin-bottom: 12px;
    }
    
    .service-card h3 {
        font-size: 16px !important;
        margin-bottom: 10px;
    }
    
    .service-card p {
        font-size: 13px !important;
        line-height: 1.6;
        color: #666;
    }
    
    /* ========== 5. 성과 증명 섹션 ========== */
    .performance {
        padding: 50px 20px;
    }
    
    .performance .section-title {
        font-size: 24px !important;
        margin-bottom: 15px !important;
    }
    
    .performance .section-subtitle {
        font-size: 15px !important;
        margin-bottom: 25px !important;
    }
    
    .performance-content {
        display: flex;
        flex-direction: column;
        gap: 30px;
    }
    
    /* 배당금 차트 섹션 */
    .chart-section h3 {
        font-size: 20px !important;
        margin-bottom: 10px;
    }
    
    .chart-subtitle {
        font-size: 14px !important;
        margin-bottom: 20px;
    }
    
    /* 월평균 실현 수익 - 가장 중요! */
    .returns-section {
        background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
        padding: 30px 20px;
        border-radius: 16px;
        border: 3px solid #d4af37;
    }
    
    .returns-section h3 {
        font-size: 22px !important;
        text-align: center;
        margin-bottom: 10px;
        color: #2c3e50;
    }
    
    .returns-subtitle {
        font-size: 14px !important;
        text-align: center;
        margin-bottom: 25px;
        color: #666;
    }
    
    .returns-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }
    
    .return-card {
        background: white;
        padding: 18px 12px;
        border-radius: 12px;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        border: 1px solid #e0e0e0;
    }
    
    .return-card .quarter {
        font-size: 12px;
        color: #666;
        margin-bottom: 8px;
    }
    
    .return-card .amount {
        font-size: 22px;
        font-weight: 700;
        color: #28a745;
    }
    
    /* 핵심 메시지 박스 */
    .chart-note {
        background: rgba(102, 126, 234, 0.05);
        border-left: 4px solid #667eea;
        padding: 15px;
        border-radius: 8px;
        margin-top: 20px;
    }
    
    .chart-note p {
        font-size: 14px !important;
        line-height: 1.7;
        color: #333;
    }
    
    /* ========== 6. 운용 전략 섹션 ========== */
    .strategy {
        padding: 50px 20px;
        background: #f8f9fa;
    }
    
    .strategy .section-title {
        font-size: 24px !important;
        margin-bottom: 15px !important;
    }
    
    .strategy .section-subtitle {
        font-size: 15px !important;
        line-height: 1.7 !important;
        margin-bottom: 30px !important;
    }
    
    .strategy-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        margin-bottom: 30px;
    }
    
    .strategy-card {
        padding: 25px 20px !important;
    }
    
    .strategy-card .badge {
        font-size: 15px !important;
    }
    
    .strategy-item {
        margin-bottom: 15px;
    }
    
    .strategy-item strong {
        font-size: 14px !important;
        display: block;
        margin-bottom: 5px;
    }
    
    .strategy-item p {
        font-size: 13px !important;
        line-height: 1.6;
    }
    
    /* ========== 7. 상담 절차 (타임라인) ========== */
    .process {
        padding: 50px 20px;
    }
    
    .process .section-title {
        font-size: 24px !important;
        margin-bottom: 30px !important;
    }
    
    .process-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .process-card {
        padding: 25px 20px !important;
        text-align: left;
        position: relative;
    }
    
    .process-number {
        font-size: 32px !important;
        width: 50px;
        height: 50px;
        line-height: 50px;
        margin-bottom: 15px;
    }
    
    .process-card h3 {
        font-size: 18px !important;
        margin-bottom: 12px;
    }
    
    .process-card p {
        font-size: 14px !important;
        line-height: 1.7;
    }
    
    /* 타임라인 연결선 */
    .process-card:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: -20px;
        left: 25px;
        width: 2px;
        height: 20px;
        background: linear-gradient(to bottom, #d4af37, transparent);
    }
    
    /* ========== 8. 고객 후기 섹션 ========== */
    .testimonial-section {
        padding: 50px 20px;
        background: #f8f9fa;
    }
    
    .testimonial-section .section-title {
        font-size: 24px !important;
        margin-bottom: 30px !important;
    }
    
    .testimonial-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .testimonial-card {
        padding: 25px 20px !important;
    }
    
    .testimonial-quote {
        font-size: 15px !important;
        line-height: 1.7;
        margin-bottom: 15px;
    }
    
    .testimonial-author {
        font-size: 13px !important;
    }
    
    /* ========== 9. 진단 선택 CTA (메인의 핵심!) ========== */
    .diagnosis-types {
        padding: 60px 20px;
        background: linear-gradient(135deg, #1a2332 0%, #2c3e50 100%);
    }
    
    .diagnosis-types .section-title {
        font-size: 26px !important;
        color: white;
        margin-bottom: 15px !important;
    }
    
    .diagnosis-types .section-subtitle {
        font-size: 16px !important;
        color: rgba(255, 255, 255, 0.9);
        margin-bottom: 35px !important;
    }
    
    .diagnosis-grid,
    .diagnosis-grid-2,
    .diagnosis-grid-3 {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }
    
    .diagnosis-card {
        background: white;
        border-radius: 20px;
        padding: 30px 25px;
        text-align: center;
        box-shadow: 0 6px 20px rgba(0,0,0,0.15);
        border: 3px solid transparent;
        transition: all 0.3s ease;
    }
    
    .diagnosis-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 30px rgba(212, 175, 55, 0.3);
        border-color: #d4af37;
    }
    
    /* Type별 색상 구분 */
    .diagnosis-card[data-type="goal-saving"] {
        border-left: 6px solid #28a745;
    }
    
    .diagnosis-card[data-type="investment-check"] {
        border-left: 6px solid #007bff;
    }
    
    .diagnosis-card[data-type="retirement-plan"] {
        border-left: 6px solid #ffc107;
    }
    
    .diagnosis-card-premium {
        background: linear-gradient(135deg, #fff9e6 0%, #fffbf0 100%);
        border: 3px solid #d4af37 !important;
    }
    
    .diagnosis-card-heritage {
        background: linear-gradient(135deg, #fffbf0 0%, #ffffff 100%);
        border: 3px solid #d4af37 !important;
    }
    
    .diagnosis-icon {
        font-size: 48px !important;
        margin-bottom: 15px;
    }
    
    .diagnosis-title {
        font-size: 22px !important;
        font-weight: 700;
        margin-bottom: 8px;
        color: #1a2332;
    }
    
    .diagnosis-target {
        font-size: 14px !important;
        color: #666;
        margin-bottom: 10px;
    }
    
    .diagnosis-copy {
        font-size: 16px !important;
        font-weight: 600;
        color: #333;
        margin-bottom: 15px;
        line-height: 1.5;
    }
    
    .diagnosis-tags {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin-bottom: 20px;
        flex-wrap: wrap;
    }
    
    .diagnosis-tags .tag {
        font-size: 12px !important;
        padding: 5px 12px;
        background: #f8f9fa;
        border-radius: 20px;
        color: #666;
        border: 1px solid #e0e0e0;
    }
    
    .diagnosis-badge {
        position: absolute;
        top: -12px;
        left: 50%;
        transform: translateX(-50%);
        background: linear-gradient(135deg, #d4af37 0%, #c9a030 100%);
        color: white;
        padding: 5px 15px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 700;
    }
    
    .btn-diagnosis {
        width: 100%;
        padding: 15px 20px;
        font-size: 16px !important;
        font-weight: 700;
        background: linear-gradient(135deg, #d4af37 0%, #c9a030 100%);
        color: white;
        border: none;
        border-radius: 10px;
        cursor: pointer;
        transition: all 0.3s ease;
        text-decoration: none;
        display: inline-block;
    }
    
    .btn-diagnosis:hover {
        background: linear-gradient(135deg, #c9a030 0%, #b8912a 100%);
        box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    }
    
    .btn-diagnosis-premium {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }
    
    .btn-diagnosis-premium:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }
    
    /* ========== 10. 푸터 ========== */
    .footer {
        padding: 40px 20px;
    }
    
    .footer h3 {
        font-size: 20px !important;
    }
    
    .footer p {
        font-size: 14px !important;
    }
    
    .footer .legal-notice p {
        font-size: 11px !important;
    }
    
    /* ========== 11. 네비게이션 모바일 최적화 ========== */
    .navbar {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .nav-logo span:first-child {
        font-size: 16px !important;
    }
    
    .nav-logo span:last-child {
        font-size: 13px !important;
    }
    
    /* ========== 12. 공통 여백 및 컨테이너 ========== */
    .container {
        padding: 0 20px;
    }
    
    section {
        padding: 40px 0;
    }
    
    .section-title {
        font-size: 24px;
        line-height: 1.4;
        margin-bottom: 15px;
    }
    
    .section-subtitle {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 25px;
    }
}

/* ============================================
   모바일 가로 모드 (landscape) 최적화
   ============================================ */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 40px 0 30px;
    }
    
    .hero-title {
        font-size: 24px !important;
    }
    
    .problem-section {
        padding: 40px 20px;
    }
    
    .problem-section .section-title {
        font-size: 22px !important;
    }
}

/* ============================================
   작은 모바일 기기 (480px 이하)
   ============================================ */
@media (max-width: 480px) {
    .hero-title {
        font-size: 24px !important;
    }
    
    .problem-section .section-title {
        font-size: 22px !important;
    }
    
    .diagnosis-icon {
        font-size: 40px !important;
    }
    
    .diagnosis-title {
        font-size: 20px !important;
    }
    
    .return-card .amount {
        font-size: 20px;
    }
}
