/* 공통 변수 및 초기화 */
:root {
    --primary-color: #0f172a; /* 신뢰감 있는 슬레이트 딥 네이비 */
    --accent-color: #0284c7;  /* 현대적인 신뢰의 포인트 블루 */
    --bg-color: #f8fafc;      /* 눈이 편안한 미색 배경 */
    --card-bg: #ffffff;
    --text-color: #334155;    /* 부드러운 차콜 텍스트 */
    --text-muted: #64748b;
    --border-color: #e2e8f0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 글로벌 네비게이션 헤더 (PC/모바일 공통) */
header {
    background-color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
}

.logo a {
    color: white;
    text-decoration: none;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-menu a {
    color: #94a3b8;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    padding: 8px 0;
    transition: color 0.2s;
}

.nav-menu a:hover, .nav-menu a.active {
    color: white;
    border-bottom: 2px solid var(--accent-color);
}

/* 메인 레이아웃 컨테이너 */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    min-height: 70vh;
}

.page-header {
    margin-bottom: 25px;
    border-left: 4px solid var(--accent-color);
    padding-left: 12px;
}

.page-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--primary-color);
}

/* 모던 서브 탭 메뉴 (소메뉴) */
.sub-menu {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* 스크롤바 디자인 숨김 처리 (모바일용) */
.sub-menu::-webkit-scrollbar { display: none; }

.tab-btn {
    background: white;
    border: 1px solid var(--border-color);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    white-space: nowrap;
    transition: all 0.2s;
}

.tab-btn:hover, .tab-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 섹션 전환 애니메이션 */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* 모던 카드 그리드 시스템 */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 26px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.25s;
    cursor: pointer;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 20px -5px rgba(0,0,0,0.08);
    border-color: #cbd5e1;
}

.card-tag {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-color);
    background: #e0f2fe;
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 14px;
}

.card h3 {
    font-size: 19px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 10px;
    line-height: 1.4;
}

.card p {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.card-meta {
    font-size: 13px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    border-top: 1px solid #f1f5f9;
    padding-top: 12px;
}

/* 홈 화면 전용 히어로 배너 */
.hero-section {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: white;
    padding: 60px 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    text-align: center;
}

.hero-section h1 { font-size: 32px; margin-bottom: 15px; }
.hero-section p { color: #94a3b8; font-size: 16px; margin-bottom: 25px; }
.hero-btn { display: inline-block; background-color: var(--accent-color); color: white; padding: 12px 30px; border-radius: 8px; text-decoration: none; font-weight: 700; transition: background 0.2s; }
.hero-btn:hover { background-color: #026ca3; }

/* 종목추천 테이블 양식 */
.table-container { background: white; border: 1px solid var(--border-color); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.02); }
table { width: 100%; border-collapse: collapse; text-align: left; }
th { background-color: #f1f5f9; color: var(--primary-color); padding: 16px; font-size: 14px; font-weight: 700; border-bottom: 1px solid var(--border-color); }
td { padding: 18px 16px; font-size: 14px; border-bottom: 1px solid #f1f5f9; color: #475569; }
tr:hover td { background-color: #f8fafc; }
.badge { display: inline-block; padding: 4px 8px; font-size: 12px; font-weight: 600; border-radius: 4px; }
.badge-buy { background-color: #fee2e2; color: #dc2626; }

/* 공통 푸터 */
footer {
    background-color: var(--primary-color);
    color: #64748b;
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    font-size: 13px;
    border-top: 1px solid #1e293b;
}

/* 완벽한 모바일 반응형 처리 */
@media (max-width: 768px) {
    .nav-container { flex-direction: column; gap: 15px; padding: 15px; }
    .nav-menu { width: 100%; justify-content: space-around; gap: 0; }
    .hero-section { padding: 40px 20px; }
    .hero-section h1 { font-size: 24px; }
    .grid { grid-template-columns: 1fr; }
    .table-container { overflow-x: auto; }
    table { min-width: 600px; }
}