@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root {
    --primary: #0284c7;
    --primary-light: #e0f2fe;
    /* Original Dark Blue Nav Color */
    --navbar-bg: #090e17; 
    --navbar-text: #94a3b8;
    --navbar-active: #ffffff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background-color: var(--bg-main); color: var(--text-dark); overflow-x: hidden; }
a { text-decoration: none; }

/* ---------------------------------
   Full Screen Loader (Animation Only)
--------------------------------- */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(248, 250, 252, 0.95); backdrop-filter: blur(10px);
    z-index: 9999; display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.loader-content { text-align: center; }
.spinner {
    width: 80px; height: 80px; border: 6px solid var(--border);
    border-top-color: var(--primary); border-radius: 50%;
    animation: spin 1s linear infinite; margin: 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------------------------
   Layout & Top Navigation
--------------------------------- */
.layout-wrapper { display: flex; flex-direction: column; min-height: 100vh; }

.top-navbar {
    position: sticky; top: 0; left: 0; width: 100%;
    background-color: var(--navbar-bg);
    display: flex; justify-content: space-between; align-items: center;
    /* Increased padding to accommodate massive logo */
    padding: 1.2rem 3rem; 
    z-index: 50; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar-left { display: flex; align-items: center; }

/* Massive Logo */
.brand-logo { width: 100px; height: 100px; object-fit: contain; }

.nav-menu { flex: 1; display: flex; justify-content: center; gap: 0.8rem; }
.nav-item {
    padding: 0.6rem 1rem; border-radius: 6px; cursor: pointer;
    color: var(--navbar-text); display: flex; align-items: center; gap: 8px; font-weight: 500;
    transition: 0.2s; font-size: 1rem;
}
.nav-item:hover { color: var(--navbar-active); background: rgba(255,255,255,0.05); }
.nav-item.active { background: var(--primary); color: white; }

.navbar-right { display: flex; align-items: center; gap: 1rem; }
.logout-btn { color: #ef4444; padding: 0.6rem; }
.logout-btn:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

/* ---------------------------------
   Main Content & UI Utilities
--------------------------------- */
.main-content { padding: 2rem; max-width: 1600px; margin: 0 auto; width: 100%;}
.workspace-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }

.flex-col { display: flex; flex-direction: column; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-grow { flex-grow: 1; }
.gap-base { gap: 1rem; }
.text-right { text-align: right; }
.unit { font-size: 1rem; color: var(--text-muted); font-weight: 500;}
.mb-2 { margin-bottom: 0.5rem; }
.mr-2 { margin-right: 0.5rem; }
.ml-2 { margin-left: 0.5rem; }
.mt-base { margin-top: 1.5rem; }
.mb-base { margin-bottom: 1.5rem; }
.text-primary { color: var(--primary); }

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.dashboard-bento-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; }
.span-2 { grid-column: span 1; }

.bento-card { 
    background: var(--card-bg); padding: 1.5rem; border: 1px solid var(--border);
    border-radius: 12px; box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
}
.highlight-card { background: var(--primary); color: white; border-color: var(--primary); }
.card-title { color: var(--text-dark); font-size: 1.1rem; margin-bottom: 0.25rem;}
.card-subtitle { color: var(--text-muted); font-size: 0.9rem; }
.large-number { font-size: 2.5rem; color: var(--text-dark); margin-top: 0.5rem; font-weight: 700;}
.card-header-flex { display: flex; justify-content: space-between; align-items: flex-start; }

/* Buttons & Inputs */
.btn { padding: 0.6rem 1.2rem; border-radius: 6px; font-weight: 600; cursor: pointer; border: none; font-size: 0.9rem; transition: 0.2s; display: inline-flex; align-items: center; justify-content: center;}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: #0369a1; }
.btn-outline { background: white; border: 1px solid var(--border); color: var(--text-dark); }
.btn-outline:hover { background: var(--bg-main); }
.btn-danger { background: #ef4444; color: white; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem;}
.btn-full { width: 100%; }

.input-group { display: flex; flex-direction: column; gap: 0.4rem; }
.input-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-dark); }
input { padding: 0.5rem; border: 1px solid var(--border); border-radius: 6px; width: 100%; outline: none; transition: 0.2s; font-family: inherit;}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light);}

/* ---------------------------------
   Massive Overview Features
--------------------------------- */
.massive-scale { animation: slideUpFade 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
@keyframes slideUpFade { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

/* Quick Access Cards */
.quick-access-card {
    border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; background: var(--card-bg);
    display: flex; flex-direction: row; justify-content: space-between; align-items: center;
    transition: transform 0.2s, box-shadow 0.2s; 
}
.quick-access-card:hover { transform: translateX(5px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1); }
.qa-info { flex: 1; }
.quick-stats { display: flex; gap: 2rem; margin-top: 0.5rem; font-size: 0.9rem;}
.qa-action { flex-shrink: 0; margin-left: 2rem; }

/* Stat Cards */
.stat-card { display: flex; align-items: center; gap: 1.5rem; padding: 1.5rem 2rem; position: relative;}
.stat-icon { width: 60px; height: 60px; border-radius: 16px; display: flex; justify-content: center; align-items: center; font-size: 1.5rem; }
.bg-primary-light { background-color: var(--primary-light); }
.bg-gray { background-color: #f1f5f9; }
.stat-details { display: flex; flex-direction: column; }
.text-white-muted { color: rgba(255, 255, 255, 0.8) !important; }
.text-white { color: #ffffff !important; }

/* Charts & Data */
.chart-wrapper { position: relative; height: 280px; width: 100%; margin-top: 1rem;}
.donut-wrapper-large { height: 280px; margin-top: 1rem; }
.dot-indicator { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px;}

.table-responsive { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 600px;}
.data-table th { text-align: left; padding: 1rem; border-bottom: 2px solid var(--border); color: var(--text-muted); font-size: 0.85rem;}
.data-table td { padding: 1rem; border-bottom: 1px solid var(--border); font-size: 0.95rem; vertical-align: middle;}
.badge { padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 600; white-space: nowrap;}
.badge.success { background: #d1fae5; color: #065f46; }
.badge.warning { background: #fef3c7; color: #92400e; }

/* Community Card */
.community-card { background: linear-gradient(to right, #ffffff, #f8fafc); border: 1px solid var(--border); padding: 2rem; }
.community-content { display: flex; align-items: center; justify-content: space-between; gap: 2rem; text-align: left; }
.discord-icon { font-size: 3.5rem; color: #5865F2; flex-shrink: 0; }
.btn-discord { background-color: #5865F2; color: white; flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center;}
.btn-discord:hover { background-color: #4752C4; }
.pulse-animation { animation: gentlePulse 2s infinite ease-in-out; }
@keyframes gentlePulse { 0% { transform: scale(1); } 50% { transform: scale(1.05); } 100% { transform: scale(1); } }

/* Simulator Panel (Persistent) */
.simulator-panel {
    position: fixed; top: 0; right: -450px; width: 450px; height: 100vh;
    background: white; border-left: 1px solid var(--border); box-shadow: -20px 0 40px rgba(0,0,0,0.1);
    z-index: 1000; transition: right 0.3s ease; display: flex; flex-direction: column;
}
.simulator-panel.open { right: 0; }
.sim-header { background: var(--navbar-bg); color: white; padding: 1.5rem; display: flex; justify-content: space-between; }
.sim-content { padding: 1.5rem; overflow-y: auto; }
.sim-section { color: var(--primary); margin-bottom: 1rem; margin-top: 1rem; border-bottom: 1px solid var(--border); padding-bottom: 0.5rem;}
.grid-2-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1rem;}
.grid-3-inputs { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0.5rem; }
.days-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; }
.project-sim-block { background: var(--bg-main); padding: 1rem; border-radius: 8px; border: 1px solid var(--border); margin-bottom: 1rem; animation: slideUpFade 0.2s;}
.project-sim-block strong { display: block; font-size: 0.85rem; color: var(--text-muted); text-transform: uppercase;}
.close-btn { background: none; border: none; color: white; cursor: pointer; font-size: 1.2rem; }
.btn-remove-slot { background: none; border: none; color: #ef4444; cursor: pointer; padding: 0.2rem; transition: 0.2s; border-radius: 4px;}
.btn-remove-slot:hover { background: rgba(239, 68, 68, 0.1); }
.sim-desc { color: var(--text-muted); font-size: 0.8rem; line-height: 1.4; }
.alert-box { background: #d1fae5; color: #065f46; padding: 1rem; border-radius: 6px; font-size: 0.85rem; border: 1px solid #34d399; }
.flash-update { animation: flashText 0.3s ease-out; }
@keyframes flashText { 0% { color: #10b981; transform: scale(1.05); } 100% { color: inherit; transform: scale(1); } }

/* Responsive adjustments */
@media (max-width: 1200px) {
    .dashboard-bento-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .grid-3 { grid-template-columns: 1fr; }
    .quick-access-card { flex-direction: column; align-items: stretch; text-align: left; gap: 1.5rem;}
    .qa-action { margin-left: 0; }
}