/* ========================
   THEME VARIABLES
======================== */

:root {
    --bg-dark-1: #0a0f2a;
    --bg-dark-2: #2d0a57;
    --accent: #a87dff;
    --text-light: #ffffff;
    --text-muted: #c7c8e0;

    --panel-bg-dark: rgba(255,255,255,0.06);
    --panel-bg-light: rgba(255,255,255,0.92);

    --border-dark: rgba(255,255,255,0.15);
    --border-light: rgba(0,0,0,0.10);

    --input-dark: rgba(255,255,255,0.08);
    --input-light: rgba(0,0,0,0.06);

    --shadow-dark: 0 8px 28px rgba(0,0,0,0.45);
    --shadow-light: 0 8px 24px rgba(0,0,0,0.08);
}

/* LIGHT THEME VARIABLES */
[data-theme="light"] {
    --bg-dark-1: #eaf2ff;
    --bg-dark-2: #f2e7ff;
    --accent: #7047ff;
    --text-light: #0a0f2a;
    --text-muted: #334155;

    --panel-bg-dark: rgba(255,255,255,0.92);
    --border-dark: rgba(0,0,0,0.12);
    --input-dark: rgba(0,0,0,0.06);

    --shadow-dark: rgba(0,0,0,0.08);
}


/* ========================
   GLOBAL RESET
======================== */

body {
    margin: 0;
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, var(--bg-dark-1), var(--bg-dark-2));
    color: var(--text-light);
    height: 100vh;
    overflow: hidden;
}


/* ========================
   TOP NAV BAR
======================== */

.topbar {
    width: 100%;
    padding: 14px 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;  /* <-- THIS FIXES IT */
    gap: 10px;        /* space if they wrap */
    backdrop-filter: blur(16px);
    background: rgba(0,0,0,0.25);
    position: sticky;
    top: 0;
    z-index: 9999;
}


/* Logo */
.logo {
    background: linear-gradient(180deg, #8749f7, #481e9b);
    padding: 12px 14px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 18px;
    color: white;
    box-shadow: 0 6px 20px rgba(72,30,155,0.4);
}

/* Title gradient text */
.main-title {
    font-size: 20px;
    font-weight: 700;
    background: linear-gradient(90deg,#dcbaff,#f2e0ff,#bfa4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sub-title {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: -3px;
}

.controls {
    display: flex;
    gap: 12px;
}


/* ========================
   GLOBAL BUTTON STYLE
======================== */

.btn {
    background: linear-gradient(135deg, #3d3df4, #6d15c8);
    border: none;
    padding: 9px 14px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 12px rgba(81,27,173,0.45);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(81,27,173,0.55);
}

.btn.secondary {
    background: transparent;
    border: 1px solid var(--border-dark);
    color: var(--text-light);
}

[data-theme="light"] .btn.secondary {
    border: 1px solid var(--border-light);
    color: var(--text-light);
}

/* Upload button */
.upload-btn {
    background: linear-gradient(135deg,#883dff,#581fc7);
}


/* ========================
   LAYOUT
======================== */

.container {
    display: grid;
    grid-template-columns: 330px 1fr;
    height: calc(100vh - 90px); /* Give more room below navbar */
    max-height: calc(100vh - 90px);
    overflow: hidden; /* Prevent page from pushing sideways */
    width: 100%;
    gap: 16px;
    padding: 16px;
    box-sizing: border-box;
}


.sidebar {
    background: var(--panel-bg-dark);
    border-radius: 14px;
    padding: 14px;
    overflow-y: auto;  /* Important */
    max-height: 100%;  /* Important */
    box-shadow: var(--shadow-dark);
}



/* Sidebar headings */
.sidebar h3 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 600;
    background: linear-gradient(90deg,#dcbaff,#bfa4ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

/* Input fields */
.input {
    flex: 1;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-dark);
    background: var(--input-dark);
    color: var(--text-light);
}

[data-theme="light"] .input {
    background: var(--input-light);
    color: var(--text-light);
}


/* Upload box */
.upload {
    display: flex;
    align-items: center;
    gap: 10px;
}

.upload input {
    display: none;
}

.info {
    font-size: 11px;
    color: var(--text-muted);
}


/* ========================
   MAP AREA
======================== */

#map {
    width: 100%;
    height: 100%;
    min-height: 400px;
    border-radius: 14px;
    box-shadow: 0 10px 32px rgba(0,0,0,0.4);
    border: 2px solid rgba(255,255,255,0.05);
}



/* ========================
   STATUS BAR
======================== */

.status {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.06);
    border-radius: 8px;
    font-size: 12px;
    color: var(--text-muted);
}


/* ========================
   SCROLLBAR BEAUTY
======================== */

.sidebar::-webkit-scrollbar {
    width: 8px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 8px;
}


/* ========================
   RESPONSIVE
======================== */

@media (max-width: 980px) {
    .container {
        grid-template-columns: 1fr;
        height: auto;
        max-height: none;
    }

    .sidebar {
        max-height: 300px;
        margin-bottom: 12px;
    }

    #map {
        height: 60vh !important;
    }
}

