/* =========================================
   SMM PANEL - CORE THEME SYSTEM
   ========================================= */

/* GLOBAL RESETS & DEFAULTS */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
}

body {
    background-color: var(--bg-color);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    background-size: cover;
    color: var(--text-main);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
    transition: background 0.3s ease, color 0.3s ease;
}

/* =========================================
   1. GLASS THEME (DEFAULT / DARK)
   ========================================= */
:root {
    --primary: #818cf8;
    --primary-hover: #a5b4fc;
    --accent: #2dd4bf;
    --secondary: #f472b6;
    --success: #34d399;
    --warning: #fbbf24;
    --danger: #fb7185;

    --bg-color: #020617;
    --bg-gradient: radial-gradient(circle at 50% 0%, #1e1b4b 0%, transparent 70%),
        radial-gradient(circle at 100% 0%, #312e81 0%, transparent 50%);

    --glass-bg: rgba(15, 23, 42, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    --text-main: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --card-radius: 16px;
    --btn-radius: 8px;
    --input-radius: 8px;
    --input-bg: rgba(2, 6, 23, 0.5);

    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================
   2. BASIC THEME (FLAT / CORPORATE)
   ========================================= */
html[data-theme="basic"] {
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --accent: #0ea5e9;
    --secondary: #64748b;
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;

    --bg-color: #f3f4f6;
    /* Light Grey */
    --bg-gradient: none;

    --glass-bg: #ffffff;
    --glass-border: #e5e7eb;
    /* Light Border */
    --glass-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);

    --text-main: #111827;
    --text-secondary: #4b5563;
    --text-muted: #9ca3af;

    --card-radius: 4px;
    --btn-radius: 4px;
    --input-radius: 4px;
    --input-bg: #ffffff;
}

/* BASIC LAYOUT OVERRIDES - Traditional Admin Panel Structure */
html[data-theme="basic"] .layout {
    display: block;
}

html[data-theme="basic"] .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    border-radius: 0;
    margin: 0;
    background: #1f2937;
    border: none;
    z-index: 1000;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
}

html[data-theme="basic"] .sidebar .brand {
    color: #fff;
    padding-bottom: 1rem;
    border-bottom: 1px solid #374151;
    margin-bottom: 1rem;
}

html[data-theme="basic"] .sidebar .nav-link {
    color: #9ca3af;
    border-radius: 4px;
    margin-bottom: 2px;
}

html[data-theme="basic"] .sidebar .nav-link:hover,
html[data-theme="basic"] .sidebar .nav-link.active {
    background: #111827;
    color: white;
    border-left: 3px solid #3b82f6;
    box-shadow: none;
}

html[data-theme="basic"] .main-content {
    margin-left: 250px;
    padding: 0;
}

html[data-theme="basic"] .glass-header {
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 0;
    margin: 0;
    position: sticky;
    top: 0;
    padding: 1rem 2rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

html[data-theme="basic"] .card-grid {
    padding: 2rem;
    gap: 1.5rem;
}

html[data-theme="basic"] .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}


/* =========================================
   3. AERO THEME (FUTURISTIC GLASS)
   ========================================= */
html[data-theme="aero"] {
    --primary: #ec4899;
    /* Pink */
    --primary-hover: #db2777;
    --accent: #06b6d4;
    --secondary: #8b5cf6;

    --bg-color: #fce7f3;
    --bg-gradient: linear-gradient(135deg, #fce7f3 0%, #c4b5fd 50%, #bae6fd 100%);

    --glass-bg: rgba(255, 255, 255, 0.4);
    --glass-border: rgba(255, 255, 255, 0.6);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);

    --text-main: #334155;
    --text-secondary: #475569;
    --text-muted: #64748b;

    --card-radius: 24px;
    --btn-radius: 50px;
    --input-radius: 20px;
    --input-bg: rgba(255, 255, 255, 0.6);
}

/* AERO LAYOUT OVERRIDES - Floating aesthetics */
html[data-theme="aero"] .layout {
    gap: 1.5rem;
    padding: 1.5rem;
}

html[data-theme="aero"] .sidebar {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    height: calc(100vh - 3rem);
}

html[data-theme="aero"] .glass-header {
    background: rgba(255, 255, 255, 0.25);
    margin: 0 0 1.5rem 0;
    border: 1px solid rgba(255, 255, 255, 0.7);
}

html[data-theme="aero"] .nav-link.active {
    background: linear-gradient(90deg, #ec4899, #8b5cf6);
    color: white;
    box-shadow: 0 4px 15px rgba(236, 72, 153, 0.4);
    border: none;
}


/* =========================================
   4. NEO THEME (CYBERPUNK TERMINAL)
   ========================================= */
html[data-theme="neo"] {
    --primary: #39ff14;
    /* Neon Green */
    --primary-hover: #32cd32;
    --accent: #ff00ff;
    --secondary: #00ffff;

    --bg-color: #000000;
    --bg-gradient: repeating-linear-gradient(0deg, transparent 0, transparent 1px, #050505 1px, #050505 2px);

    --glass-bg: #000000;
    --glass-border: #39ff14;
    --glass-shadow: none;

    --text-main: #39ff14;
    --text-secondary: #2ebb11;
    --text-muted: #1e7e0b;

    --card-radius: 0;
    --btn-radius: 0;
    --input-radius: 0;
    --input-bg: #000000;
}

/* NEO LAYOUT OVERRIDES - Terminal aesthetic */
html[data-theme="neo"] * {
    font-family: "Courier New", Courier, monospace !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

html[data-theme="neo"] .glass {
    border: 1px solid var(--primary);
    box-shadow: 0 0 5px rgba(57, 255, 20, 0.2);
}

html[data-theme="neo"] .btn {
    box-shadow: none;
    border: 1px solid var(--primary);
    background: black;
    color: var(--primary);
}

html[data-theme="neo"] .btn:hover {
    background: var(--primary);
    color: black;
}

html[data-theme="neo"] .form-control {
    border-bottom: 2px solid var(--primary);
    border-top: 0;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
}

html[data-theme="neo"] .nav-link.active {
    background: var(--primary);
    color: black;
    border: none;
}

html[data-theme="neo"] .sidebar {
    border-right: 2px solid var(--primary);
}


/* =========================================
   SHARED COMPONENTS (Keep logic generic)
   ========================================= */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 100px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: var(--glass-shadow);
}

.glass-header {
    position: sticky;
    top: 0.8rem;
    margin: 0 1.5rem 1.5rem 1.5rem;
    z-index: 100;
    padding: 0.6rem 1.2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: var(--btn-radius);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade {
    animation: fadeIn 0.4s ease-out forwards;
}

.btn {
    padding: 0.5rem 1rem;
    border-radius: var(--btn-radius);
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-hover));
    color: white;
    box-shadow: 0 4px 15px rgba(94, 96, 206, 0.4);
}

.btn-primary:active {
    transform: scale(0.96);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #d90429);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 71, 111, 0.4);
}

.layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 240px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-right: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
}

.brand {
    font-weight: 800;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-content {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.6rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--input-radius);
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.9rem;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    transform: translateX(5px);
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(94, 96, 206, 0.2), transparent);
    color: var(--primary);
    border-left: 3px solid var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.nav-link i {
    font-size: 1.2rem;
    opacity: 0.9;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0 1.5rem;
}

.stat-card {
    padding: 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent);
    border-radius: 50%;
}

.stat-title {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.table-container {
    padding: 0.5rem 1rem;
    margin: 0 1.5rem;
    border-radius: var(--card-radius);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.5rem;
}

th {
    text-align: left;
    padding: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--glass-border);
}

td {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    transition: var(--transition);
    font-size: 0.9rem;
}

td:first-child {
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

td:last-child {
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.06);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.8rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-control,
select.form-control {
    width: 100%;
    padding: 1rem 1.25rem;
    /* Increased padding for card feel */
    background: var(--input-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    /* Use card radius instead of input */
    color: var(--text-main);
    font-size: 1rem;
    transition: var(--transition);
    appearance: none;
    cursor: pointer;

    /* Custom Dropdown Arrow */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
}

select.form-control:hover {
    background-color: rgba(255, 255, 255, 0.05);
    /* Slight hover glow */
    border-color: var(--primary);
    transform: translateY(-2px);
    /* Slight lift like a card */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

option {
    background: #020617;
    /* Ensure dropdown options are readable */
    color: white;
    padding: 10px;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
    background: var(--glass-bg);
}

.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
    background-image: var(--bg-gradient);
}

.auth-box {
    width: 100%;
    max-width: 420px;
    padding: 3rem;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        bottom: 0;
        top: auto;
        width: 100%;
        height: auto;
        padding: 0.8rem;
        flex-direction: row;
        justify-content: space-around;
        border-right: none;
        border-top: 1px solid var(--glass-border);
        background: rgba(15, 12, 41, 0.95);
        backdrop-filter: blur(20px);
        z-index: 1000;
        border-radius: 20px 20px 0 0;
    }

    .sidebar .brand,
    .sidebar .admin-menu-section {
        display: none;
    }

    .nav-link span {
        display: none;
    }

    .nav-link {
        padding: 0.8rem;
        border-radius: 50%;
        justify-content: center;
    }

    .nav-link.active {
        border-left: none;
        background: var(--primary);
        color: white;
        box-shadow: 0 4px 10px rgba(94, 96, 206, 0.4);
    }

    .glass-header {
        margin: 1rem;
        flex-direction: row;
    }

    .main-content {
        padding-bottom: 100px;
    }

    /* BASIC THEME MOBILE OVERRIDE */
    html[data-theme="basic"] .sidebar {
        bottom: 0;
        top: auto;
        width: 100%;
        height: 60px;
        box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
        border-radius: 0;
    }

    html[data-theme="basic"] .main-content {
        margin-left: 0;
        padding-bottom: 70px;
    }

    /* AERO THEME MOBILE OVERRIDE */
    html[data-theme="aero"] .layout {
        padding: 0;
        gap: 0;
    }

    html[data-theme="aero"] .sidebar {
        height: auto;
        width: 100%;
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.7);
        border-radius: 20px 20px 0 0;
        background: rgba(255, 255, 255, 0.9);
        bottom: 0;
        top: auto;
    }

    html[data-theme="aero"] .glass-header {
        margin: 1rem;
        background: rgba(255, 255, 255, 0.8);
    }

    /* NEO THEME MOBILE OVERRIDE */
    html[data-theme="neo"] .sidebar {
        border-right: none;
        border-top: 2px solid var(--primary);
        height: auto;
        width: 100%;
        bottom: 0;
        top: auto;
    }
}