/* ============================================================
   LITC :: MODERN SAAS ADMIN PANEL
   Ultra Premium UI stylization
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/icon?family=Material+Icons');

:root {
    --bg-base: #09090b;
    --bg-surface: #18181b;
    --bg-surface-hover: #27272a;
    --border-color: #27272a;
    --border-hover: #3f3f46;
    --text-primary: #fafafa;
    --text-muted: #a1a1aa;
    
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --success: #22c55e;
    
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-full: 9999px;
    
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
    height: 100vh;
    overflow: hidden;
}

/* === Layout Engine === */
.admin-layout {
    display: flex;
    height: 100vh;
}

/* === Sidebar === */
.admin-sidebar {
    width: 260px;
    background-color: var(--bg-base);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}
.sidebar-header {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}
.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}
.sidebar-brand i { color: var(--accent); }
.sidebar-nav {
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}
.nav-item i { font-size: 20px; }
.nav-item:hover {
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
}
.nav-item.active {
    background-color: var(--bg-surface);
    color: var(--text-primary);
}
.nav-item.active i { color: var(--accent); }

/* === Main Content Area === */
.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-base);
    overflow: hidden;
}
.topbar {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 32px;
    background-color: var(--bg-surface);
}
.topbar h2 {
    font-size: 16px;
    font-weight: 600;
}
.content-scrollable {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

/* === Dashboard Sections === */
.admin-section {
    display: none;
    animation: fadein 0.3s ease;
}
.admin-section.active { display: block; }
@keyframes fadein { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* === Cards === */
.admin-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-sm);
}
.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}
.admin-card-title {
    font-size: 18px;
    font-weight: 600;
}

/* === Tables === */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    text-align: left;
    padding: 12px 16px;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--border-color);
}
.admin-table td {
    padding: 16px;
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}
.admin-table tbody tr { transition: background 0.2s; }
.admin-table tbody tr:hover { background-color: rgba(255,255,255,0.02); }

/* === Badges === */
.badge {
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}
.badge-success { background: rgba(34, 197, 94, 0.15); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-danger { background: rgba(239, 68, 68, 0.15); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }

/* === Buttons & Inputs === */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--bg-surface-hover);
    color: var(--text-primary);
    border: 1px solid var(--border-hover);
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}
.btn:hover { background-color: var(--border-hover); }
.btn-primary { background-color: var(--accent); border-color: var(--accent); color: white; }
.btn-primary:hover { background-color: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background-color: var(--danger); border-color: var(--danger); color: white; }
.btn-danger:hover { background-color: var(--danger-hover); border-color: var(--danger-hover); }
.btn-sm { padding: 6px 12px; font-size: 12px; }

.input {
    background-color: var(--bg-base);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: 14px;
    width: 100%;
    transition: border-color 0.2s;
    outline: none;
}
.input:focus { border-color: var(--accent); }

/* === Asset Grid (Decorations/Backgrounds) === */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}
.asset-card {
    background: var(--bg-base);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, border-color 0.2s;
}
.asset-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
}
.asset-preview-wrap {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.asset-preview { width: 100%; height: 100%; object-fit: contain; }
.asset-info { padding: 12px; text-align: center; }
.asset-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asset-id { font-size: 11px; color: var(--text-muted); margin-bottom: 12px; }
.asset-actions { padding: 0 12px 12px; }
.asset-actions .btn { width: 100%; }

.upload-form { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; background: var(--bg-base); padding: 16px; border-radius: var(--radius-md); border: 1px dashed var(--border-color); }
.upload-form .input { width: auto; flex: 1; }

/* === Logs === */
.logs-container { display: flex; flex-direction: column; gap: 12px; }
.log-entry { background: var(--bg-base); border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 16px; }
.log-header { font-size: 12px; color: var(--text-muted); font-family: monospace; margin-bottom: 8px; }
.log-error { font-size: 14px; color: var(--danger); font-weight: 600; margin-bottom: 8px; }
.log-trace { font-size: 11px; color: var(--text-muted); font-family: monospace; white-space: pre-wrap; background: rgba(0,0,0,0.3); padding: 12px; border-radius: 6px; max-height: 150px; overflow-y: auto; }

/* === Auth Login View === */
.login-view { display: flex; justify-content: center; align-items: center; height: 100vh; background: var(--bg-base); }
.login-box { background: var(--bg-surface); padding: 40px; border-radius: var(--radius-lg); border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); width: 360px; text-align: center; }
.login-box h1 { font-size: 24px; margin-bottom: 24px; display: flex; justify-content: center; align-items: center; gap: 10px; }
.login-box h1 i { color: var(--accent); }
.login-box form { display: flex; flex-direction: column; gap: 16px; }

/* === Modals Engine Styling === */
.engine-modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.engine-modal { background: var(--bg-surface); border: 1px solid var(--border-color); border-radius: var(--radius-lg); width: 440px; max-width: 90vw; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.engine-modal-header { padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border-color); background: rgba(255,255,255,0.02); }
.engine-modal-body { padding: 20px; max-height: 60vh; overflow-y: auto; }
.engine-modal-close { margin: 0 20px 20px; padding: 10px; background: var(--bg-base); border: 1px solid var(--border-color); border-radius: var(--radius-md); text-align: center; cursor: pointer; font-weight: 600; font-size: 13px; color: var(--text-primary); transition: background 0.2s; }
.engine-modal-close:hover { background: var(--border-hover); }
