/* 전역 스타일 - 강의 사이트 디자인 */
:root {
    /* 새로운 색상 팔레트 */
    --deep-blue: #1E2A78;        /* 전문가·신뢰 */
    --royal-blue: #4169E1;       /* CTA 강조 */
    --gray-bg: #F3F4F6;          /* 배경 */
    --gold: #C59D24;             /* 프리미엄 강조 */
    
    /* 기존 변수 호환성 유지 */
    --primary-color: #1E2A78;
    --primary-dark: #151F5C;
    --primary-light: #4169E1;
    --secondary-color: #4169E1;
    --accent-color: #C59D24;
    --success-color: #00c853;
    --danger-color: #d32f2f;
    --background: #F3F4F6;
    --surface: #ffffff;
    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border-color: #E5E7EB;
    --header-bg: #1E2A78;
    --nav-hover: #2A3A8F;
    
    /* 그라데이션 */
    --gradient-primary: linear-gradient(135deg, #1E2A78 0%, #151F5C 100%);
    --gradient-blue: linear-gradient(135deg, #1E2A78 0%, #4169E1 100%);
    --gradient-dark: linear-gradient(180deg, #1E2A78 0%, #2A3A8F 100%);
    --gradient-gold: linear-gradient(135deg, #C59D24 0%, #B08D1F 100%);
}

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

body {
    font-family: 'Pretendard', 'Noto Sans KR', 'NEXON Gothic', -apple-system, BlinkMacSystemFont, system-ui, Roboto, 'Helvetica Neue', 'Segoe UI', 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    background: var(--gray-bg);
    color: var(--text-primary);
    line-height: 1.6;
    letter-spacing: -0.02em;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 헤더 - 로고와 메뉴바 분리 */
header {
    position: sticky;
    top: 0;
    z-index: 1001;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    background: white;
}

/* 로고 영역 (하얀색 배경) */
.header-logo-section {
    background: white;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.header-logo-section .container {
    padding-left: 20px;
    padding-right: 20px;
}

.logo-section-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-top-actions {
    display: flex;
    align-items: center;
}

.header-top-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-slab,
.btn-slab-back {
    background: linear-gradient(135deg, #4169E1 0%, #1E2A78 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn-slab-back {
    background: linear-gradient(135deg, #1E2A78 0%, #4169E1 100%);
}

.btn-slab .btn-text,
.btn-slab-back .btn-text {
    position: relative;
    z-index: 1;
}

.btn-slab .arrow-right,
.btn-slab-back .arrow-right {
    font-size: 16px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    position: relative;
    z-index: 1;
}

.btn-slab:hover .arrow-right,
.btn-slab-back:hover .arrow-right {
    transform: translateX(4px);
}

.btn-slab:hover,
.btn-slab-back:hover {
    box-shadow: 0 6px 16px rgba(65, 105, 225, 0.4);
    transform: translateY(-1px);
}

.btn-stablelab-top {
    background: linear-gradient(135deg, #4169E1 0%, #1E2A78 100%);
    color: white;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 1.4;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    overflow: hidden;
}

.btn-slab::before,
.btn-slab-back::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 ease;
}

.btn-slab:hover::before,
.btn-slab-back:hover::before {
    left: 100%;
}

.btn-slab:active,
.btn-slab-back:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.4);
}

.header-nav-section .container {
    padding-left: 20px;
    padding-right: 20px;
}

.logo {
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
    transform: scale(1.02);
}

/* 메뉴바 영역 */
.header-nav-section {
    background: var(--header-bg);
    color: white;
    padding: 12px 0;
    border-bottom: 3px solid var(--primary-color);
}

.header-nav-section .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-image {
    height: 40px;
    width: auto;
    object-fit: contain;
}

/* 햄버거 메뉴 버튼 */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 30px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
    position: relative;
}

.mobile-menu-toggle span {
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* 네비게이션 - 금융권 스타일 */
.main-nav {
    display: flex !important;
    gap: 5px;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-link-first {
    margin-left: 0;
}

.nav-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 24px;
    border-radius: 6px;
    transition: all 0.2s ease;
    position: relative;
    white-space: nowrap;
}

.nav-link:hover {
    background-color: var(--nav-hover);
    color: white;
}

.nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

/* 헤더 액션 버튼 - 금융권 스타일 */
.header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-login,
.btn-register {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-login:hover,
.btn-register:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-register {
    background: var(--royal-blue);
    border-color: var(--royal-blue);
}

.btn-register:hover {
    background: var(--deep-blue);
    border-color: var(--deep-blue);
}

.btn-search {
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
}

.btn-search:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

.btn-stablelab {
    background: var(--gradient-primary);
    color: white;
    text-decoration: none;
    padding: 9px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(30, 42, 120, 0.3);
}

.btn-stablelab:hover {
    background: var(--royal-blue);
    box-shadow: 0 4px 12px rgba(30, 42, 120, 0.4);
}

/* 로그인 상태 표시 */
.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-name {
    color: white;
    font-size: 14px;
    font-weight: 600;
    padding: 8px 0;
}

.btn-logout {
    background: transparent;
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-block;
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: white;
}

/* 메인 컨테이너 */
main {
    padding: 0;
    min-height: calc(100vh - 100px);
    background: var(--gray-bg);
}

/* index.html의 첫 번째 섹션이 헤더 아래에 오도록 */
main > section:first-child {
    margin-top: 0;
}

.main-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 40px;
    padding: 0 20px;
}

/* 왼쪽 섹션 */
.left-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 정보 카드 - 깔끔한 그림자 있는 카드 */
.info-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(30, 42, 120, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
}

.info-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(30, 42, 120, 0.12);
    border-color: var(--deep-blue);
}

.info-card:hover::before {
    transform: scaleX(1);
}

.card-header h3 {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    font-weight: 500;
}

.card-header h2 {
    font-size: 26px;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 800;
    line-height: 1.4;
}

.card-header p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 10px;
}

.highlight {
    color: var(--gold);
    font-weight: 800;
}

/* 차트 컨테이너 */
.chart-container {
    margin-top: 20px;
    animation: fadeInUp 0.6s ease;
}

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

.chart-container img,
.comparison-chart img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    transition: transform 0.3s ease;
    border: 1px solid var(--border-color);
}

.chart-container img:hover,
.comparison-chart img:hover {
    transform: scale(1.01);
}

.placeholder-chart {
    background: linear-gradient(135deg, #f5f7fa 0%, #e3e7ed 100%);
    padding: 50px 30px;
    border-radius: 8px;
    text-align: center;
    color: var(--text-secondary);
    font-weight: 500;
    border: 1px solid var(--border-color);
}

/* 오른쪽 섹션 (프로모션) - 깔끔한 카드 스타일 */
.right-section {
    width: 480px;
    position: sticky;
    top: 100px;
    height: fit-content;
}

.promo-card {
    background: white;
    color: var(--text-primary);
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 12px rgba(30, 42, 120, 0.08);
    min-height: 600px;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.promo-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.promo-card h2 {
    font-size: 22px;
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    font-weight: 800;
    color: var(--primary-color);
    border-bottom: 2px solid var(--border-color);
}

.promo-content {
    background: var(--gray-bg);
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.promo-content:hover {
    border-color: var(--deep-blue);
    background: rgba(30, 42, 120, 0.04);
}

.promo-content h3 {
    font-size: 19px;
    margin-bottom: 12px;
    line-height: 1.6;
    font-weight: 700;
    color: var(--text-primary);
}

.promo-content p {
    font-size: 17px;
    line-height: 1.8;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 문의 버튼 - 강조 스타일 */
.inquiry-button {
    position: fixed;
    bottom: 35px;
    right: 35px;
    z-index: 1000;
}

.btn-inquiry {
    background: var(--royal-blue);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(65, 105, 225, 0.4);
    transition: all 0.3s ease;
}

.btn-inquiry:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(65, 105, 225, 0.5);
    background: var(--deep-blue);
}

.btn-inquiry:active {
    transform: translateY(-1px);
}

/* 일반 페이지 컨테이너 */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30, 42, 120, 0.08);
    border: 1px solid var(--border-color);
}

.page-container h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--deep-blue);
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--deep-blue);
}

/* 로그인/회원가입 - 금융권 스타일 */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 70vh;
}

.login-box {
    background: white;
    padding: 45px;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(30, 42, 120, 0.08);
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 800;
    color: var(--deep-blue);
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
    transition: all 0.2s ease;
    background: white;
    font-family: 'Pretendard', sans-serif;
}

.form-group input:focus {
    outline: none;
    border-color: var(--royal-blue);
    box-shadow: 0 0 0 3px rgba(65, 105, 225, 0.1);
}

.btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--royal-blue);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(65, 105, 225, 0.3);
}

.btn-submit:hover {
    background: var(--deep-blue);
    box-shadow: 0 4px 12px rgba(65, 105, 225, 0.4);
}

.btn-submit:active {
    transform: translateY(1px);
}

.login-links {
    text-align: center;
    margin-top: 20px;
}

.login-links a {
    color: var(--royal-blue);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.login-links a:hover {
    color: var(--deep-blue);
    text-decoration: underline;
}

/* 스무스 스크롤 */
html {
    scroll-behavior: smooth;
}

/* 선택 영역 스타일 */
::selection {
    background: rgba(65, 105, 225, 0.2);
    color: var(--text-primary);
}

/* 스크롤바 스타일 */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--gray-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--deep-blue);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--royal-blue);
}

/* 테이블 스타일 (금융 데이터용) */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

th {
    background: var(--header-bg);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

td {
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

tr:hover {
    background: rgba(30, 42, 120, 0.02);
}

/* 배지 스타일 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background: rgba(30, 42, 120, 0.1);
    color: var(--deep-blue);
}

.badge-success {
    background: rgba(0, 200, 83, 0.1);
    color: var(--success-color);
}

.badge-danger {
    background: rgba(211, 47, 47, 0.1);
    color: var(--danger-color);
}

/* 모바일 반응형 스타일 */
@media screen and (max-width: 768px) {
    /* 헤더 로고 영역 모바일 */
    .header-logo-section {
        padding: 12px 0;
    }
    
    .header-logo-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .logo-image {
        height: 32px;
    }
    
    /* 모바일에서 스랩백 버튼 숨기기 */
    .btn-slab-back {
        display: none !important;
    }
    
    .btn-slab {
        padding: 8px 16px;
        font-size: 12px;
        gap: 6px;
    }
    
    .btn-slab .arrow-right {
        font-size: 13px;
    }
    
    /* 헤더 메뉴바 영역 모바일 */
    .header-nav-section {
        padding: 10px 0;
        position: relative;
    }
    
    .header-nav-section .container {
        padding-left: 15px;
        padding-right: 15px;
        flex-wrap: wrap;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    /* 햄버거 메뉴 표시 */
    .mobile-menu-toggle {
        display: flex;
        order: 1;
        margin-right: 10px;
    }
    
    /* 네비게이션 모바일 - 햄버거 메뉴 */
    .main-nav {
        display: none !important;
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--header-bg);
        flex-direction: column;
        gap: 0;
        padding: 0;
        padding-bottom: 20px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 1000;
        max-height: 100vh;
        overflow-y: auto;
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        opacity: 0;
        visibility: hidden;
    }
    
    .main-nav.active {
        display: flex !important;
        transform: translateY(0) !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* 모바일 메뉴 배경 오버레이 */
    .main-nav.active::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
        animation: fadeIn 0.3s ease-in-out forwards;
    }
    
    @keyframes fadeIn {
        from {
            opacity: 0;
        }
        to {
            opacity: 1;
        }
    }
    
    .nav-link {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
        text-align: left;
        border-radius: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex: none;
        min-width: auto;
    }
    
    .nav-link:last-child {
        border-bottom: none;
    }
    
    .nav-link:hover {
        background-color: var(--nav-hover);
    }
    
    /* 헤더 액션 버튼 모바일 */
    .header-actions {
        order: 2;
        margin-left: auto;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .btn-login,
    .btn-register {
        font-size: 12px;
        padding: 6px 14px;
    }
    
    .btn-slab,
    .btn-slab-back {
        font-size: 11px;
        padding: 8px 14px;
        gap: 4px;
    }
    
    .btn-slab .arrow-right,
    .btn-slab-back .arrow-right {
        font-size: 12px;
    }
    
    .user-info {
        flex-direction: row;
        align-items: center;
        gap: 8px;
    }
    
    .user-name {
        font-size: 12px;
        white-space: nowrap;
    }
    
    .btn-logout {
        font-size: 12px;
        padding: 6px 14px;
        white-space: nowrap;
    }
    
    /* 컨테이너 모바일 */
    .container {
        padding: 0 15px;
    }
    
    /* 메인 콘텐츠 모바일 */
    main {
        padding: 20px 0;
    }
}

@media screen and (max-width: 480px) {
    /* 작은 모바일 - 추가 조정 */
    .logo-image {
        height: 28px;
    }
    
    /* 모바일에서 스랩백 버튼 숨기기 */
    .btn-slab-back {
        display: none !important;
    }
    
    .btn-slab {
        padding: 6px 12px;
        font-size: 11px;
        gap: 4px;
    }
    
    .btn-slab .arrow-right {
        font-size: 11px;
    }
    
    .header-top-actions {
        gap: 8px;
    }
    
    .mobile-menu-toggle {
        width: 28px;
        height: 28px;
    }
    
    .nav-link {
        font-size: 14px;
        padding: 10px 15px;
    }
    
    .header-actions {
        gap: 6px;
    }
    
    .btn-login,
    .btn-register,
    .btn-logout {
        font-size: 11px;
        padding: 5px 12px;
        white-space: nowrap;
    }
    
    .user-name {
        font-size: 11px;
        white-space: nowrap;
    }
}
