/* ============================================================
   [CSS: 산림재난관제시스템 전역 스타일 - 프리미엄 다크 에디션]
   ============================================================ */
:root {
    --panel-bg: rgba(15, 23, 42, 0.98);
    --card-bg: #1e293b;
    --accent: #3b82f6;
    --text-bright: #f8fafc;
    --text-dim: #94a3b8;
    --danger: #ef4444;
    --border-color: #334155;
    --shadow-heavy: 0 30px 70px rgba(0,0,0,0.9);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body, html { height: 100%; width: 100%; overflow: hidden; background-color: #020617; font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', sans-serif; color: var(--text-bright); touch-action: none; }

#map { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; }

#login-screen {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #020617; z-index: 9999; display: flex;
    justify-content: center; align-items: center; flex-direction: column;
}
.login-box {
    background: var(--panel-bg); padding: 40px; border-radius: 20px;
    border: 2px solid var(--border-color); box-shadow: var(--shadow-heavy);
    text-align: center; width: 350px;
}
.login-box h2 { font-style: italic; color: white; margin-bottom: 20px; }
.login-box input {
    width: 100%; padding: 15px; margin-bottom: 15px; border-radius: 10px;
    background: #0f172a; color: white; border: 1px solid var(--border-color); outline: none;
}
.login-box button {
    width: 100%; padding: 15px; background: var(--accent); color: white;
    border: none; border-radius: 10px; font-weight: bold; cursor: pointer; font-size: 1.1rem;
}

.top-nav { position: absolute; top: 25px; left: 25px; right: 25px; z-index: 1000; display: flex; justify-content: space-between; align-items: flex-start; }
.brand-box { background: var(--panel-bg); padding: 15px 35px; border-radius: 18px; border: 1px solid var(--border-color); display: flex; align-items: center; gap: 25px; box-shadow: var(--shadow-heavy); }
.brand-title { font-size: 26px; font-weight: 900; font-style: italic; color: #ffffff; margin: 0; letter-spacing: -1.5px; }
.header-info { display: flex; flex-direction: column; border-left: 2px solid var(--border-color); padding-left: 20px; }
.header-sub { font-size: 0.9rem; font-weight: bold; color: var(--text-bright); }
.header-org { font-size: 0.75rem; color: var(--accent); font-weight: 800; margin-top: 4px; }
.menu-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.menu-btn { background: var(--panel-bg); color: #ffffff; border: 1px solid var(--border-color); padding: 15px 28px; border-radius: 12px; font-weight: bold; cursor: pointer; box-shadow: 0 5px 15px rgba(0,0,0,0.5); transition: all 0.2s ease; }
.menu-btn:hover { background: #1e293b; border-color: var(--accent); }
.menu-btn-sm { background: var(--accent); color: white; border: none; padding: 15px 20px; border-radius: 12px; font-weight: bold; cursor: pointer; font-size: 0.9rem; box-shadow: 0 5px 15px rgba(0,0,0,0.5); }

.data-center-window { position: absolute; z-index: 3000; width: 1100px; max-width: 95vw; max-height: 90vh; background: var(--panel-bg); border-radius: 25px; border: 2px solid var(--accent); box-shadow: 0 50px 100px rgba(0,0,0,0.8); display: none; flex-direction: column; overflow: hidden; touch-action: none; }
.dc-head { background: var(--accent); padding: 20px 25px; display: flex; justify-content: space-between; align-items: center; cursor: move; }
.dc-body { padding: 20px; overflow-x: auto; overflow-y: auto; background: #0f172a; flex: 1; }
.dc-filter-bar { background: #1e293b; padding: 15px; border-radius: 15px; margin-bottom: 20px; display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.dc-filter-bar input[type="date"], .dc-filter-bar select { background: #0f172a; border: 1px solid var(--border-color); color: white; padding: 8px 12px; border-radius: 8px; }
.dc-table { width: 100%; border-collapse: collapse; color: white; font-size: 0.85rem; min-width: 900px; }
.dc-table th { background: #1e293b; padding: 14px; text-align: left; border-bottom: 2px solid var(--border-color); position: sticky; top: 0; z-index: 10; }
.dc-table td { padding: 14px; border-bottom: 1px solid var(--border-color); }
.dc-chart-area { width: 100%; height: 350px; background: #1e293b; border-radius: 20px; margin-top: 25px; padding: 20px; }
.dc-foot { padding: 15px 25px; background: #1e293b; display: flex; justify-content: flex-end; gap: 15px; }

.admin-panel { position: absolute; z-index: 1050; width: 340px; background: var(--panel-bg); border-radius: 22px; border: 1px solid var(--border-color); box-shadow: 0 20px 60px rgba(0,0,0,0.7); display: flex; flex-direction: column; touch-action: none; }
.panel-head { padding: 18px 22px; border-bottom: 1px solid var(--border-color); cursor: move; display: flex; justify-content: space-between; align-items: center; }
.panel-title { font-size: 0.9rem; font-weight: 800; color: var(--text-dim); margin: 0; letter-spacing: 1px; }
.device-list { max-height: 400px; overflow-y: auto; padding: 15px; }
.device-item { padding: 15px; background: #334155; border-radius: 14px; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; border: 1px solid #475569; }
.dev-info { flex: 1; cursor: pointer; }
.dev-info strong { font-size: 1.05rem; display: block; }
.btn-icon { background: rgba(255,255,255,0.1); border: none; padding: 7px; border-radius: 8px; cursor: pointer; font-size: 1.1rem; display: flex; align-items: center; justify-content: center; }
.manual-pos-btn { background: #475569; color: white; border: none; padding: 4px 8px; border-radius: 4px; font-size: 10px; cursor: pointer; margin-right: 5px; }
.manual-pos-btn.active { background: #ef4444; box-shadow: 0 0 10px rgba(239, 68, 68, 0.5); }

.marker-container { position: relative; width: 60px; height: 180px; }
.m-pyramid { position: absolute; top: 60px; left: 0; width: 60px; height: 60px; z-index: 2; transition: transform 2.5s cubic-bezier(0.1, 0, 0.3, 1); filter: drop-shadow(0 4px 8px rgba(0,0,0,0.6)); }
.m-label { position: absolute; top: 45px; left: 15px; background: rgba(0,0,0,0.9); color: white; font-size: 0.8rem; padding: 3px 8px; border-radius: 5px; border: 1px solid var(--border-color); white-space: nowrap; font-weight: bold; }

.monitor-window { position: absolute; z-index: 2000; width: 620px; max-width: 95vw; height: auto; background: #0f172a; border-radius: 30px; display: flex; flex-direction: column; box-shadow: 0 60px 150px rgba(0,0,0,1.0); border: 1px solid #475569; overflow: auto; touch-action: none; resize: both; }
.win-head { background: #1e293b; padding: 15px 25px; display: flex; justify-content: space-between; align-items: center; cursor: move; border-bottom: 2px solid var(--border-color); }
.win-title { font-weight: 900; font-size: 1.1rem; color: #ffffff; flex: 1; }
.win-bat { color: #fbbf24; margin-left: 15px; font-weight: 800; font-size: 1.2rem; text-shadow: 0 0 10px rgba(251, 191, 36, 0.4); }
.video-box { width: 100%; aspect-ratio: 16/9; background: #000000; flex-shrink: 0; position: relative; overflow: hidden; border-bottom: 3px solid #334155; }
.video-box iframe { width: 100%; height: 100%; border: none; position: absolute; top: 0; left: 0; }
.ptz-area { background: #1e293b; padding: 12px 15px; display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 6px; border-bottom: 1px solid var(--border-color); }
.ptz-btn { background: #334155; border: 1px solid #475569; color: #ffffff; padding: 12px 0; border-radius: 12px; font-size: 1.4rem; font-weight: bold; cursor: pointer; flex: 1; text-align: center; }
.ptz-btn:active { background: var(--accent); transform: translateY(2px); }

/* 🌟 기상 정보 영역 가로 정렬 고정 */
.sensor-row { 
    display: flex; 
    flex-direction: row; 
    justify-content: space-between; 
    align-items: stretch; 
    gap: 10px; 
    padding: 15px; 
    background: #0f172a; 
    width: 100%;
}

.s-group { 
    background: var(--card-bg); 
    border-radius: 20px; 
    padding: 12px 5px; 
    text-align: center; 
    border: 1px solid var(--border-color); 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
    align-items: center; 
    flex: 1; 
    min-width: 0; 
}
.s-sub-box { width: 100%; flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.s-sub-box:first-child { border-bottom: 1px solid rgba(255,255,255,0.1); margin-bottom: 5px; padding-bottom: 5px; }
.s-label { font-size: 0.75rem; color: var(--text-dim); margin-bottom: 8px; font-weight: bold; }
.s-val { font-size: 1.6rem; font-weight: 900; color: #ffffff; }
.s-val-sub { font-size: 1.25rem; color: var(--accent); font-weight: bold; margin-top: 5px; }
.wdir-text { font-size: 1.1rem; font-weight: 900; color: #ffffff; margin-bottom: 8px; letter-spacing: 1.5px; }
.pyramid-icon { width: 60px; height: 60px; transition: transform 2.5s ease-out; }

input[type="date"] { appearance: none; -webkit-appearance: none; color: #ffffff; background-color: #0f172a; border: 1px solid #3b82f6; padding: 10px; border-radius: 8px; font-family: inherit; cursor: pointer; position: relative; }
input[type="date"]::-webkit-calendar-picker-indicator { filter: invert(1); cursor: pointer; opacity: 0.8; }
input[type="date"]:hover { border-color: #60a5fa; background-color: #1e293b; }

/* 🎙️ 중후하고 고급스러운 무전기(PTT) 패널 및 통신 지휘소 전용 스타일 */
.intercom-panel {
    background: linear-gradient(145deg, #0f172a, #090d16) !important;
    border: 1px solid #1e293b !important;
    border-radius: 20px !important;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8) !important;
}

/* 📱 모바일 화면 최적화 반응형 미디어쿼리 */
@media screen and (max-width: 768px) {
    .top-nav {
        top: 10px; left: 10px; right: 10px;
        flex-direction: column;
        gap: 8px;
    }
    .brand-box {
        padding: 10px 15px;
        width: 100%;
        justify-content: space-between;
    }
    .brand-title {
        font-size: 18px !important;
    }
    .header-info {
        padding-left: 10px;
    }
    .header-sub {
        font-size: 0.75rem;
    }
    .header-org {
        font-size: 0.65rem;
    }
    .menu-btns {
        width: 100%;
        justify-content: flex-start;
        gap: 6px;
    }
    .menu-btn, .menu-btn-sm {
        padding: 8px 12px !important;
        font-size: 0.75rem !important;
        border-radius: 8px;
    }
    .admin-panel {
        width: 92vw !important;
        left: 4vw !important;
        top: 130px !important;
    }
    .monitor-window {
        width: 96vw !important;
        left: 2vw !important;
        top: 80px !important;
    }
    /* 모바일 기상 위젯 폰트 크기 및 여백 슬림화 */
    .sensor-row {
        padding: 8px !important;
        gap: 6px !important;
    }
    .s-group {
        padding: 8px 2px !important;
        border-radius: 12px !important;
    }
    .s-label {
        font-size: 0.7rem !important;
    }
    .s-val {
        font-size: 1.2rem !important;
    }
    .s-val-sub {
        font-size: 1rem !important;
    }
}
/* 📱 모바일 터치 시 텍스트 선택, 롱프레스 팝업 및 에러 방지 */
    .menu-btn, .menu-btn-sm, .ptz-btn, .ptt-push-button, .win-title, .win-head {
		-webkit-touch-callout: none !important; /* iOS 꾹 누르기 메뉴 방지 */
		-webkit-user-select: none !important;   /* 텍스트 드래그 및 선택 방지 */
		user-select: none !important;
		touch-action: manipulation !important;  /* 불필요한 제스처 간섭 최소화 */
}