/* [1. 기본 변수 및 초기화] */
:root { --primary-color: #4CAF50; --primary-hover: #45a049; --bg-color: #f5f5f5; --card-bg: #ffffff; --text-color:black;}
html { overflow-y: scroll; }
body { 
    padding-top: 100px !important;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    font-family: "Pretendard Variable", "Pretendard", -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif; background-color: var(--bg-color); margin: 0; padding-top: 170px; padding-bottom: 60px; color: #333; }

input, textarea { -webkit-user-select: text; -ms-user-select: text; user-select: text;}
#mapView { height: auto; width: 100%; position: relative; z-index: 1; display: none; }
body.map-mode-active { overflow: hidden; }
.custom-emoji-marker { background: none !important; border: none !important; display: flex; justify-content: center; align-items: center; }
.leaflet-control-locate { background: white; width: 34px; height: 34px; line-height: 34px; text-align: center; cursor: pointer; box-shadow: 0 1px 5px rgba(0,0,0,0.65); border-radius: 4px; font-size: 20px; }
.custom-map-popup .leaflet-popup-content-wrapper { padding: 0 !important; overflow: hidden; border-radius: 12px;}
.custom-map-popup .leaflet-popup-content { margin: 0 !important; width: 250px !important; }
.custom-map-popup .card { box-shadow: none !important; }

/* [2. 헤더 레이아웃 - 고정 디자인] */
header { position: fixed; top: 0; left: 0; right: 0; background: #ffffff; z-index: 1000; padding: 10px 20px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); display: flex; flex-direction: column; gap: 8px; }
.header-top { display: flex; width: 100%; max-width: 1400px; justify-content: space-between; align-items: center; margin: 0 auto; box-sizing: border-box; }
.title-area { display: flex; align-items: center; gap: 15px; }
.header-logo { height: 1.2em; vertical-align: middle; margin-right: 8px; margin-top: -4px; }
header h1 { margin: 0; font-size: 1.2em; letter-spacing: -0.5px; color: #333; }
.logo-link { text-decoration: none; color: inherit; display: flex; align-items: center; }
.logo-link:hover h1 { opacity: 0.8; }
.btn-common { height: 35px; padding: 4px 12px; border-radius: 15px; border: 2px solid var(--primary-color); background: var(--card-bg); color: var(--primary-color); text-decoration: none; font-size: 0.8em; font-weight: bold; }
.btn-common:hover { background: var(--primary-color); color: white; }
.search-container { position: relative; display: inline-flex; align-items: center; background-color: #fff; border: 1px solid #ddd; border-radius: 20px; padding: 0 10px; height: 36px; width: 280px; box-sizing: border-box; vertical-align: middle; }
#searchInput { flex: 1; border: none !important; outline: none !important; background: transparent !important; padding: 0 5px; font-size: 14px; height: 100%; min-width: 0; }
.clear-icon { position: static !important; transform: none !important; cursor: pointer; color: #ccc; font-size: 14px; margin-left: 5px; display: flex; align-items: center; }
.search-icon { color: #888; font-size: 14px; cursor: pointer; display: flex; align-items: center; }

/* [3. 필터 및 태그 그룹] */
.filter-row { display: flex !important; flex-wrap: nowrap !important; overflow: visible !important; justify-content: space-between;}
.filter-row select { padding: 8px 30px 8px 12px; border-radius: 8px; border: 1px solid #ddd; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 12px; font-family: inherit; font-size: 0.9em; cursor: pointer; appearance: none; -webkit-appearance: none; }
.filter-row select:hover { border-color: var(--primary-color); }
.header-bottom { width: 100%; max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.filter-left-group { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; overflow: visible !important; }
.custom-dropdown { position: relative; display: inline-block; }
.custom-dropdown .dropdown-btn { display: flex; align-items: center; justify-content: space-between; min-width: 120px; height: 38px; padding: 0 12px; border: 1px solid #ddd; border-radius: 8px; background: #fff; font-size: 11.5px; color: #333; cursor: pointer; transition: 0.2s; box-sizing: border-box; }
.custom-dropdown .dropdown-btn:hover { border-color: #bbb; background: #f9f9f9; }
.dropdown-arrow { margin-left: 8px; font-size: 8px; color: #999; transition: transform 0.2s; }

.dropdown-content { display: none; position: absolute; top: 100%; left: 0; z-index: 1000; width: 100%; min-width: 180px; max-height: 300px; margin-top: 5px; border: 1px solid #ddd; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.1); flex-direction: column; box-sizing: border-box; overflow-y: auto; }
.dropdown-content > div:not(.dropdown-apply-area), .dropdown-content > .tag-list-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; min-height: 0; }.dropdown-content .tag-list-body, .dropdown-content .region-group-container, .dropdown-content > label:not(.all-option) { overflow-y: auto; flex: 1; }
.dropdown-content .tag-list-body, .dropdown-content .region-group-container { display: block; width: 100%; height: auto; }
.dropdown-content::-webkit-scrollbar { width: 5px; }
.dropdown-content::-webkit-scrollbar-thumb { background: #ccc; border-radius: 10px; }
.dropdown-item { display: flex; align-items: center; flex-shrink: 0; background: #fff; font-size: 10.5px; padding: 5px 12px; color: #444; cursor: pointer; transition: 0.2s; }
.dropdown-item:hover { background: #f8f9fa; }
.dropdown-item input[type="checkbox"] { width: 16px; height: 16px; margin-right: 10px; accent-color: #45a049; cursor: pointer; }
.selected-text { display: block; max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.btn-apply-green { width: 100%; height: 32px; background: var(--primary-color); color: #fff; border: none; border-radius: 6px; font-size: 11.5px; font-weight: 700; cursor: pointer; transition: background 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-apply-green:hover { background: var(--primary-hover); }
.dropdown-sticky-header { position: -webkit-sticky; position: sticky; top: 0; z-index: 100; background-color: #fff; }
.dropdown-apply-area { padding: 8px; border-top: 1px solid #eee; background: #fdfdfd; }
.dropdown-apply-area.sticky-bottom { position: sticky; bottom: 0; width: 100%; background: #fff; padding: 10px; border-top: 1px solid #eee; box-sizing: border-box; z-index: 10; margin-top: auto; flex-shrink: 0; }

.dropdown-active { border: 3px solid var(--primary-color) !important; background-color: #f8fff9; }
.selected-count-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 5px; margin-right: 5px; border-radius: 50%; background: #45a049; color: #fff; font-size: 10px; font-weight: bold; line-height: 1; }
.region-name { display: flex; justify-content: space-between; flex-grow: 1; margin-left: 10px; padding-right: 12px; cursor: pointer; }
.country-list { padding: 5px 12px; margin-left: 15px; border-left: 1px dashed #ddd; background: #f9f9f9; }

.btn-reset { display: flex; align-items: center; justify-content: center; padding: 4px 12px; border: none !important; background: transparent !important; color: var(--primary-color); font-size: 0.8em; font-weight: bold; cursor: pointer; transition: 0.2s; }
.btn-reset:hover { color: #ff4d4d; }
.btn-reset .btn-icon { font-size: 1.2rem !important; font-weight: normal !important; line-height: 1; margin-right: 6px; }
.btn-reset:hover .btn-icon { transform: rotate(-180deg); display: inline-block; transition: transform 0.3s ease; }

.fab-wrapper { position: fixed; bottom: 30px; right: 30px; z-index: 9999; display: flex; align-items: center; justify-content: center; }
.fab-main { width: 56px; height: 56px; background: #52c41a; border: none; border-radius: 50%; color: white; box-shadow: 0 4px 10px rgba(0,0,0,0.3); cursor: pointer; z-index: 2; transition: all 0.3s; display: flex; align-items: center; justify-content: center; position: relative; }
.fab-main.active { background: #ff4d4f; }
.hamburger { width: 24px; height: 18px; position: relative; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.hamburger span { display: block; width: 100%; height: 2px; background: white; transition: all 0.3s; border-radius: 2px; }
.fab-main.active .hamburger span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.fab-main.active .hamburger span:nth-child(2) { opacity: 0; }
.fab-main.active .hamburger span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
.fab-menu { position: absolute; width: 100%; height: 100%; pointer-events: none; }
.fab-item { position: absolute; right: 0; width: auto; min-width: 160px; height: 44px; background: white; border: 2px solid #52c41a; border-radius: 25px; display: flex; align-items: center; padding: 0 15px; text-decoration: none; transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); opacity: 0; transform: scale(0.8); pointer-events: none; gap: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); }
.fab-item span { font-size: 18px; flex-shrink: 0; }
.fab-item small { color: #333; font-size: 12px; font-weight: 600; white-space: nowrap; }
.fab-menu.active .fab-item { opacity: 1; pointer-events: auto; transform: scale(1); }
.fab-menu.active .fab-item:nth-child(1) { transform: translate(0, -345px); }
.fab-menu.active .fab-item:nth-child(2) { transform: translate(0, -290px); }
.fab-menu.active .fab-item:nth-child(3) { transform: translate(0, -235px); }
.fab-menu.active .fab-item:nth-child(4) { transform: translate(0, -180px); }
.fab-menu.active .fab-item:nth-child(5) { transform: translate(0, -125px); }
.fab-menu.active .fab-item:nth-child(6) { transform: translate(0, -70px); }

/* [공지사항] */
.notice-bar { background-color: #fffbe6; border-bottom: 1px solid #ffe58f; padding: 8px 16px; font-size: 0.9rem; }
.notice-container { max-width: 1400px; margin: 0 auto; display: flex; align-items: center; gap: 10px; }
.notice-icon { flex-shrink: 0; }
.notice-content { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.notice-item { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notice-item a { text-decoration: none; color: #333; }
.notice-item a:hover { text-decoration: underline; }
.notice-badge { background-color: #52c41a; color: white; padding: 1px 6px; border-radius: 4px; font-size: 0.75rem; font-weight: bold; }
.notice-badge.important { background-color: #ff4d4f; }
.notice-item.none { color: #999; }

/* [그리드 및 카드 디자인] */
.mushroom-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; max-width: 1400px; margin: 0 auto; padding: 20px; }
.card { background: var(--card-bg); border-radius: 12px; overflow: hidden; box-shadow: 0 4px 6px rgba(0,0,0,0.05); transition: 0.2s; }
.card:hover { transform: translateY(-5px); }
.card img { width: 100%; height: 180px; object-fit: cover; background: #eee; aspect-ratio: 16 / 9; }
.card-content { padding: 15px; }
.card-title { font-size: 1em; font-weight: bold; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.card-tag-item { font-size: 0.85em; color: #888; font-weight: 500; }
.card-tag-item::before { content: "#"; color: var(--primary-color); margin-right: 1px; }
.coords-box { display: flex; align-items: center; justify-content: center; background: #f0f9f0; padding: 8px 12px; border-radius: 8px; cursor: pointer; margin-top: 10px; border: 1px dashed var(--primary-color); transition: all 0.2s; }
.coords-box:hover { background: var(--primary-color); }
.coords-text { font-size: 0.75em; color: #555; font-weight: 500; }
.coords-box:hover .coords-text, .coords-box:hover span { color: white !important; }
.card-footer { display: flex; padding: 0; border-top: 1px solid #f0f0f0; overflow: hidden; }
.card-footer .btn-icon { flex: 1; border: none; background: #fff; cursor: pointer; padding: 12px 0; display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 0.9em; color: #666; transition: background-color 0.2s, color 0.2s; margin: 0; border-radius: 0; }
.card-footer .btn-icon:first-child { border-right: 1px solid #f0f0f0; }
.card-footer .btn-icon:hover { background-color: #f9f9f9; }
.card-footer .btn-icon:first-child:hover { color: #e91e63; }
.card-footer .btn-icon:last-child:hover { color: #ff5252; }
.btn-icon span { font-size: 0.85em; color: inherit; font-weight: 500; }
.country-tag { display: inline-flex; align-items: center; gap: 4px; color: #888; padding: 2px 6px; border-radius: 4px; font-size: 0.75em; font-weight: bold; }
.country-tag img { display: block; width: 16px; height: auto; border-radius: 1px; }

.card.ad-card { background-color: #ffffff; border: 1px solid #e0e0e0; transition: transform 0.3s ease, box-shadow 0.3s ease; cursor: pointer; display: flex; flex-direction: column; }
.card.ad-card:hover { transform: translateY(-5px); border-color: var(--primary-color); box-shadow: 0 8px 15px rgba(0,0,0,0.1); }
.ad-image-area { width: 100%; height: 180px; background: #f8fdf8; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 8px 8px 0 0; gap: 12px; border-bottom: 1px solid #f0f0f0; }
.ad-coffee-icon { font-size: 3.2rem; filter: drop-shadow(0 2px 4px rgba(76, 175, 80, 0.2)); }
.ad-support-label { background-color: var(--primary-color); color: #fff; padding: 4px 10px; border-radius: 4px; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.ad-title { font-weight: 700; font-size: 1.05rem; color: var(--text-color); margin-bottom: 8px; display: block; }
.ad-desc { font-size: 0.85rem; color: #666; line-height: 1.6; word-break: keep-all; }
.ad-footer-btn { margin-top: auto; background-color: #f5f5f5; color: var(--primary-color); text-align: center; padding: 12px; border-radius: 8px; font-weight: 700; font-size: 0.9rem; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s ease; border: 1px solid transparent; }
.card.ad-card:hover .ad-footer-btn { background-color: var(--primary-color); color: white; }

/* [5. 푸터 스타일] */
.main-footer { position: fixed; bottom: 0; left: 0; right: 0; background: rgba(255, 255, 255, 0.9); backdrop-filter: blur(5px); border-top: 1px solid #eee; padding: 8px 20px; z-index: 2000; font-size: 12px; color: #999; }
.footer-container { max-width: 1400px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; }
.footer-logo { height: 14px; vertical-align: middle; filter: grayscale(100%); opacity: 0.6; margin-right: 5px; }
.footer-disclaimer { flex: 1; text-align: center; padding: 0 10px; font-size: 11px; }

/* [6. 유틸리티 및 모달] */
.close-modal-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; line-height: 1; transition: 0.2s; }
.close-modal-btn:hover { color: #333; }
#toast { visibility: hidden; background: #333; color: #fff; padding: 12px 25px; position: fixed; left: 50%; bottom: 80px; transform: translateX(-50%); border-radius: 25px; z-index: 3000; font-size: 0.9em; transition: 0.3s; }
#toast.show { visibility: visible; }
#reportModal { display: none; position: fixed; z-index: 4000; left: 0; top: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); align-items: center; justify-content: center; }
.report-modal-content { background: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 450px; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.report-target-info { display: flex; gap: 15px; background: #f9f9f9; padding: 10px; border-radius: 10px; margin: 15px 0; }
.report-target-info img { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; }
#otherReason { width: 100%; margin-top: 10px; display: none; padding: 10px; border: 1px solid #ddd; border-radius: 8px; box-sizing: border-box; }
#cookieOverlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(2px); z-index: 99999; display: none; align-items: center; justify-content: center; padding: 20px; }
.cookie-box { background: white; padding: 30px; border-radius: 20px; max-width: 450px; width: 90%; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,0.3); }
.no-scroll { overflow: hidden; }

#galleryModal { z-index: 1000; }
#uploadFormModal { z-index: 2000; }
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.7); z-index: 9999; justify-content: center; align-items: center;}
.modal-content { background-color: white; padding: 25px; border-radius: 15px; width: 90%; max-width: 500px; position: relative; box-shadow: 0 5px 15px rgba(0,0,0,0.3);}
.gallery-content { max-width: 800px; width: 95%;}

/* 이미지 슬라이더 컨테이너 */
.slider-container { display: flex; overflow-x: auto; gap: 15px; padding: 20px 0; -webkit-overflow-scrolling: touch;}
.slider-container img { height: 400px; border-radius: 10px; object-fit: contain; background: #f9f9f9;}
.gallery-slider::-webkit-scrollbar { height: 8px; }
.gallery-slider::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px;}
.gallery-content { max-width: 90%; width: 600px;}
.close-btn { position: absolute; top: 15px; right: 20px; font-size: 28px; font-weight: bold; color: #aaa; cursor: pointer; line-height: 1;}
.close-btn:hover { color: #333;}

/* [7. detail.php] */

.wip-container { display: flex; align-items: center; justify-content: center; min-height: calc(100vh - 120px); text-align: center; padding: 20px; }
.wip-icon { font-size: 60px; margin-bottom: 20px; display: block; }
.wip-content h2 { color: #52c41a; font-size: 2rem; margin-bottom: 15px; }
.wip-content p { color: #666; line-height: 1.6; margin-bottom: 40px; }
.wip-btn { display: inline-block; padding: 12px 30px; background: #52c41a; color: white; text-decoration: none; border-radius: 30px; font-weight: bold; box-shadow: 0 4px 15px rgba(82, 196, 26, 0.2); transition: 0.3s; }
.wip-btn:hover { background: #45ad15; transform: translateY(-2px); }

/* [8. 반응형] */
@media (max-width: 800px) { 
    body { padding-top: 140px !important;} 
    .header-top { flex-direction: column; align-items: flex-start; gap: 10px; } 
    header h1 { font-size: 1.1em; } 

    .filter-row { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; gap: 6px 4px !important; align-items: center !important; }
    .search-area { width: 100%; display: flex; align-items: center; justify-content: flex-start; gap: 5px; } 
    .search-container { position: relative; display: flex; align-items: center; background-color: #fff; border: 1px solid #ddd; border-radius: 20px; padding: 0 10px; height: 36px; flex: 1; min-width: 0; box-sizing: border-box; }
    #searchInput { flex: 1; border: none !important; outline: none !important; background: transparent !important; padding: 0 5px; font-size: 13px !important; height: 100%; min-width: 0; }
    .clear-icon { position: static !important; transform: none !important; color: #ccc; font-size: 14px; margin-left: 5px; display: flex; align-items: center; }
    .btn-common { flex-shrink: 0; width: 35px; height: 35px; min-width: 35px; border-radius: 50% !important; display: flex; align-items: center; justify-content: center; margin-left: 5px !important; padding: 0 !important; }
    .btn-common .btn-text { display: none !important; }
    .btn-common .btn-icon { font-size: 1rem; margin: 0; } 

    .selected-detail { display: none !important; }
    .filter-left-group { gap: 4px !important; }
    .custom-dropdown .dropdown-btn { width: auto !important; min-width: 0px !important; height: 32px !important; padding: 0 12px !important; font-size: 10.5px !important; justify-content: center; }
    .dropdown-arrow { margin-left: 2px !important; font-size: 7px !important; } 

    #reset-filter-area { flex: 0 0 auto !important; display: flex; align-items: center; }
    .btn-reset { width: 35px !important; height: 35px !important; background: none !important; border: none !important; padding: 0 !important; display: flex; align-items: center; justify-content: center; margin-left: 4px !important; cursor: pointer; }
    .btn-reset .btn-icon { font-size: 1.5rem !important; margin: 0 !important; }
    .reset-text { display: none !important; }
    
    .footer-container { flex-direction: column; gap: 5px; } 
    .footer-disclaimer { display: block; text-align: center; line-height: 1.4; padding: 5px 0; }
}