:root {
    --primary-black: #1a1a1b;
    --sidebar-bg: #ffffff;
    --main-bg: #f5f6f8;
    --accent-color: #da0e77;
    --border-color: #efefef;
    --text-dark: #222222;
    --text-gray: #8e8e93;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    font-family: "Pretendard", sans-serif;
    margin: 0;
    padding: 0;
    transition: background-color 0.2s, color 0.2s;
}

body {
    background-color: var(--main-bg);
    color: var(--text-dark);
    padding-top: 60px;
    /* Header Space */
    padding-bottom: 70px;
    /* Footer Space */
    max-width: 500px;
    /* Mobile Viewport Lock on Desktop */
    margin: 0 auto;
    background: #fff;
    min-height: 100vh;
    border-left: 1px solid #eee;
    border-right: 1px solid #eee;
    overflow-x: hidden;
}

/* --- 다크 모드 속성 (마이페이지 연동) --- */
body.dark-theme {
    --main-bg: #121212;
    --sidebar-bg: #1e1e1e;
    --text-dark: #e4e6eb;
    --text-gray: #b0b3b8;
    --border-color: #2f3136;
    background-color: #121212;
}

body.dark-theme .mobile-header,
body.dark-theme .mobile-footer,
body.dark-theme .mobile-tabs,
body.dark-theme .section,
body.dark-theme .profile-section,
body.dark-theme .section-header {
    background-color: #18191a;
    border-color: #2f3136;
}

body.dark-theme .divider {
    background-color: #121212;
    border-color: #2f3136;
}

body.dark-theme .menu-item {
    border-bottom: 1px solid #2f3136;
}

body.dark-theme .mobile-tabs a {
    color: #b0b3b8;
}

body.dark-theme .mobile-tabs a.active {
    color: #e4e6eb;
}

/* --- 1. 상단 헤더 --- */
.mobile-header {
    position: fixed;
    top: 0;
    width: 100%;
    max-width: 500px;
    height: 60px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.mobile-header .logo img {
    height: 32px;
    width: auto;
}

.header-icons {
    display: flex;
    gap: 18px;
    font-size: 20px;
    color: var(--text-dark);
}

.header-icons a {
    color: inherit;
    text-decoration: none;
}

/* --- 2. 상단 탭 --- */
.mobile-tabs {
    background: #fff;
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding: 12px 20px;
    gap: 24px;
    border-bottom: 1px solid var(--border-color);
    scrollbar-width: none;
}

.mobile-tabs::-webkit-scrollbar {
    display: none;
}

.mobile-tabs a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 600;
    font-size: 15px;
    padding-bottom: 10px;
    position: relative;
}

.mobile-tabs a.active {
    color: var(--text-dark);
}

.mobile-tabs a.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-color);
    border-radius: 2px;
}

/* --- 2-1. 이벤트 슬라이더 --- */
.event-slider-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    background: #000;
}

.event-slider-container .swiper {
    width: 100%;
    height: auto;
}

.event-slider-container .swiper-slide img {
    width: 100%;
    display: block;
    aspect-ratio: 100 / 28;
    object-fit: cover;
}

.swiper-counter {
    position: absolute;
    bottom: 8px;
    right: 12px;
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 700;
}

.swiper-counter .total {
    opacity: 0.6;
}

/* --- 3. 캡슐 필터 --- */
.mobile-filters {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    overflow-x: auto;
    scrollbar-width: none;
}

.mobile-filters::-webkit-scrollbar {
    display: none;
}

.pill {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 7px 15px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-gray);
    cursor: pointer;
    white-space: nowrap;
    transition: 0.2s;
}

.pill.active {
    background: var(--accent-color);
    color: #fff;
    border-color: var(--accent-color);
}

/* --- 3-1. 드롭다운 필터 (index.php 전용) --- */
.filter-controls {
    display: flex;
    gap: 10px;
    padding: 0 20px 15px;
}

.filter-select {
    flex: 1;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: #fff;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="%238e8e93" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/></svg>');
    background-repeat: no-repeat;
    background-position: calc(100% - 12px) center;
    background-size: 12px;
    padding-right: 32px;
}

/* --- 3-2. 검색 바 --- */
.mobile-search {
    padding: 0 20px 15px;
}

.search-box {
    background: #f8f9fa;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 11px 18px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 14px;
    color: var(--text-dark);
    flex: 1;
}

/* 3-3. community.html 전용 검색바 패딩 보정 */
.mobile-filters+.mobile-search {
    padding-top: 15px;
    /* community pills 아래 여백 확보 */
}

/* --- 3-4. 공지사항 바 (community.php 전용) --- */
.notice-bar {
    background: #ebf5ff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #0066cc;
    cursor: pointer;
    border-bottom: 1px solid #e0f0ff;
}

.notice-bar span {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dark);
}

/* --- 4. 대시보드 리스트 공통 --- */
.job-list,
.post-list {
    background: #f5f6f8;
    padding: 0;
}

/* 구인 카드 (index.php) */
.job-card {
    background: #fff;
    border-bottom: 1px solid #f2f4f7;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
}

.job-card:last-child {
    border-bottom: none;
}

.item-rank {
    font-size: 17px;
    font-weight: 800;
    color: var(--accent-color);
    min-width: 20px;
    text-align: center;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 6px;
    line-height: 1.4;
}

.item-meta {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    gap: 6px;
    align-items: center;
}

.item-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    min-width: 80px;
    gap: 4px;
}

.item-stat {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    gap: 4px;
}

.salary-badge {
    background: #fff0f6;
    color: var(--accent-color);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

/* 게시글 카드 (community.php) */
.post-card {
    background: #fff;
    padding: 18px 20px;
    border-bottom: 1px solid #f2f4f7;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
}

.post-card:last-child {
    border-bottom: none;
}

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

.post-meta {
    font-size: 12px;
    color: var(--text-gray);
    display: flex;
    align-items: center;
    gap: 6px;
}

.avatar-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.category-tag {
    background: #f8f9fa;
    border: 1px solid #efefef;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 11px;
    color: var(--text-gray);
}

.post-body {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.post-content-container {
    flex: 1;
    min-width: 0;
}

.post-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 5px;
    line-height: 1.4;
    word-break: break-all;
}

.post-snippet {
    font-size: 13px;
    color: var(--text-gray);
    line-height: 1.4;
    word-break: break-all;
}

.post-footer {
    display: flex;
    gap: 14px;
    font-size: 12px;
    color: var(--text-gray);
}

.post-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-img {
    width: 68px;
    height: 68px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #eee;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.post-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --- 4-1. 마이페이지 전용 스타일 (mypage.php) --- */
.mypage-container {
    display: flex;
    flex-direction: column;
}

.section {
    background: #fff;
    padding: 0 20px;
}

/* 구분선 디바이더 */
.divider {
    height: 8px;
    background: #f5f6f8;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

/* 프로필 섹션 */
.profile-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: #fff;
}

.profile-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar-circle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: #e0e0f8;
    display: inline-block;
}

.username {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-dark);
}

.profile-actions {
    font-size: 13px;
    color: var(--text-gray);
    display: flex;
    gap: 15px;
}

.profile-actions a {
    text-decoration: none;
    color: var(--text-gray);
}

/* 메뉴 아이템 공통 */
.menu-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #f8f9fa;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-dark);
    cursor: pointer;
}

.menu-item:last-child {
    border-bottom: none;
}

.menu-item .item-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 6px;
}

.chevron-icon {
    color: #ccc;
    font-size: 14px;
}

/* 단일 정보 헤더 섹션 */
.section-header {
    padding: 18px 20px 8px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
}

.section-header .sub-text {
    font-size: 12px;
    color: #aaa;
    font-weight: 400;
}

/* 배지 */
.status-badge {
    background: var(--accent-color);
    color: #fff;
    font-size: 11px;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 700;
    border: none;
}

.action-link {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
}

/* 토글과 아이콘 */
.toggle-switch {
    width: 42px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: 0.2s;
}

.toggle-switch::after {
    content: '';
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    right: 2px;
    transition: 0.2s;
}

.toggle-switch.inactive {
    background: #ccc;
}

.toggle-switch.inactive::after {
    right: 20px;
}

.sun-icon {
    color: #555;
    font-size: 18px;
}

body.dark-theme .sun-icon {
    color: #ffd43b;
}

/* --- 5. 플로팅 버튼 (FAB) --- */
.fab {
    position: fixed;
    bottom: 85px;
    width: 52px;
    height: 52px;
    background: var(--accent-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(218, 14, 119, 0.3);
    z-index: 999;
    cursor: pointer;
}

@media (min-width: 501px) {
    .fab {
        left: calc(50% + 200px);
    }
}

@media (max-width: 500px) {
    .fab {
        right: 20px;
    }
}

/* --- 6. 하단 바 --- */
.mobile-footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    max-width: 500px;
    height: 60px;
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border-color);
    z-index: 1000;
}

.mobile-footer a {
    text-decoration: none;
    color: var(--text-gray);
    font-size: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.mobile-footer a.active {
    color: var(--text-dark);
}

/* 푸터 내장 중앙 FAB 버튼 */
.footer-fab {
    background: var(--accent-color);
    color: #fff !important;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px !important;
    box-shadow: 0 4px 10px rgba(218, 14, 119, 0.2);
    margin-top: -24px;
    /* 반쯤 걸치도록 위로 끌어올림 */
    border: 4px solid #fff;
    /* 흰색 테두리로 분리선 생성 */
    flex-shrink: 0;
}