@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Sophisticated Premium Palette */
    --primary: #3B82F6;
    --primary-light: #60A5FA;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --secondary: #6366F1;
    --accent: #F43F5E;

    /* Deep Corporate Backgrounds - Darker & Richer */
    --bg-main: #09090b;
    --bg-surface: #121217;
    --bg-card: rgba(18, 18, 23, 0.7);
    --bg-glass: rgba(18, 18, 23, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-inner-glow: inset 0 0 20px rgba(255, 255, 255, 0.02);

    /* Typography */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-inv: #0f172a;

    /* UI Tokens */
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 28px;
    --radius-xl: 36px;
    --shadow-premium: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Animation helper */
    --theme-transition: background-color 0.4s ease, border-color 0.4s ease, color 0.3s ease, box-shadow 0.4s ease, backdrop-filter 0.4s ease;
}

body.light-mode {
    --bg-main: #f1f5f9; /* Professional slate-100 background */
    --bg-surface: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-glass: rgba(255, 255, 255, 0.9);
    --glass-border: rgba(15, 23, 42, 0.12);
    --glass-inner-glow: inset 0 0 20px rgba(15, 23, 42, 0.02);
    --text-main: #0f172a; 
    --text-muted: #475569; 
    --text-dim: #64748b;
    --text-inv: #ffffff;
    --primary: #2563eb;
    --primary-light: #3b82f6;
    --primary-glow: rgba(37, 99, 235, 0.1);
    --secondary: #4f46e5;
    --accent: #e11d48;
    --shadow-premium: 0 20px 40px rgba(15, 23, 42, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--theme-transition);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Base text overrides for light mode */
body.light-mode h1, body.light-mode h2, body.light-mode h3, body.light-mode h4, body.light-mode h5, body.light-mode h6 {
    color: var(--text-main) !important;
}

body.light-mode p, body.light-mode span, body.light-mode div:not(.icon-box) {
    color: var(--text-main);
}

body.light-mode .text-muted { color: var(--text-muted) !important; }
body.light-mode .text-dim { color: var(--text-dim) !important; }

/* Image/Logo Theme Inversion */
body.light-mode .logo-img, 
body.light-mode .logo img,
body.light-mode .invert-light {
    filter: brightness(0) !important;
}

/* Background Layers */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: var(--bg-main);
}

body.light-mode .glass-bg {
    background: radial-gradient(circle at 0% 0%, #f8fafc 0%, #e2e8f0 100%) !important;
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

body.light-mode .glass-bg::after {
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.04) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.04) 0%, transparent 40%) !important;
}

body.light-mode .btn {
    border-color: var(--glass-border) !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
}

body.light-mode .btn-outline {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
}

body.light-mode .btn-outline:hover {
    background: #f1f5f9 !important;
}

body.light-mode .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    color: #ffffff !important;
    border: none !important;
}

body.light-mode .card {
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.05) !important;
    background: rgba(255, 255, 255, 0.8) !important;
    backdrop-filter: blur(20px);
    border-color: rgba(255, 255, 255, 0.8) !important;
}

body.light-mode input,
body.light-mode select,
body.light-mode textarea {
    background: #ffffff !important;
    color: #0f172a !important;
    border: 1px solid #cbd5e1 !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02) !important;
}

body.light-mode input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px var(--primary-glow) !important;
}

body.light-mode td {
    background: #ffffff !important;
    border-color: #f1f5f9 !important;
    color: #0f172a !important;
}

body.light-mode th {
    color: #64748b !important;
}

body.light-mode .sidebar-menu a.active {
    box-shadow: 0 8px 16px rgba(37, 99, 235, 0.15) !important;
}

/* Explore Card Light Mode */
body.light-mode .explore-card {
    background: #ffffff !important;
    border-color: rgba(15, 23, 42, 0.08) !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.04) !important;
}

body.light-mode .explore-card::before {
    opacity: 0.05 !important;
}

body.light-mode .explore-card .title {
    color: var(--primary) !important;
    font-weight: 800;
}

body.light-mode .explore-card .subtitle {
    color: var(--text-dim) !important;
}

body.light-mode .explore-card i {
    background: rgba(37, 99, 235, 0.05) !important;
    color: var(--primary) !important;
    border-color: rgba(37, 99, 235, 0.1) !important;
}

body.light-mode .explore-card:hover {
    background: #ffffff !important;
    border-color: var(--primary) !important;
    transform: translateY(-5px) !important;
    box-shadow: 0 15px 35px rgba(37, 99, 235, 0.1) !important;
}

body.light-mode .explore-card:hover i {
    background: var(--primary) !important;
    color: #ffffff !important;
}


h1,
h2,
h3,
h4,
.logo {
    font-family: 'Outfit', sans-serif;
}

/* Corporate Background with subtle geometric glow */
.glass-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 0% 0%, #0c152b 0%, #060912 100%);
    overflow: hidden;
}

.glass-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(99, 102, 241, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.blob {
    position: absolute;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    filter: blur(140px);
    pointer-events: none;
    opacity: 0.1;
    animation: move 25s infinite alternate ease-in-out;
}

.blob-1 {
    background: var(--primary);
    top: -10%;
    right: -5%;
}

.blob-2 {
    background: var(--secondary);
    bottom: -10%;
    left: -5%;
    animation-direction: alternate-reverse;
}

@keyframes move {
    from {
        transform: translate(0, 0) scale(1);
    }

    to {
        transform: translate(100px, 100px) scale(1.2);
    }
}

/* Enhanced Premium Card */
.card {
    background: var(--bg-glass);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-premium), var(--glass-inner-glow);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(15, 23, 42, 0.75);
    transform: translateY(-4px);
}

/* Typography Extensions */
.text-gradient {
    background: linear-gradient(to right, #ffffff, #94A3B8);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 0.6rem;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 8px 25px -5px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(37, 99, 235, 0.5);
    background: linear-gradient(135deg, #4f8cf0 0%, #2563eb 100%);
}

/* Home App Style */
.app-hero {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(6, 9, 18, 1) 100%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.app-hero::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.1;
    pointer-events: none;
}

/* Premium Home Widgets - Modern Dashboard Style */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary);
}

.section-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: white;
}

.section-header a {
    color: var(--primary-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 50px;
    transition: var(--transition);
}

.section-header a:hover {
    background: var(--primary);
    color: white;
}

.horizontal-scroll {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding: 1rem 0.5rem 2rem;
    scrollbar-width: none;
}

.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

.mini-card {
    flex: 0 0 260px;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.mini-card:hover {
    transform: translateY(-10px) scale(1.02);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    background: rgba(15, 23, 42, 0.6);
}

.mini-card-img {
    height: 160px;
    background: linear-gradient(135deg, var(--primary-glow) 0%, rgba(6, 9, 18, 0.5) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.mini-card-img::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(transparent, rgba(15, 23, 42, 0.8));
}

.mini-card-img i {
    width: 56px;
    height: 56px;
    color: white;
    filter: drop-shadow(0 0 15px var(--primary));
    z-index: 1;
}

.mini-card-content {
    padding: 1.5rem;
}

.mini-card-title {
    font-weight: 800;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: white;
}

.mini-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mini-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.price-tag {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-light);
}

.plus-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 15px var(--primary-glow);
    transition: var(--transition);
}

.mini-card:hover .plus-btn {
    transform: rotate(90deg);
}

/* Explore Grid Redesign (Mobile Style Widgets) */
.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 300px));
    gap: 1rem;
    margin-top: 1rem;
}

.explore-card {
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.5) 0%, rgba(15, 23, 42, 0.8) 100%);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    padding: 1.2rem;
    text-decoration: none;
    color: white;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
}

.explore-card::before {
    content: '';
    position: absolute;
    top: -15%;
    right: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.4;
    transition: var(--transition);
}

.explore-card:hover {
    transform: translateY(-8px) scale(1.03);
    border-color: var(--primary-light);
    background: linear-gradient(145deg, rgba(59, 130, 246, 0.2) 0%, rgba(15, 23, 42, 0.9) 100%);
}

.explore-card:hover::before {
    transform: translate(-10%, 10%);
    opacity: 0.6;
}

.explore-card i {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(5px);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-light);
    margin-bottom: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
    z-index: 1;
    font-size: 1.5rem;
}

.explore-card:hover i {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(-8deg);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.explore-card div {
    position: relative;
    z-index: 2;
}

.explore-card .title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.2rem;
    line-height: 1.2;
}

.explore-card .subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}


.explore-card:hover i {
    background: var(--primary);
    color: white;
    transform: scale(1.1) rotate(-5deg);
}

.explore-card div {
    z-index: 1;
}

@media (max-width: 768px) {
    .nav {
        padding: 1rem 5%;
    }
}


.btn-outline {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

/* Navbar */
.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(6, 9, 18, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

body.light-mode .nav {
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(148, 163, 184, 0.5);
}

body.light-mode .logo-main,
body.light-mode .logo-subtext,
body.light-mode .nav a,
body.light-mode .user-profile a,
body.light-mode .btn-outline {
    color: #0f172a;
}

body.light-mode .btn-outline {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(148, 163, 184, 0.6);
}

body.light-mode .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: #ffffff;
}

.logo {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    line-height: 1;
}

.logo-main {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    letter-spacing: -0.02em;
}

.logo-subtext {
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
}

.logo-subtext span {
    color: var(--primary);
    font-weight: 700;
}

/* Dashboard Layout */
.dashboard-container {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2.5rem;
    padding: 2rem 5%;
    max-width: 1600px;
    margin: 0 auto;
}

@media (max-width: 1400px) {
    .dashboard-container {
        padding: 1.5rem 3%;
        gap: 1.5rem;
        grid-template-columns: 240px 1fr;
    }
    
    .nav {
        padding: 0.75rem 3% !important;
    }
    
    .card {
        padding: 1.5rem;
    }
    
    .sidebar {
        padding: 1rem;
        top: 80px;
        height: calc(100vh - 110px);
    }
}

.sidebar {
    position: sticky;
    top: 100px;
    height: calc(100vh - 140px);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.sidebar-menu {
    list-style: none;
    margin-top: 1rem;
}

.sidebar-menu a {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 0.8rem;
    transition: var(--transition);
    margin-bottom: 0.4rem;
}

.sidebar-menu a i {
    font-size: 1.1rem;
}

.sidebar-menu a:hover {
    color: white;
    background: rgba(255, 255, 255, 0.05);
}

.sidebar-menu a.active {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
    font-weight: 600;
    box-shadow: inset 0 0 10px rgba(59, 130, 246, 0.1);
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-glass);
    padding: 1.8rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    opacity: 0.3;
}

.stat-value {
    font-size: 2.4rem;
    font-weight: 700;
    color: white;
    margin-top: 0.5rem;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.stat-icon {
    font-size: 1.5rem;
    color: var(--primary);
}

/* Tables */
.table-container {
    width: 100%;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
}

th {
    text-align: left;
    padding: 0 1rem 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 1.2rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
}

td:first-child {
    border-left: 1px solid var(--glass-border);
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

td:last-child {
    border-right: 1px solid var(--glass-border);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Utilities */
.badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    display: inline-block;
}

.badge-admin {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-docente {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-alumno {
    background: rgba(99, 102, 241, 0.1);
    color: #818cf8;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

/* Responsive */
@media (max-width: 1024px) {
    .dashboard-container {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
        height: auto;
        margin-bottom: 2rem;
    }
}

@media (max-width: 768px) {
    .nav {
        padding: 1rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .container {
        padding: 2rem 5%;
    }
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.animate-in {
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Chart Mockup Elements */
.chart-container {
    height: 180px;
    width: 100%;
    position: relative;
    margin-top: 1rem;
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chart-bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary), var(--secondary));
    border-radius: 4px 4px 2px 2px;
    transition: var(--transition);
}

.chart-bar:hover {
    filter: brightness(1.2);
    box-shadow: 0 0 15px var(--primary-glow);
}