/* 00_main_hub/style.css - 포털 메인 허브 스타일 (석가산 및 01_waste_guide 표준 100% 동기화) */
:root {
    --primary-color: #9faa4c;
    --primary-light: #717735;
    --primary-dark: #2a3014;
    --secondary-color: #558b2f;
    --accent-color: #8d6e63;
    
    --bg-color: #f7f9f2;
    --card-bg: #ffffff;
    --text-main: #2a3014;
    --text-muted: #5e6540;
    --text-light: #8e9570;
    
    --border-color: #e4e8d5;
    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 8px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 2px 4px rgba(42, 48, 20, 0.03);
    --shadow-md: 0 8px 20px -4px rgba(42, 48, 20, 0.08);
    --shadow-lg: 0 16px 30px -8px rgba(113, 119, 53, 0.15);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #0f172a;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 0;
    line-height: 1.65;
    word-break: keep-all;
}

.mobile-container {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    min-height: 100vh;
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
    padding-bottom: 24px;
    overflow-x: hidden;
}

/* =========================================
   [데스크톱 뷰 레이아웃 최적화: 01_waste_guide 기준 상단 직각 밀착]
   ========================================= */
@media (min-width: 640px) {
    body {
        padding: 0;
    }
    .mobile-container {
        border-radius: 0;
        min-height: 100vh;
    }
}

/* =========================================
   [상단 컨트롤 바: 검색창 + 햄버거 메뉴 1열 배치]
   ========================================= */
.global-top-nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #717735;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 16px rgba(42, 48, 20, 0.18);
}

.nav-control-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
}

.nav-search-box {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-search-box .search-icon {
    position: absolute;
    left: 12px;
    color: #f8ffb9;
    font-size: 13px;
    pointer-events: none;
    opacity: 0.85;
}

.nav-search-box input {
    width: 100%;
    background: rgba(42, 48, 20, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    padding: 8px 30px 8px 32px;
    color: #ffffff;
    font-size: 13px;
    outline: none;
    transition: all 0.2s ease;
}

.nav-search-box input:focus {
    background: rgba(42, 48, 20, 0.55);
    border-color: #f8ffb9;
    box-shadow: 0 0 0 2px rgba(248, 255, 185, 0.25);
}

.nav-search-box input::placeholder {
    color: rgba(255, 255, 255, 0.75);
}

.search-clear-btn {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    cursor: pointer;
    display: none;
}

.search-clear-btn:hover {
    color: #ffffff;
}

.nav-menu-toggle.hamburger-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(42, 48, 20, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.25);
    width: 38px;
    height: 36px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.nav-menu-toggle.hamburger-btn:hover,
.nav-menu-toggle.hamburger-btn.active {
    background: rgba(42, 48, 20, 0.6);
    border-color: rgba(255, 255, 255, 0.45);
}

.hamburger-box {
    width: 18px;
    height: 14px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger-line {
    display: block;
    width: 100%;
    height: 2px;
    background-color: #f8fafc;
    border-radius: 2px;
    transition: all 0.25s ease-in-out;
}

.nav-menu-toggle.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

.nav-menu-toggle.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.nav-menu-toggle.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* =========================================
   [페이지 목록 모달 팝업]
   ========================================= */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 48, 20, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1050;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.page-modal-dialog {
    position: fixed;
    top: 56px;
    left: 50%;
    transform: translateX(-50%) translateY(-10px) scale(0.98);
    width: calc(100% - 24px);
    max-width: 456px;
    background: #f7f9f2;
    border: 1px solid #e4e8d5;
    border-radius: var(--radius-md);
    box-shadow: 0 16px 36px rgba(42, 48, 20, 0.25);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
}

.page-modal-dialog.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0) scale(1);
}

.modal-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    background: #717735;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.modal-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    font-size: 14.5px;
    font-weight: 800;
}

.modal-title-icon {
    color: #fcffdc;
}

.guide-count {
    background: #558b2f;
    color: #ffffff;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 700;
    border: none;
}

.modal-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.15s ease;
}

.modal-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.3);
}

.modal-dialog-body {
    padding: 12px 14px 16px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #9faa4c #f7f9f2;
}

/* 햄버거 모달 커스텀 스크롤바 */
.modal-dialog-body::-webkit-scrollbar {
    width: 6px;
}

.modal-dialog-body::-webkit-scrollbar-track {
    background: #f7f9f2;
    border-radius: 4px;
}

.modal-dialog-body::-webkit-scrollbar-thumb {
    background: #9faa4c;
    border-radius: 4px;
}

.modal-dialog-body::-webkit-scrollbar-thumb:hover {
    background: #717735;
}

.main-home-menu-box {
    margin-bottom: 10px;
}

.main-home-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: #9faa4c;
    border: 1px solid #717735;
    border-radius: var(--radius-sm);
    text-decoration: none;
    box-shadow: 0 2px 6px rgba(113, 119, 53, 0.15);
    transition: all 0.2s ease;
}

.main-home-link:hover {
    background: #717735;
    transform: translateY(-1px);
}

.main-home-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-home-left .home-icon {
    font-size: 15px;
    color: #fcffdc;
}

.main-home-title {
    color: #ffffff !important;
    font-size: 14px !important;
    font-weight: 800 !important;
}

.menu-divider {
    height: 1px;
    background: #e4e8d5;
    margin: 10px 0 12px;
}

.page-link-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.page-link-item {
    margin-bottom: 0;
}

.page-link-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    background: #ffffff;
    border: 1px solid #e4e8d5;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: #2a3014;
    box-shadow: 0 1px 3px rgba(42, 48, 20, 0.04);
    transition: all 0.2s ease;
}

.page-link-item a:hover {
    background: #fcffdc;
    border-color: #9faa4c;
    transform: translateX(2px);
}

.page-link-item.active a {
    background: #fcffdc;
    border: 1px solid #717735;
}

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

.item-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #2a3014;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.current-badge {
    background: #558b2f;
    color: #fff;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 700;
}

.item-desc {
    font-size: 11.5px;
    color: #5e6540;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.item-arrow {
    color: #8e9570;
    font-size: 12px;
    margin-left: 8px;
}

/* =========================================
   [히어로 헤더 UI]
   ========================================= */
.hero-header {
    position: relative;
    width: 100%;
    min-height: 185px;
    height: 185px;
    overflow: hidden;
}

.hero-image-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 40%;
    transform: scale(1.04);
    filter: brightness(1.1) contrast(1.05);
    display: block;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.45) 0%, rgba(15, 23, 42, 0.6) 50%, rgba(15, 23, 42, 0.88) 100%);
}

.hero-content {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 18px;
    right: 18px;
    z-index: 2;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.apt-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 4px 12px 4px 8px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(255, 255, 255, 0.35);
    margin-bottom: 8px;
}

.apt-logo-img {
    height: 18px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}

.apt-name-tag {
    font-size: 11.5px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.hero-title {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffffff;
    line-height: 1.3;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
    text-align: center;
}

.hero-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.88);
    margin-top: 5px;
    line-height: 1.35;
    text-align: center;
}

/* =========================================
   [메인 콘텐츠 & 검색 / 카드 그리드]
   ========================================= */
.main-content {
    padding: 16px 14px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 포털 통합 검색 섹션 */
.portal-search-section {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 18px 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.portal-search-bar {
    position: relative;
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.main-search-icon {
    position: absolute;
    left: 14px;
    color: var(--text-muted);
    font-size: 15px;
    pointer-events: none;
}

.portal-search-bar input {
    width: 100%;
    background: #f7f9f2;
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 12px 36px 12px 38px;
    font-size: 0.92rem;
    color: var(--text-main);
    outline: none;
    transition: all 0.2s ease;
}

.portal-search-bar input:focus {
    background: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(159, 170, 76, 0.25);
}

.portal-search-bar input::placeholder {
    color: #8e9570;
}

.portal-search-clear {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    color: #8e9570;
    font-size: 15px;
    cursor: pointer;
    display: none;
}

.portal-search-clear:hover {
    color: var(--text-main);
}

.portal-category-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox 스크롤바 숨김 */
    -ms-overflow-style: none; /* IE/Edge 스크롤바 숨김 */
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
}

.portal-category-tabs.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.portal-category-tabs::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge 웹킷 스크롤바 완전 숨김 */
    width: 0;
    height: 0;
}

.portal-tab-btn {
    white-space: nowrap;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 700;
    padding: 7px 12px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-tab-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-light);
}

/* 가이드 카드 섹션 */
.portal-guide-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.guide-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 4px;
}

.section-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: var(--primary-dark);
}

.section-count {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 700;
}

.guide-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 개별 가이드 카드 (링크 전체 클릭 가능) */
.portal-guide-card {
    display: flex;
    align-items: center;
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 16px 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    gap: 14px;
}

.portal-guide-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon-box {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: #edf2d8;
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.card-text-box {
    flex: 1;
    min-width: 0;
}

.card-meta-line {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.card-category-tag {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--primary-light);
    background: rgba(159, 170, 76, 0.15);
    padding: 2px 7px;
    border-radius: 4px;
}

.card-badge-tag {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--secondary-color);
    background: #dcfce7;
    padding: 2px 7px;
    border-radius: 4px;
}

.card-main-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.35;
    margin-bottom: 3px;
}

.card-summary-desc {
    font-size: 0.83rem;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-arrow-icon {
    color: #94a3b8;
    font-size: 14px;
    transition: transform 0.2s ease;
}

.portal-guide-card:hover .card-arrow-icon {
    transform: translateX(3px);
    color: var(--primary-color);
}

/* 검색 결과 없을 때 */
.no-portal-result {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 36px 20px;
    text-align: center;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.no-portal-result i {
    font-size: 32px;
    color: #cbd5e1;
    margin-bottom: 10px;
}

/* 안내 박스 */
.quick-notice-card {
    background: #edf2d8;
    border-radius: var(--radius-md);
    padding: 14px 16px;
    border: 1px solid #dbe4be;
}

.quick-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.quick-icon {
    color: var(--secondary-color);
}

.quick-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.55;
}

/* =========================================
   [관리사무소 안내 & 원터치 전화 연결 (카드 박스형)]
   - 위아래 섹션(검색영역 및 생활안내가이드)과 뚜렷이 구분되는 카드형 박스
   - 테두리 윤곽선 없이 소프트 섀도우와 미니멀 텍스트 구조 유지
   ========================================= */
.office-contact-section {
    padding: 0;
}

.office-contact-info {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.office-text-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.office-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--primary-dark);
    line-height: 1.35;
    letter-spacing: -0.3px;
}

.office-desc {
    font-size: 0.76rem;
    color: var(--text-muted);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.office-tel-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.96rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    flex-shrink: 0;
    padding: 4px 0;
    transition: color 0.15s ease;
}

.office-tel-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

@media (max-width: 360px) {
    .office-contact-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* =========================================
   [푸터 UI]
   ========================================= */
.footer-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px 10px;
    gap: 10px;
}

.footer-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.footer-text {
    font-size: 13.5px;
    font-weight: 700;
    color: #475569;
    letter-spacing: -0.3px;
}
