/* 기본 초기화 */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', 'Noto Sans KR', sans-serif; }
body { background-color: #0f172a; color: #f8fafc; overflow: hidden; height: 100vh; display: flex; flex-direction: column; }

/* 헤더 바 */
header {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    height: 60px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    z-index: 100;
    justify-content: space-between;
}
header h1 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.5px; display: flex; align-items: center; gap: 8px;}
.pulse-indicator { width: 10px; height: 10px; background-color: #22c55e; border-radius: 50%; box-shadow: 0 0 10px #22c55e; animation: ws-pulse 2s infinite; }

/* 메인 레이아웃 */
main { display: flex; flex: 1; position: relative; height: calc(100vh - 60px - 140px); }

/* 지도 영역 */
#map { flex: 1; height: 100%; width: 100%; z-index: 1; }

/* 좌측 실시간 피드 (Glassmorphism) */
.sidebar {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 380px;
    height: calc(100% - 40px);
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1.1rem;
    font-weight: 600;
}

#feed-container {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
#feed-container::-webkit-scrollbar { width: 6px; }
#feed-container::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 3px; }

/* 피드 아이템 */
.feed-item {
    background: rgba(30, 41, 59, 0.7);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    animation: slideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    border-left: 4px solid #475569;
}
.feed-item:hover { transform: translateX(5px); background: rgba(30, 41, 59, 0.9); }
.feed-item.grade-S { border-left-color: #ef4444; }
.feed-item.grade-A { border-left-color: #f97316; }
.feed-item.grade-B { border-left-color: #eab308; }

.feed-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.feed-grade { 
    font-weight: 800; font-size: 0.85rem; padding: 2px 8px; border-radius: 4px;
}
.grade-S .feed-grade { background: rgba(239, 68, 68, 0.2); color: #ef4444; }
.grade-A .feed-grade { background: rgba(249, 115, 22, 0.2); color: #f97316; }
.grade-B .feed-grade { background: rgba(234, 179, 8, 0.2); color: #eab308; }

.feed-time { font-size: 0.75rem; color: #94a3b8; }
.feed-title { font-size: 0.95rem; font-weight: 500; line-height: 1.4; color: #e2e8f0; margin-bottom: 6px;}
.feed-desc { font-size: 0.8rem; color: #94a3b8; line-height: 1.5; }

/* 지도 커스텀 오버레이 마커 */
.custom-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    position: relative;
    transform: translate(-50%, -50%);
}
.custom-marker.grade-S { background: #ef4444; box-shadow: 0 0 20px #ef4444; animation: pulse-s 1.5s infinite; }
.custom-marker.grade-A { background: #f97316; box-shadow: 0 0 15px #f97316; animation: pulse-a 2s infinite; }
.custom-marker.grade-B { background: #eab308; box-shadow: 0 0 10px #eab308; }

.marker-label {
    position: absolute; top: -30px; left: 50%; transform: translateX(-50%);
    background: rgba(15,23,42,0.9); padding: 4px 8px; border-radius: 4px;
    font-size: 0.75rem; font-weight: bold; white-space: nowrap; color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Animations */
@keyframes slideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes ws-pulse { 0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); } 70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes pulse-s { 0% { transform: translate(-50%, -50%) scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); } 70% { transform: translate(-50%, -50%) scale(1.1); box-shadow: 0 0 0 20px rgba(239, 68, 68, 0); } 100% { transform: translate(-50%, -50%) scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); } }
@keyframes pulse-a { 0% { transform: translate(-50%, -50%) scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.7); } 70% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 0 15px rgba(249, 115, 22, 0); } 100% { transform: translate(-50%, -50%) scale(0.95); box-shadow: 0 0 0 0 rgba(249, 115, 22, 0); } }

/* 실시간 로그 터미널 (Bottom Bar) */
.log-terminal {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 140px;
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 10px 20px;
    font-family: 'JetBrains Mono', 'Menlo', 'Monaco', 'Courier New', monospace;
    font-size: 0.8rem;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.5);
}

.log-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.7rem;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding-bottom: 5px;
}

#log-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: #94a3b8;
}

.log-entry { display: flex; gap: 10px; animation: logFade 0.3s ease-out; }
.log-time { color: #475569; min-width: 70px; }
.log-level { font-weight: bold; min-width: 60px; }
.level-INFO { color: #38bdf8; }
.level-SUCCESS { color: #4ade80; }
.level-WARNING { color: #fbbf24; }
.level-ERROR { color: #f87171; }
.log-msg { color: #e2e8f0; }

@keyframes logFade { from { opacity: 0; transform: translateX(-5px); } to { opacity: 1; transform: translateX(0); } }
#log-content::-webkit-scrollbar { width: 4px; }
#log-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

