/* style.css */
:root {
    --bg-color: #f1f5f9;
    --header-bg: #0f172a;
    --nav-bg: #ffffff;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #475569;
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --accent-color: #ea580c;
    --border-color: #cbd5e1;
    --input-bg: #f8fafc;
    --modal-overlay: rgba(15, 23, 42, 0.6);
}

[data-theme='dark'] {
    --bg-color: #020617;
    --header-bg: #000000;
    --nav-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    --primary-color: #3b82f6;
    --primary-hover: #60a5fa;
    --border-color: #334155;
    --input-bg: #1e293b;
    --modal-overlay: rgba(0, 0, 0, 0.85);
}

body {
    font-family: 'Pretendard', sans-serif;
    background: var(--bg-color);
    color: var(--text-main);
    margin: 0;
    line-height: 1.7;
    transition: 0.3s;
}

header {
    background: var(--header-bg);
    color: white;
    padding: 50px 20px;
    text-align: center;
}
header h1 { font-size: 36px; margin: 0; font-weight: 900; }
header p { opacity: 0.8; font-size: 16px; margin-top: 8px; }

/* 네비게이션 - 잘림 방지 및 정렬 최적화 */
.category-nav {
    background: var(--nav-bg);
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    min-height: 70px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.nav-links { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; align-items: center; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a {
    text-decoration: none; color: var(--text-sub);
    padding: 8px 15px; border-radius: 8px;
    font-size: 14px; font-weight: 700; transition: 0.2s;
    white-space: nowrap;
}
.nav-item:hover > a { color: var(--primary-color); background: var(--bg-color); }

.dropdown {
    display: none; position: absolute; top: 100%; left: 0;
    background: var(--nav-bg); min-width: 220px; max-height: 400px;
    overflow-y: auto; box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    border-radius: 12px; padding: 10px 0; border: 1px solid var(--border-color); z-index: 1100;
}
.nav-item:hover .dropdown { display: block; }
.dropdown li { padding: 10px 20px; font-size: 13px; cursor: pointer; color: var(--text-main); }
.dropdown li:hover { background: var(--primary-color); color: white; }

/* 컨트롤 영역 (검색 + 독립된 테마버튼) */
.nav-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-shrink: 0;
    margin-left: 20px;
}

.search-container { 
    position: relative; 
    width: 180px; 
    transition: width 0.3s ease;
}

#job-search {
    width: 100%; padding: 10px 15px 10px 35px;
    border: 2px solid var(--border-color); background: var(--input-bg);
    color: var(--text-main); border-radius: 50px; outline: none; font-size: 13px;
}
.search-container::before { content: '🔍'; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; opacity: 0.6; }

/* 테마 버튼 - 가시성 극대화 */
.theme-toggle {
    background: var(--primary-color); /* 배경색 강조 */
    color: white !important;
    padding: 8px 16px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.3s;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.2);
    white-space: nowrap;
}

.theme-toggle:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.3);
}

/* 사이트 소개 */
.site-intro { background: var(--nav-bg); padding: 60px 20px; border-bottom: 1px solid var(--border-color); text-align: center; }
.intro-content { max-width: 900px; margin: 0 auto; }
.intro-content h2 { color: var(--primary-color); font-size: 32px; font-weight: 800; margin-bottom: 15px; }
.intro-content p { color: var(--text-sub); font-size: 18px; max-width: 700px; margin: 0 auto; }

/* 메인 레이아웃 */
.layout { 
    display: flex; 
    max-width: 1400px; 
    margin: 40px auto; 
    padding: 0 20px; 
    gap: 30px; 
    align-items: stretch; /* 사이드바 높이를 본문과 동기화 */
}

.side-ad { 
    width: 180px; 
    flex-shrink: 0; 
    position: relative; /* 스티키의 기준점 */
}

.ad-box {
    position: sticky; 
    top: 100px; /* 상단에서 100px 지점에 걸림 */
    height: 600px; 
    background: var(--nav-bg); 
    border: 1px solid var(--border-color); /* 점선에서 실선으로 변경하여 더 전문적으로 보이게 함 */
    border-radius: 20px; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    text-align: center; 
    color: var(--text-sub); 
    font-size: 13px; 
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.content { flex: 1; min-width: 0; }
.job-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }

.job-card { background: var(--card-bg); padding: 25px; border-radius: 20px; border: 1px solid var(--border-color); transition: 0.2s; }
.job-card:hover { transform: translateY(-5px); border-color: var(--primary-color); }
.job-card h2 { font-size: 18px; margin: 10px 0; }
.job-card .desc { font-size: 13px; color: var(--text-sub); height: 40px; overflow: hidden; margin-bottom: 15px; }

.btn-detail { width: 100%; padding: 12px; border-radius: 10px; border: none; background: var(--primary-color); color: white; font-weight: 700; cursor: pointer; transition: 0.2s; }

/* 푸터 */
footer { background: var(--header-bg); color: white; padding: 40px 20px; margin-top: 100px; text-align: center; }
.footer-links a { color: white; text-decoration: none; margin: 0 15px; font-size: 14px; opacity: 0.7; }

/* 모달 */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: var(--modal-overlay); backdrop-filter: blur(8px); z-index: 2000; justify-content: center; align-items: center; }
.modal-content { background: var(--card-bg); padding: 40px; border-radius: 25px; width: 90%; max-width: 750px; max-height: 85vh; overflow-y: auto; position: relative; }
.close-btn { position: absolute; top: 20px; right: 25px; font-size: 30px; cursor: pointer; color: var(--text-sub); }

.detail-title { font-size: 13px; font-weight: 800; color: var(--primary-color); margin-bottom: 8px; display: block; }
.tag { display: inline-block; background: var(--bg-color); padding: 5px 12px; border-radius: 6px; font-size: 13px; margin: 0 6px 6px 0; border: 1px solid var(--border-color); }

@media (max-width: 1100px) { .side-ad { display: none; } }
@media (max-width: 800px) { 
    .category-nav { flex-direction: column; height: auto; padding: 15px; } 
    .nav-controls { width: 100%; margin-top: 10px; justify-content: space-between; } 
    .search-container { flex: 1; }
}
