@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Outfit:wght@500;600;700&display=swap');

:root {
    /* MD3 Color Palette - Blue/Indigo Primary */
    --md-sys-color-primary: #3b5fcc;
    --md-sys-color-on-primary: #ffffff;
    --md-sys-color-primary-container: #dce1ff;
    --md-sys-color-on-primary-container: #001552;

    --md-sys-color-secondary: #585e71;
    --md-sys-color-on-secondary: #ffffff;
    --md-sys-color-secondary-container: #dde2f9;
    --md-sys-color-on-secondary-container: #151b2c;

    --md-sys-color-tertiary: #745470;
    --md-sys-color-on-tertiary: #ffffff;
    --md-sys-color-tertiary-container: #ffd7f7;
    --md-sys-color-on-tertiary-container: #2b122a;

    --md-sys-color-success: #2e6c45;
    --md-sys-color-on-success: #ffffff;

    /* Surface & Background */
    --md-sys-color-surface: #fefbff;
    --md-sys-color-surface-variant: #e1e2ec;
    --md-sys-color-on-surface: #1b1b1f;
    --md-sys-color-on-surface-variant: #44464f;
    --md-sys-color-background: #f8f9ff;

    /* Glassmorphism Tokens */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --glass-blur: blur(12px);

    /* Elevation & Shapes */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;

    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Material Design 3 Dark Mode Tokens */
[data-theme="dark"] {
    --md-sys-color-primary: #b0c6ff;
    --md-sys-color-on-primary: #002d6f;
    --md-sys-color-primary-container: #1e44ac;
    --md-sys-color-on-primary-container: #dce1ff;

    --md-sys-color-secondary: #bfc6dc;
    --md-sys-color-on-secondary: #293042;
    --md-sys-color-secondary-container: #3f4759;
    --md-sys-color-on-secondary-container: #dde2f9;

    --md-sys-color-tertiary: #debcdf;
    --md-sys-color-on-tertiary: #482947;
    --md-sys-color-tertiary-container: #5e3e5b;
    --md-sys-color-on-tertiary-container: #ffd7f7;

    --md-sys-color-surface: #121318;
    --md-sys-color-surface-variant: #44464f;
    --md-sys-color-on-surface: #e4e2e6;
    --md-sys-color-on-surface-variant: #c5c6d0;
    --md-sys-color-background: #1b1b1f;

    --glass-bg: rgba(30, 31, 38, 0.75);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Global Foundations */
html,
body {
    height: auto !important;
    min-height: 100%;
    overflow-y: auto !important;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--md-sys-color-background);
    color: var(--md-sys-color-on-surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--md-sys-color-on-surface);
}

/* Glassmorphism Plus */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.1),
        0 2px 4px -1px rgba(0, 0, 0, 0.06),
        inset 0 0 20px rgba(255, 255, 255, 0.05);
}

/* Dynamic Mesh Background */
.mesh-bg {
    background-color: var(--md-sys-color-primary);
    background-image:
        radial-gradient(at 0% 0%, rgba(118, 75, 162, 0.5) 0px, transparent 50%),
        radial-gradient(at 50% 0%, rgba(59, 95, 204, 0.5) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(118, 75, 162, 0.5) 0px, transparent 50%);
    position: relative;
}

.mesh-bg::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, var(--md-sys-color-background) 100%);
    pointer-events: none;
}

/* Hero Section Enhancement */
.hero-section {
    padding: 8rem 0 10rem 0;
    background: var(--md-sys-color-primary);
    position: relative;
    color: white;
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--md-sys-color-primary) !important;
    letter-spacing: -0.5px;
    transition: var(--transition);
}

.navbar-brand:hover {
    filter: drop-shadow(0 0 8px rgba(59, 95, 204, 0.3));
    transform: scale(1.02);
}

.nav-link {
    font-weight: 500;
    color: var(--md-sys-color-on-surface-variant) !important;
    padding: 0.5rem 1.2rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.nav-link:hover {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container) !important;
}

/* Card Modernization */
.card {
    background: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-surface-variant);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--md-sys-color-primary-container);
}

.card-header {
    background: var(--md-sys-color-surface-variant);
    border-bottom: none;
    padding: 1.2rem 1.5rem;
    font-weight: 600;
}

.bg-success {
    background-color: var(--md-sys-color-success) !important;
    color: white !important;
}

.bg-primary {
    background-color: var(--md-sys-color-primary) !important;
    color: white !important;
}

.bg-info {
    background-color: var(--md-sys-color-tertiary) !important;
    color: white !important;
}

/* Buttons & Inputs */
.btn {
    border-radius: 100px;
    /* MD3 pill shape */
    padding: 0.6rem 1.8rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: none;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--md-sys-color-primary);
    color: white;
}

.btn-primary:hover {
    background: #2d4db5;
    box-shadow: 0 8px 20px rgba(59, 95, 204, 0.3);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--md-sys-color-success);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(46, 108, 69, 0.3);
}

.btn-outline-primary {
    border: 1px solid var(--md-sys-color-primary);
    color: var(--md-sys-color-primary);
}

.form-control,
.form-select {
    background: var(--md-sys-color-surface-variant);
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.75rem 1.2rem;
    transition: var(--transition);
    color: var(--md-sys-color-on-surface);
}

.form-control:focus,
.form-select:focus {
    background: var(--md-sys-color-surface);
    border-color: var(--md-sys-color-primary);
    box-shadow: 0 0 0 4px rgba(59, 95, 204, 0.1);
    color: var(--md-sys-color-on-surface);
}

/* Tables & Badges */
.table {
    border-radius: var(--radius-md);
    overflow: hidden;
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    background: var(--md-sys-color-surface-variant);
    color: var(--md-sys-color-on-surface-variant);
    font-weight: 600;
    border-top: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.badge {
    padding: 0.5rem 1rem;
    font-weight: 600;
    border-radius: 100px;
    letter-spacing: 0.3px;
}

.badge.bg-success {
    background: var(--md-sys-color-primary-container) !important;
    color: var(--md-sys-color-on-primary-container) !important;
}

.badge.bg-info {
    background: var(--md-sys-color-tertiary-container) !important;
    color: var(--md-sys-color-on-tertiary-container) !important;
}

.badge.bg-warning {
    background: #fff4d5 !important;
    color: #7a5a00 !important;
}

/* Dashboard Specifics */
.hero-section {
    background: radial-gradient(circle at top right, #3b5fcc, #764ba2);
    padding: 6rem 0;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--md-sys-color-background);
}

::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-surface-variant);
    border-radius: 10px;
    border: 3px solid var(--md-sys-color-background);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--md-sys-color-secondary);
}

/* Animation Overlay */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Modal Improvements */
.modal-content {
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

/* Login Cards Hero */
.login-card {
    border: none;
    box-shadow: var(--shadow-md);
}

.login-card:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Stats Cards Utilities */
.stats-card {
    background: var(--md-sys-color-surface);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    border: 1px solid var(--md-sys-color-surface-variant);
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.stats-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
    border-color: var(--md-sys-color-primary);
}

.stats-icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    margin-right: 1.2rem;
    font-size: 1.5rem;
}

.stats-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 0.2rem;
}

.stats-value {
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Outfit', sans-serif;
    color: var(--md-sys-color-on-surface);
    line-height: 1.2;
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    color: var(--md-sys-color-on-surface-variant);
}

.theme-toggle:hover {
    background: var(--md-sys-color-surface-variant);
}

/* SweetAlert2 MD3 Overrides */
.swal2-popup {
    border-radius: 28px !important;
    padding: 2rem !important;
    font-family: "Inter", sans-serif !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: var(--shadow-lg) !important;
}

[data-theme="dark"] .swal2-popup {
    background: rgba(30, 31, 35, 0.95) !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
    color: #fff !important;
}

.swal2-title {
    font-family: "Outfit", sans-serif !important;
    font-weight: 700 !important;
    color: var(--md-sys-color-on-surface) !important;
}

.swal2-styled.swal2-confirm {
    border-radius: 12px !important;
    padding: 0.8rem 2rem !important;
    font-weight: 600 !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Empty State Styling */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--md-sys-color-primary), var(--md-sys-color-tertiary));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.5;
}

.empty-state-title {
    font-family: "Outfit", sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.empty-state-text {
    color: var(--md-sys-color-outline);
    max-width: 300px;
    margin: 0 auto;
}