:root {
    --bg-color: #0d1117;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --accent-blue: #58a6ff;
    --accent-blue-hover: #3182ce;
    --accent-green: #238636;
    --accent-red: #da3633;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* Animated Background Orbs */
.background-orbs {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 0;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.5;
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 { width: 500px; height: 500px; background: #6b21a8; top: -100px; left: -100px; }
.orb-2 { width: 400px; height: 400px; background: #1e3a8a; bottom: -50px; right: -50px; animation-delay: -5s; }
.orb-3 { width: 300px; height: 300px; background: #064e3b; top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -10s; }

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, -50px) scale(1.1); }
}

/* Main Dashboard container */
.dashboard {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 1200px; /* Made wider for split-layout */
    height: 95vh;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px;
    overflow-y: auto; /* Allow scrolling on the whole dashboard */
}

/* Hide scrollbar for dashboard */
.dashboard::-webkit-scrollbar {
    width: 8px;
}
.dashboard::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

/* Top Header with Hamburger */
.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}

.menu-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid var(--glass-border);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border-radius: 8px;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
}
.menu-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.header-titles {
    flex: 1;
}

.header-titles h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 8px;
}

.header-titles p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: 300;
}


/* Sidebar Styling */
.sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 250px;
    height: 100vh;
    background: rgba(10, 10, 15, 0.95);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    z-index: 1000;
    transition: left 0.3s ease;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    color: white;
    font-size: 1.2rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}
.close-btn:hover {
    color: var(--accent-red);
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sidebar-nav a {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 1.1rem;
    padding: 10px 15px;
    border-radius: 8px;
    transition: 0.2s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(255,255,255,0.1);
    color: white;
}

/* View Sections */
.view-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
}

/* Glassmorphism Panels */
.panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s ease;
}

.panel h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: #e2e8f0;
}

/* Drag & Drop Zone */
.dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0,0,0,0.2);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.dropzone svg {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

.dropzone p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* Buttons */
button {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.btn-primary {
    background: var(--accent-blue);
    color: white;
}
.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-2px); }

.btn-danger {
    background: var(--accent-red);
    color: white;
}
.btn-danger:hover { background: #f85149; transform: translateY(-2px); }
.btn-danger:disabled { background: #444; color: #888; cursor: not-allowed; transform: none; }
.btn-primary:disabled { background: #444; color: #888; cursor: not-allowed; transform: none; }

.status-text {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--accent-green);
    text-align: center;
}

/* Controls */
.control-panel {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 600;
}

.dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    box-shadow: 0 0 10px currentColor;
}
.dot.idle { background: var(--text-secondary); color: var(--text-secondary); }
.dot.running { background: var(--accent-green); color: var(--accent-green); animation: pulse 2s infinite; }

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(35, 134, 54, 0); }
    100% { box-shadow: 0 0 0 0 rgba(35, 134, 54, 0); }
}

.button-group {
    display: flex;
    gap: 12px;
}

/* Logs Panel in View */
.log-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.terminal {
    background: #010409;
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 16px;
    flex: 1;
    overflow-y: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #a5d6ff;
    line-height: 1.5;
    height: 300px;
}

/* Settings Form */
.settings-panel h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #e2e8f0;
    font-size: 1.1rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.form-group input {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    padding: 8px 12px;
    color: white;
    font-family: 'Outfit';
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

/* Calendar Overrides */
.calendar-panel {
    flex-grow: 1;
    min-height: 650px;
    display: flex;
    flex-direction: column;
}

#calendar {
    flex-grow: 1;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

.fc {
    --fc-page-bg-color: transparent !important;
    --fc-border-color: var(--glass-border) !important;
    --fc-button-bg-color: var(--glass-bg) !important;
    --fc-button-border-color: var(--glass-border) !important;
    --fc-button-hover-bg-color: rgba(255,255,255,0.1) !important;
    --fc-button-text-color: var(--text-primary) !important;
    --fc-button-active-bg-color: var(--accent-blue) !important;
    color: var(--text-primary);
}
.fc-theme-standard .fc-scrollgrid {
    border-color: var(--glass-border) !important;
}
.fc-theme-standard td, .fc-theme-standard th {
    border-color: var(--glass-border) !important;
}
.fc-day-today {
    background: rgba(59, 130, 246, 0.1) !important;
}
.fc-event {
    background: var(--accent-blue) !important;
    border: none !important;
    border-radius: 4px;
    padding: 2px !important;
}

/* ─── Region Upload Cards ─────────────────────────────────────────── */
.region-upload-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 8px;
}

.region-card {
    text-align: center;
    padding: 20px 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: border-color 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.region-card:hover {
    background: rgba(255,255,255,0.07);
}

.region-flag {
    font-size: 2.4rem;
    line-height: 1;
}

.region-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.region-tz {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
}

.upload-status {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 0;
    word-break: break-all;
}

/* ─── Stats Panel Items ──────────────────────────────────────────── */
.stats-panel {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: baseline;
    gap: 6px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 16px;
    white-space: nowrap;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.stat-item b {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-blue);
}

/* ─── Upload Form Row ─────────────────────────────────────────── */
.upload-form-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.upload-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 140px;
    flex: 1;
}

.upload-field label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.custom-select, .custom-input {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.custom-select:focus, .custom-input:focus {
    border-color: var(--accent-blue);
}

.file-select-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-name-display {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

/* ─── Batch Cards ─────────────────────────────────────────────── */
.batches-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.batch-card {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 16px 20px;
    transition: all 0.3s;
}

.batch-card.batch-done {
    opacity: 0.5;
    border-color: #22c55e;
}

.batch-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.batch-flag { font-size: 1.6rem; }
.batch-country { font-weight: 600; font-size: 1rem; }
.batch-tz { font-size: 0.75rem; color: var(--text-secondary); }

.batch-pill {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid rgba(99, 102, 241, 0.4);
    white-space: nowrap;
}


.batch-progress { display: flex; align-items: center; gap: 12px; }

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), #a78bfa);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text { font-size: 0.8rem; color: var(--text-secondary); white-space: nowrap; }
.batch-active { font-size: 0.8rem; color: #fbbf24; margin-top: 6px; display: block; }

.empty-state {
    text-align: center;
    color: var(--text-secondary);
    padding: 30px;
    font-size: 0.95rem;
    opacity: 0.7;
}


