@charset "UTF-8";

/* ============================================================
   🎨 1. 테마 색상 팔레트 정의 (CSS 변수)
   - 여기서 색상만 바꾸면 사이트 전체가 부드럽게 바뀝니다!
============================================================ */
:root {
    /* ☀️ 라이트 모드 (기본) */
    --bg-main: #f0f0f0;
    --bg-map-container: #e5e5e5;
    --bg-card: #ffffff;
    --bg-input: transparent;
    --bg-hover: #f9f9f9;

    --text-main: #333333;
    --text-sub: #555555;
    --text-muted: #999999;
    --text-primary: #4285F4;

    --border-light: #eeeeee;
    --border-mid: #dddddd;
    --border-dark: #333333;

    --btn-primary: #89CFF0;
    --btn-primary-hover: #6CBFE0;
    --btn-scrap: #ffffff;
    --btn-saved-bg: #ffca28;
    --btn-saved-text: #333333;

    --shadow-color: rgba(0, 0, 0, 0.15);
    --shadow-heavy: rgba(0, 0, 0, 0.2);

    --badge-blue-bg: #e3f2fd;
    --badge-blue-text: #1565c0;
    --badge-yellow-bg: #fff9c4;
    --badge-yellow-text: #f9a825;
}

body.dark-mode {
    /* 🌙 다크 모드 덮어쓰기 */
    --bg-main: #121212;
    --bg-map-container: #1e1e1e;
    --bg-card: #1e1e1e;
    --bg-input: transparent;
    --bg-hover: #2a2a2a;

    --text-main: #ffffff;
    --text-sub: #cccccc;
    --text-muted: #aaaaaa;
    --text-primary: #76a9ff;

    --border-light: #333333;
    --border-mid: #444444;
    --border-dark: #555555;

    --btn-primary: #4a90e2;
    --btn-primary-hover: #357abd;
    --btn-scrap: transparent;
    --btn-saved-bg: #ffca28;
    --btn-saved-text: #333333;

    --shadow-color: rgba(0, 0, 0, 0.5);
    --shadow-heavy: rgba(0, 0, 0, 0.6);

    --badge-blue-bg: #2b3a4a;
    --badge-blue-text: #76a9ff;
    --badge-yellow-bg: #4a3f1a;
    --badge-yellow-text: #ffca28;
}

/* ============================================================
   🌌 2. 공통 요소 부드러운 전환 (스무스 다크모드)
============================================================ */
body, .map-container, .search-bar, .nav-box, .floating-card,
.bottom-sheet, .sheet-handle, .job-table th, .job-table td,
.chat-widget, .chat-widget-header {
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html, body {
    margin: 0; padding: 0; width: 100%; height: 100%;
    overflow: hidden; /* 지도 화면 불필요한 스크롤 방지 */
    font-family: 'Noto Sans KR', 'Noto Sans JP', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
}

.map-header-wrapper > div,
.map-header-wrapper header {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between; /* 양쪽 끝으로 로고와 메뉴를 쫙 벌려줍니다 */
}

/* 헤더 백그라운드 */
.map-header-wrapper .nav-menu {
    background-color: rgb(255 255 255 / 89%);
    /* box-shadow: 0 0 4px rgba(255, 255, 255, 1.0); */
    border-radius: 19px;
    padding: 5px 12px 5px 12px;
}

body.dark-mode .map-header-wrapper .nav-menu {
    background-color: rgb(0 0 0 / 89%);
    border-radius: 19px;
    padding: 5px 18px 5px 18px;
}

/* ============================================================
   🗺️ 3. 지도 컨테이너 레이아웃
============================================================ */
.map-container {
    position: relative;
    width: 100%;
    /*height: calc(100vh - 80px); !* 헤더 높이만큼 빼기 *!*/
    /*margin-top: 80px;           !* 헤더 영역 확보 *!*/
    /* 아래 내용 전환하면 지도가 전체화면으로 전환됨 */
    height: calc(100vh + 80px); /* 헤더 높이만큼 빼기 */
    margin-bottom: 80px;           /* 헤더 영역 확보 */
    background-color: var(--bg-map-container);
}

#map { width: 100%; height: 100%; }

/* ============================================================
   🔍 4. 검색바 & 하단 네비게이션
============================================================ */
.map-search-floating {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    z-index: 1000; width: 90%; max-width: 480px;
}

.search-bar {
    display: flex; align-items: center; padding: 12px 20px; border-radius: 50px;
    background: var(--bg-card); box-shadow: 0 4px 12px var(--shadow-color);
    border: 1px solid var(--border-light);
}

.search-bar .menu-icon { margin-right: 15px; color: var(--text-sub); cursor: pointer; }
.search-bar input { border: none; outline: none; background: var(--bg-input); flex: 1; font-size: 15px; color: var(--text-main); }
.search-bar button { background: none; border: none; cursor: pointer; color: var(--text-primary); font-size: 18px; }
.search-bar .divider { width: 1px; height: 18px; background-color: var(--border-mid); margin: 0 15px 0 10px; }

#regionSelect {
    border: none; outline: none; background: transparent; font-size: 15px; font-weight: 600;
    color: var(--text-main); cursor: pointer; font-family: 'Noto Sans KR', sans-serif; padding: 0 5px;
}
#regionSelect option { background-color: var(--bg-card); color: var(--text-main); }

/* 하단 네비게이션 탭 */
.map-bottom-nav {
    position: absolute; bottom: 20%; left: 50%; transform: translateX(-50%); z-index: 100; width: auto;
}

.nav-box {
    display: flex; padding: 8px 10px; border-radius: 40px; gap: 10px;
    background: var(--bg-card); box-shadow: 0 5px 20px var(--shadow-heavy);
    border: 1px solid var(--border-light);
}

.nav-item {
    background: none; border: none; width: 80px; cursor: pointer; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s;
}
.nav-item .icon-box { font-size: 20px; margin-bottom: 4px; position: relative; }
.nav-item span { font-size: 11px; font-weight: 500; }
.nav-item.active { color: var(--text-primary); }
.nav-item.active .icon-box { transform: translateY(-2px); }

.badge-dot {
    position: absolute; top: -2px; right: -5px; padding: 2px 4px; border-radius: 50%;
    background: #ff4757; color: white; font-size: 9px; font-weight: bold; border: 1px solid white;
}

/* ============================================================
   📋 5. 플로팅 카드 (Job Detail Card)
============================================================ */
.floating-card {
    position: absolute; top: 20px; left: 20px; width: 320px; padding: 20px; border-radius: 12px; z-index: 1200;
    background: var(--bg-card); box-shadow: 0 4px 15px var(--shadow-heavy);
    border: 1px solid var(--border-light);
    display: none; animation: slideIn 0.3s ease-out;
}
@keyframes slideIn { from { transform: translateX(-20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.btn-close-card { position: absolute; top: 10px; right: 15px; background: none; border: none; font-size: 24px; color: var(--text-muted); cursor: pointer; }
.btn-close-card:hover { color: var(--text-main); }

/* 🌟 [수정] 헤더 섹션: 중앙 정렬로 깔끔하게 변경 */
.card-header-section {
    display: flex;
    justify-content: center; /* 가로 중앙 정렬 */
    align-items: center;
    margin-bottom: 15px;
    position: relative; /* 닫기 버튼과 겹치지 않게 기준점 마련 */
}

/* 🌟 [수정] 박스 없애고 텍스트 정렬 (기존 .profile-icon은 HTML에서 삭제해도 무방함) */
.profile-info {
    display: flex;
    flex-direction: column;
    align-items: center; /* 텍스트도 중앙 정렬 */
    text-align: center;
}

.company-name {
    font-size: 18px !important; /* 글씨 크기 키움 */
    font-weight: 800 !important; /* 글씨 두께 더 진하게 */
    color: var(--text-main) !important;
}

.card-image-wrapper { width: 100%; height: 160px; border-radius: 8px; overflow: hidden; margin-bottom: 15px; background-color: var(--bg-hover); }
.card-image-wrapper img { width: 100%; height: 100%; object-fit: cover; }

.card-body-section { margin-bottom: 20px; }
.job-title { font-size: 18px; font-weight: bold; margin: 0 0 8px 0; color: var(--text-main); }
.job-address, .job-phone { font-size: 13px; color: var(--text-sub); margin: 4px 0; }

.card-footer-section { display: flex; gap: 10px; }

/* 공통 버튼 스타일 */
.btn-scrap, .btn-primary-custom {
    flex: 1; padding: 8px 0; border-radius: 20px; font-size: 13px; font-weight: bold; cursor: pointer; transition: background 0.2s;
}

/* 카드 내 찜 버튼 */
.btn-scrap { background: var(--btn-scrap); border: 1px solid var(--border-mid); color: var(--text-sub); }
.btn-scrap:hover { background: var(--bg-hover); }

#jobDetailCard .card-footer-section .btn-scrap.favorite {
    background-color: var(--btn-saved-bg) !important;
    color: var(--btn-saved-text) !important;
    border-color: var(--btn-saved-bg) !important;
}

/* 상세보기 버튼 */
.btn-primary-custom { background: var(--btn-primary); border: none; color: white; }
.btn-primary-custom:hover { background: var(--btn-primary-hover); }

/* ============================================================
   📜 6. 바텀 시트 (Bottom Sheet) & 테이블
============================================================ */
.bottom-sheet {
    position: fixed; bottom: 0; left: 0; width: 100%; height: 80vh; z-index: 200;
    background-color: var(--bg-card); border-radius: 20px 20px 0 0;
    box-shadow: 0 -5px 20px var(--shadow-color); border-top: 1px solid var(--border-light);
    transform: translateY(calc(100% - 60px)); transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}
.bottom-sheet.active { transform: translateY(0); }

.sheet-handle { height: 60px; width: 100%; display: flex; justify-content: center; align-items: center; cursor: pointer; border-radius: 20px 20px 0 0; }
.handle-bar { width: 50px; height: 5px; background-color: var(--border-mid); border-radius: 5px; }

.sheet-content { height: calc(100% - 60px); overflow-y: auto; padding: 0 20px 20px 20px; box-sizing: border-box; }
.sheet-content h2 { padding: 0 10px; font-size: 18px; color: var(--text-main); }

/* ============================================================
   🌟 테이블 영역 (검색창과 동일한 황금비율 레이아웃)
============================================================ */
.table-wrapper { width: 100%; overflow-x: auto; margin-top: 10px; }
.job-table { width: 100%; border-collapse: collapse; min-width: 1000px; table-layout: auto; } /* 🌟 800px -> 1000px로 넓혀서 검색창과 동일한 쾌적함 부여 */
.job-table th { position: sticky; top: 0; z-index: 10; padding: 12px 10px; text-align: left; font-size: 13px; white-space: nowrap; background-color: var(--bg-hover); color: var(--text-muted); border-bottom: 2px solid var(--border-mid); }
.job-table td { padding: 14px 10px; vertical-align: middle; font-size: 14px; border-bottom: 1px solid var(--border-light); }
.job-table tr:hover td { background-color: var(--bg-hover); } /* 🌟 검색창처럼 마우스 올렸을 때 하이라이트 효과 추가 */

/* 🌟 1. [마법의 1줄 고정] 회사명(2), 급여(4), 연락처(5), 담당자(6), 관리(7) 컬럼은 절대 줄바꿈 금지! */
.job-table td:nth-child(2),
.job-table td:nth-child(4),
.job-table td:nth-child(5),
.job-table td:nth-child(6),
.job-table td:nth-child(7) {
    white-space: nowrap !important;
    word-break: keep-all;
}

/* 🌟 2. [비율 양보] 제목(1)과 근무지(3)는 공간을 넓게 차지하고 자연스럽게 줄바꿈 허용 */
.job-table td:nth-child(1) { width: 35%; white-space: normal; line-height: 1.4; }
.job-table td:nth-child(3) { width: 25%; white-space: normal; line-height: 1.4; }

/* 🌟 3. [핵심] 상호명(2), 급여(4), 연락처(5)가 너무 길면 '...'으로 자르기! */
.job-table td:nth-child(2),
.job-table td:nth-child(4),
.job-table td:nth-child(5) {
    max-width: 150px; /* 이 길이를 넘어가면 자릅니다 */
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 텍스트 디테일 설정 */
.title-text { font-size: 15px; font-weight: 700; color: var(--text-main); margin-bottom: 4px; display: block; line-height: 1.4; }
.company-text { color: var(--text-primary); font-weight: 700; text-decoration: none; font-size: 13px; }
.wage-text { color: var(--text-primary); font-weight: 700; font-size: 13px; }
.addr-text { color: var(--text-sub); font-size: 13px; }
.contact-text { color: var(--text-main); font-size: 12px; }

.badge { display: inline-block; padding: 2px 6px; font-size: 10px; border-radius: 4px; margin-right: 3px; font-weight: 500; }
.bg-blue { background: var(--badge-blue-bg); color: var(--badge-blue-text); }
.bg-yellow { background: var(--badge-yellow-bg); color: var(--badge-yellow-text); }

.profile-wrap { display: flex; align-items: center; gap: 8px; }
.profile-img { width: 32px; height: 32px; border-radius: 50%; background: var(--bg-hover); object-fit: cover; }
.profile-info div:first-child { font-size: 12px; font-weight: 500; color: var(--text-main); }
.profile-info div:last-child { font-size: 11px; color: var(--text-muted); }

/* 버튼들이 서로 찌그러지거나 위아래로 꺾이지 않도록 강제 정렬 */
.btn-wrap { display: flex; gap: 5px; flex-wrap: nowrap; align-items: center; }
.btn {
    border: 1px solid var(--border-mid); background: var(--bg-input); color: var(--text-main);
    padding: 6px 12px; border-radius: 4px; font-size: 12px; cursor: pointer;
    white-space: nowrap; /* 버튼 속 글씨 꺾임 방지 */
}
.btn:hover { background-color: var(--bg-hover); }
.btn-view { background: var(--btn-primary); color: white; border: none; font-weight: bold; }
.btn-view:hover { background: var(--btn-primary-hover); }
.msg-box { text-align: center; padding: 40px; color: var(--text-muted); font-size: 14px; }

/* 리스트 내 찜해제 버튼 */
.btn-saved {
    background-color: var(--btn-saved-bg) !important;
    color: var(--btn-saved-text) !important;
    border: 1px solid var(--btn-saved-bg) !important;
    font-weight: bold;
}
/* ============================================================
   💬 7. 채팅 위젯
============================================================ */
.chat-widget {
    position: fixed; top: 100px; right: 20px; width: 380px; height: 600px; z-index: 9999;
    background: var(--bg-card); border-radius: 12px; box-shadow: 0 8px 30px var(--shadow-heavy);
    display: flex; flex-direction: column; overflow: hidden;
    border: 1px solid var(--border-light);
}
.chat-widget.hidden { display: none; }
.chat-widget.minimized { height: 45px !important; }

.chat-widget-header {
    height: 45px; padding: 0 15px; box-sizing: border-box; cursor: grab; user-select: none;
    display: flex; justify-content: space-between; align-items: center;
    background-color: var(--text-main); color: var(--bg-main); /* 헤더는 배경색 반전 */
}
.chat-widget-header:active { cursor: grabbing; }

.widget-title { font-weight: bold; font-size: 14px; }
.control-btn { background: none; border: none; color: var(--bg-hover); cursor: pointer; font-size: 16px; margin-left: 10px; }
.control-btn:hover { color: white; }
.close-btn:hover { color: #ff4d4d; }

.chat-iframe { width: 100%; flex: 1; border: none; }

body.dark-mode .map-header-wrapper .nav-menu {
    background-color: rgba(44, 40, 40, 0.89);
}