/* 
  WISP System - Lux Premium Design System 
  Theme: Ultra Modern, Floating Glassmorphism, Sophisticated Hierarchy
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette - Vibrant & Lux */
    --primary: #6366f1;
    --primary-gradient: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
    --primary-glow: rgba(99, 102, 241, 0.4);

    --secondary: #0f172a;
    --accent: #f43f5e;
    --accent-gradient: linear-gradient(135deg, #fb7185 0%, #f43f5e 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --info: #0ea5e9;
    --info-bg: rgba(14, 165, 233, 0.1);

    /* Backgrounds */
    --bg-body: #f8fafc;
    --bg-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.05) 0, transparent 50%),
        radial-gradient(at 50% 0%, rgba(244, 63, 94, 0.03) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.05) 0, transparent 50%);

    --sidebar-bg: #0f172a;
    --sidebar-active: rgba(255, 255, 255, 0.1);

    /* Text */
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-white: #ffffff;

    /* Glassmorphism 2.0 - Stronger & Refined */
    --glass-bg: rgba(255, 255, 255, 0.75);
    --glass-border: rgba(255, 255, 255, 0.8);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.05);

    /* Shadows - Premium Depth */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

    /* Layout */
    --sidebar-width: 280px;
    --radius-md: 0.85rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.75rem;

    /* Border */
    --border-color: #e2e8f0;
}

/* ====== DARK MODE ====== */
[data-theme="dark"] {
    /* Backgrounds */
    --bg-body: #0f172a;
    --bg-mesh: radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.15) 0, transparent 50%),
        radial-gradient(at 50% 0%, rgba(244, 63, 94, 0.1) 0, transparent 50%),
        radial-gradient(at 100% 0%, rgba(14, 165, 233, 0.15) 0, transparent 50%);

    --sidebar-bg: #020617;
    --sidebar-active: rgba(255, 255, 255, 0.15);

    /* Text */
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;

    /* Glassmorphism Dark */
    --glass-bg: rgba(15, 23, 42, 0.8);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);

    /* Shadows */
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.3);

    /* Border */
    --border-color: #1e293b;
}

/* ====== RESET & BASE ====== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background: var(--bg-body);
    background-image: var(--bg-mesh);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(99, 102, 241, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    }
}

/* ====== WRAPPER & MAIN ====== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.main {
    flex: 1;
    padding: 2.5rem;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 1600px;
    margin: 0 auto;
}

@media (min-width: 992px) {
    .sidebar-open .main {
        margin-left: var(--sidebar-width);
    }
}

/* ====== FLOATING SIDEBAR ====== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    height: calc(100vh - 2rem);
    position: fixed;
    top: 1rem;
    left: 1rem;
    bottom: 1rem;
    border-radius: var(--radius-xl);
    z-index: 1000;
    padding: 2rem 1.25rem;
    transform: translateX(-110%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar-open .sidebar {
    transform: translateX(0);
}

.brand {
    padding: 0 1rem;
    margin-bottom: 3.5rem;
}

.brand span {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(to right, #fff, #94a3b8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.menu a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.9rem 1.25rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 500;
    margin-bottom: 0.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.menu a svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.menu a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    transform: translateX(5px);
}

.menu a.active {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.menu a.active::after {
    content: '';
    position: absolute;
    left: 0;
    top: 20%;
    height: 60%;
    width: 4px;
    background: #fff;
    border-radius: 0 4px 4px 0;
}

.sidebar .user {
    margin-top: auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ====== TYPOGRAPHY & HEADERS ====== */
h1 {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.page-header {
    margin-bottom: 3.5rem;
    animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 0;
    border: none;
    box-shadow: none;
}

/* ====== LUX CARDS ====== */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    padding: 2.25rem;
    box-shadow: var(--glass-shadow);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.1);
    border-color: var(--primary);
}

/* Dashboard Stat Cards */
.stat-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: 1.75rem;
    transition: all 0.4s ease;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-gradient);
    opacity: 0;
    z-index: -1;
    transition: opacity 0.4s ease;
}

.stat-card:hover::before {
    opacity: 0.03;
}

.stat-card .value {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--secondary);
    margin-top: 0.5rem;
}

/* ====== MODERN BUTTONS ====== */
.btn {
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    border: none;
    cursor: pointer;
}

.btn-primary {
    background: var(--primary-gradient);
    color: #fff;
    box-shadow: 0 10px 25px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 15px 35px var(--primary-glow);
}

.btn-primary:active {
    transform: translateY(1px) scale(0.98);
}

/* ====== PREMIUM TABLES ====== */
.table-responsive {
    background: #fff;
    border-radius: var(--radius-xl);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-premium);
}

.table th {
    background: #fcfdfe;
    padding: 1.5rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
}

.table td {
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-main);
    font-weight: 500;
}

.table tr:hover td {
    background: #f8fafc;
}

/* ====== FORMS ====== */
.form-control {
    background: #f8fafc;
    border: 2px solid #f1f5f9;
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* ====== UTILITIES ====== */
.badge {
    padding: 0.5rem 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-success {
    background: #dcfce7;
    color: #15803d;
}

.badge-danger {
    background: #fee2e2;
    color: #b91c1c;
}

/* Micro-interactions */
.sidebar a svg {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sidebar a:hover svg {
    transform: scale(1.2) rotate(5deg);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ====== SMOOTH DARK MODE TRANSITIONS ====== */
body,
.card,
.stat-card,
.table-responsive,
.form-control,
.sidebar,
.btn {
    transition: background-color 0.3s ease,
        color 0.3s ease,
        border-color 0.3s ease,
        box-shadow 0.3s ease;
}

/* Optimize animations with will-change */
.card:hover,
.stat-card:hover,
.btn:hover {
    will-change: transform, box-shadow;
}

/* ====== ALERT MESSAGES ====== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    animation: slideInDown 0.3s ease-out;
}

.alert-success {
    background: var(--success-bg);
    border-left: 4px solid var(--success);
    color: #065f46;
}

.alert-error {
    background: var(--danger-bg);
    border-left: 4px solid var(--danger);
    color: #991b1b;
}

.alert-warning {
    background: var(--warning-bg);
    border-left: 4px solid var(--warning);
    color: #92400e;
}

.alert-info {
    background: var(--info-bg);
    border-left: 4px solid var(--info);
    color: #075985;
}

.alert-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

@keyframes slideInDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Dark mode alerts */
[data-theme="dark"] .alert-success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

[data-theme="dark"] .alert-error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

[data-theme="dark"] .alert-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

[data-theme="dark"] .alert-info {
    background: rgba(14, 165, 233, 0.15);
    color: #7dd3fc;
}

/* ====== RESPONSIVE DESIGN ====== */

/* Tablets (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    .main {
        padding: 2rem;
    }

    h1 {
        font-size: 2.25rem;
    }

    .card {
        padding: 1.75rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-card .value {
        font-size: 2rem;
    }

    .sidebar {
        width: 240px;
    }

    :root {
        --sidebar-width: 240px;
    }

    .table th,
    .table td {
        padding: 1.25rem;
        font-size: 0.9rem;
    }
}

/* Mobile devices (max-width: 767px) */
@media (max-width: 767px) {
    .main {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.75rem;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .card {
        padding: 1.5rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .stat-card .value {
        font-size: 1.75rem;
    }

    .sidebar {
        width: 280px;
        left: 0;
        top: 0;
        bottom: 0;
        height: 100vh;
        border-radius: 0;
    }

    .sidebar-open .sidebar {
        transform: translateX(0);
    }

    .sidebar-open .main {
        margin-left: 0;
    }

    #mobileToggle {
        display: flex !important;
    }

    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .table {
        min-width: 600px;
    }

    .table th,
    .table td {
        padding: 1rem;
        font-size: 0.875rem;
    }

    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
}

/* Small mobile (max-width: 480px) */
@media (max-width: 480px) {
    .main {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1.25rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .stat-card .value {
        font-size: 1.5rem;
    }

    .table th,
    .table td {
        padding: 0.75rem;
        font-size: 0.8rem;
    }
}

/* ====== UTILITY CLASSES ====== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mb-1 {
    margin-bottom: 0.5rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

.d-none {
    display: none;
}

.d-flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.align-center {
    align-items: center;
}

.gap-1 {
    gap: 0.5rem;
}

.gap-2 {
    gap: 1rem;
}

.gap-3 {
    gap: 1.5rem;
}