/* style.css */

:root {
    --bg-color: #f1f5f9;
    --sidebar-bg: rgba(255, 255, 255, 0.95);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --primary: #3b82f6; 
    --primary-hover: #2563eb;
    --secondary: #e2e8f0;
    --secondary-hover: #cbd5e1;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #10b981;
    --nav-active: #059669; 
    --border: #e2e8f0;
    --shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100vw;
    position: relative;
}

.map-area { 
    height: 45vh; 
    position: relative; 
    z-index: 1; 
    flex-shrink: 0; 
    transition: all 0.3s ease;
}

#map { width: 100%; height: 100%; z-index: 1; }

.map-floating-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 4px;
    width: 34px;
    height: 34px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 1px 5px rgba(0,0,0,0.4);
    transition: background 0.2s;
}
.map-floating-btn:hover { background: #f4f4f4; }

.sidebar {
    background: var(--sidebar-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    display: flex; 
    flex-direction: column; 
    height: 55vh; 
    overflow-y: auto; 
    z-index: 1000;
    box-shadow: 0 -4px 6px -1px rgb(0 0 0 / 0.05);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Custom Scrollbar */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

@media (min-width: 768px) {
    .app-container { display: block; } 
    .map-area { height: 100vh; width: 100vw; position: absolute; top: 0; left: 0; }
    
    .sidebar { 
        position: absolute;
        top: 20px;
        left: 20px;
        width: 380px; 
        height: calc(100vh - 40px); 
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
    }
}

/* --- FULLSCREEN TOGGLE CLASSES --- */
body.map-fullscreen-mode .sidebar {
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}
body.map-fullscreen-mode .map-area {
    height: 100vh;
}

.sidebar header { 
    padding: 1.5rem; 
    border-bottom: 1px solid var(--border); 
    background: #ffffff;
    border-radius: var(--radius) var(--radius) 0 0;
}
.sidebar header h1 { font-size: 1.25rem; font-weight: 700; color: #1e293b; }
.sidebar header p { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem;}

.controls-container { padding: 1.5rem; display: flex; flex-direction: column; gap: 1.75rem; }

fieldset { border: none; display: flex; flex-direction: column; gap: 0.75rem; }
.fieldset-header { display: flex; justify-content: space-between; align-items: center; }
legend { font-weight: 600; font-size: 0.95rem; color: #334155; text-transform: uppercase; letter-spacing: 0.5px; }

.input-group { display: flex; gap: 0.5rem; }
input[type="text"] { 
    flex-grow: 1; 
    padding: 0.65rem; 
    border: 1px solid var(--border); 
    border-radius: 6px; 
    font-size: 0.95rem; 
    font-family: inherit;
    transition: all 0.2s;
}
input[type="text"]:focus { 
    outline: none; 
    border-color: var(--primary); 
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15); 
}

.routing-options { background: #f8fafc; padding: 0.5rem; border-radius: 6px; border: 1px solid var(--border); }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

.action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

.btn {
    padding: 0.65rem 0.75rem; 
    border: none; 
    border-radius: 6px; 
    font-weight: 600; 
    cursor: pointer;
    display: inline-flex; 
    justify-content: center; 
    align-items: center; 
    gap: 0.4rem; 
    font-size: 0.9rem;
    transition: all 0.2s ease-in-out; 
    text-align: center;
    font-family: inherit;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-primary { background-color: var(--primary); color: white; box-shadow: 0 2px 4px rgba(59,130,246,0.3); }
.btn-primary:hover { background-color: var(--primary-hover); }

.btn-secondary { background-color: var(--secondary); color: var(--text-main); }
.btn-secondary:hover { background-color: var(--secondary-hover); }

.btn-danger { background-color: white; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background-color: var(--danger); color: white; }

.btn-outline { background-color: transparent; border: 1px solid var(--border); color: var(--text-main); }
.btn-outline:hover { background-color: var(--secondary); border-color: var(--secondary-hover); }

.btn-small { padding: 0.4rem 0.6rem; font-size: 0.8rem; }
.btn-active-nav { background-color: var(--nav-active) !important; color: white !important; box-shadow: 0 4px 10px rgba(5, 150, 105, 0.4); }

.dynamic-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; }
.dynamic-list li {
    background: #ffffff; 
    border: 1px solid var(--border); 
    border-radius: 8px;
    padding: 0.85rem; 
    display: flex; 
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
    transition: border-color 0.2s;
}
.dynamic-list li:hover { border-color: #cbd5e1; }

.item-info { width: 100%; overflow: hidden; }
.item-title { font-weight: 500; font-size: 0.95rem; white-space: normal; word-wrap: break-word; line-height: 1.4; }
.item-actions { display: flex; gap: 0.4rem; width: 100%; justify-content: flex-start; }

.empty-msg { font-size: 0.85rem; color: var(--text-muted); font-style: italic; background: #f8fafc; padding: 0.75rem; border-radius: 6px; text-align: center; border: 1px dashed #cbd5e1; }
.hidden { display: none !important; }
.highlight-text { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-top: 0.5rem; background: rgba(59, 130, 246, 0.1); padding: 0.5rem; border-radius: 6px; text-align: center;}

.status-container {
    margin-top: auto; 
    padding: 1rem 1.5rem; 
    background: #ffffff;
    border-top: 1px solid var(--border); 
    font-size: 0.85rem; 
    color: var(--text-muted);
    border-radius: 0 0 var(--radius) var(--radius);
}

.file-actions { display: flex; gap: 0.4rem; }
.spinner { width: 14px; height: 14px; border: 2px solid var(--primary); border-bottom-color: transparent; border-radius: 50%; display: inline-block; animation: rotation 1s linear infinite; }
@keyframes rotation { 100% { transform: rotate(360deg); } }
.popup-actions { display: flex; gap: 0.5rem; margin-top: 0.75rem; }