/**
 * Campus Andina LMS - Theme Styles
 * Sistema de temas (light/dark/semi-dark) basado en oklch
 *
 * @package CampusAndina
 * @since 1.0.0
 */

/* ===================================
   CSS Custom Properties - Color System
   =================================== */

:root {
    /* Light Theme (Default) */
    --background: oklch(0.99 0 0);
    --foreground: oklch(0.15 0 0);
    --card: oklch(1 0 0);
    --card-foreground: oklch(0.15 0 0);
    --popover: oklch(1 0 0);
    --popover-foreground: oklch(0.15 0 0);
    --primary: oklch(0.48 0.24 264);
    --primary-foreground: oklch(0.99 0 0);
    --secondary: oklch(0.96 0.01 265);
    --secondary-foreground: oklch(0.15 0 0);
    --muted: oklch(0.95 0.01 265);
    --muted-foreground: oklch(0.5 0.02 265);
    --accent: oklch(0.58 0.22 264);
    --accent-foreground: oklch(0.99 0 0);
    --destructive: oklch(0.577 0.245 27.325);
    --destructive-foreground: oklch(0.99 0 0);
    --border: oklch(0.9 0.01 265);
    --input: oklch(0.9 0.01 265);
    --ring: oklch(0.48 0.24 264);
    --chart-1: oklch(0.48 0.24 264);
    --chart-2: oklch(0.68 0.26 25);
    --chart-3: oklch(0.62 0.24 180);
    --chart-4: oklch(0.72 0.2 140);
    --chart-5: oklch(0.65 0.26 340);
    --radius: 0.75rem;
    --sidebar: oklch(0.985 0 0);
    --sidebar-foreground: oklch(0.145 0 0);
    --sidebar-primary: oklch(0.205 0 0);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.97 0 0);
    --sidebar-accent-foreground: oklch(0.205 0 0);
    --sidebar-border: oklch(0.922 0 0);
    --sidebar-ring: oklch(0.708 0 0);

    /* Gradient colors */
    --gradient-from: var(--primary);
    --gradient-to: var(--accent);

    /* Success/Warning/Info colors */
    --success: oklch(0.6 0.2 145);
    --success-foreground: oklch(0.99 0 0);
    --warning: oklch(0.75 0.2 85);
    --warning-foreground: oklch(0.15 0 0);
    --info: oklch(0.65 0.2 240);
    --info-foreground: oklch(0.99 0 0);
}

/* Dark Theme */
.dark {
    --background: oklch(0.12 0.015 265);
    --foreground: oklch(0.97 0.005 265);
    --card: oklch(0.17 0.015 265);
    --card-foreground: oklch(0.97 0.005 265);
    --popover: oklch(0.17 0.015 265);
    --popover-foreground: oklch(0.97 0.005 265);
    --primary: oklch(0.7 0.26 265);
    --primary-foreground: oklch(0.12 0.015 265);
    --secondary: oklch(0.22 0.02 265);
    --secondary-foreground: oklch(0.97 0.005 265);
    --muted: oklch(0.22 0.02 265);
    --muted-foreground: oklch(0.68 0.02 265);
    --accent: oklch(0.75 0.22 264);
    --accent-foreground: oklch(0.12 0.015 265);
    --destructive: oklch(0.5 0.2 27);
    --destructive-foreground: oklch(0.97 0.005 265);
    --border: oklch(0.26 0.02 265);
    --input: oklch(0.26 0.02 265);
    --ring: oklch(0.7 0.26 265);
    --chart-1: oklch(0.7 0.26 265);
    --chart-2: oklch(0.75 0.28 25);
    --chart-3: oklch(0.67 0.26 180);
    --chart-4: oklch(0.77 0.24 140);
    --chart-5: oklch(0.7 0.28 340);
    --sidebar: oklch(0.205 0 0);
    --sidebar-foreground: oklch(0.985 0 0);
    --sidebar-primary: oklch(0.488 0.243 264.376);
    --sidebar-primary-foreground: oklch(0.985 0 0);
    --sidebar-accent: oklch(0.269 0 0);
    --sidebar-accent-foreground: oklch(0.985 0 0);
    --sidebar-border: oklch(0.269 0 0);
    --sidebar-ring: oklch(0.439 0 0);
}

/* Semi-Dark Theme */
.semi-dark {
    --background: oklch(0.2 0.015 265);
    --foreground: oklch(0.95 0.005 265);
    --card: oklch(0.25 0.015 265);
    --card-foreground: oklch(0.95 0.005 265);
    --popover: oklch(0.25 0.015 265);
    --popover-foreground: oklch(0.95 0.005 265);
    --primary: oklch(0.68 0.25 265);
    --primary-foreground: oklch(0.2 0.015 265);
    --secondary: oklch(0.3 0.02 265);
    --secondary-foreground: oklch(0.95 0.005 265);
    --muted: oklch(0.3 0.02 265);
    --muted-foreground: oklch(0.7 0.02 265);
    --accent: oklch(0.72 0.22 264);
    --accent-foreground: oklch(0.2 0.015 265);
    --destructive: oklch(0.55 0.22 27);
    --destructive-foreground: oklch(0.95 0.005 265);
    --border: oklch(0.35 0.02 265);
    --input: oklch(0.35 0.02 265);
    --ring: oklch(0.68 0.25 265);
}

/* ===================================
   Base Styles
   =================================== */

*,
*::before,
*::after {
    box-sizing: border-box;
    border-color: var(--border);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
    background-color: var(--background);
    color: var(--foreground);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
}

/* Hide Alpine.js elements until initialized */
[x-cloak] {
    display: none !important;
}

/* Selection color */
::selection {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

/* Focus visible for accessibility */
:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

/* ===================================
   Typography
   =================================== */

h1, h2, h3, h4, h5, h6 {
    color: var(--foreground);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Heading sizes only apply inside .prose/.entry-content (WordPress content areas).
   Component headings use Tailwind utility classes directly. */
.prose h1, .entry-content h1 { font-size: 2.25rem; }
.prose h2, .entry-content h2 { font-size: 1.875rem; }
.prose h3, .entry-content h3 { font-size: 1.5rem; }
.prose h4, .entry-content h4 { font-size: 1.25rem; }
.prose h5, .entry-content h5 { font-size: 1.125rem; }
.prose h6, .entry-content h6 { font-size: 1rem; }

@media (min-width: 768px) {
    .prose h1, .entry-content h1 { font-size: 3rem; }
    .prose h2, .entry-content h2 { font-size: 2.25rem; }
    .prose h3, .entry-content h3 { font-size: 1.875rem; }
}

p {
    margin: 0 0 1rem 0;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 150ms ease;
}

a:hover {
    color: var(--accent);
}

.text-balance {
    text-wrap: balance;
}

.text-pretty {
    text-wrap: pretty;
}

/* Text color utilities */
.text-foreground { color: var(--foreground); }
.text-primary { color: var(--primary); }
.text-primary-foreground { color: var(--primary-foreground); }
.text-muted-foreground { color: var(--muted-foreground); }
.text-accent { color: var(--accent); }
.text-accent-foreground { color: var(--accent-foreground); }
.text-destructive { color: var(--destructive); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }

/* Text size utilities */
.text-xs { font-size: 0.75rem; line-height: 1rem; }
.text-sm { font-size: 0.875rem; line-height: 1.25rem; }
.text-base { font-size: 1rem; line-height: 1.5rem; }
.text-lg { font-size: 1.125rem; line-height: 1.75rem; }
.text-xl { font-size: 1.25rem; line-height: 1.75rem; }
.text-2xl { font-size: 1.5rem; line-height: 2rem; }
.text-3xl { font-size: 1.875rem; line-height: 2.25rem; }
.text-4xl { font-size: 2.25rem; line-height: 2.5rem; }
.text-5xl { font-size: 3rem; line-height: 1; }

.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }

/* ===================================
   Background Utilities
   =================================== */

.bg-background { background-color: var(--background); }
.bg-foreground { background-color: var(--foreground); }
.bg-card { background-color: var(--card); }
.bg-primary { background-color: var(--primary); }
.bg-primary\/5 { background-color: color-mix(in oklch, var(--primary) 5%, transparent); }
.bg-primary\/10 { background-color: color-mix(in oklch, var(--primary) 10%, transparent); }
.bg-primary\/20 { background-color: color-mix(in oklch, var(--primary) 20%, transparent); }
.bg-secondary { background-color: var(--secondary); }
.bg-muted { background-color: var(--muted); }
.bg-muted\/30 { background-color: color-mix(in oklch, var(--muted) 30%, transparent); }
.bg-muted\/50 { background-color: color-mix(in oklch, var(--muted) 50%, transparent); }
.bg-accent { background-color: var(--accent); }
.bg-accent\/10 { background-color: color-mix(in oklch, var(--accent) 10%, transparent); }
.bg-accent\/20 { background-color: color-mix(in oklch, var(--accent) 20%, transparent); }
.bg-destructive { background-color: var(--destructive); }
.bg-popover { background-color: var(--popover); }
.bg-success { background-color: var(--success); }
.bg-success\/10 { background-color: color-mix(in oklch, var(--success) 10%, transparent); }

/* ===================================
   Border Utilities
   =================================== */

.border { border: 1px solid var(--border); }
.border-2 { border: 2px solid var(--border); }
.border-t { border-top: 1px solid var(--border); }
.border-b { border-bottom: 1px solid var(--border); }
.border-l { border-left: 1px solid var(--border); }
.border-r { border-right: 1px solid var(--border); }

.border-border { border-color: var(--border); }
.border-primary { border-color: var(--primary); }
.border-primary\/30 { border-color: color-mix(in oklch, var(--primary) 30%, transparent); }
.border-primary\/50 { border-color: color-mix(in oklch, var(--primary) 50%, transparent); }
.border-accent\/30 { border-color: color-mix(in oklch, var(--accent) 30%, transparent); }
.border-accent\/50 { border-color: color-mix(in oklch, var(--accent) 50%, transparent); }
.border-input { border-color: var(--input); }
.border-success { border-color: var(--success); }
.border-success\/30 { border-color: color-mix(in oklch, var(--success) 30%, transparent); }

/* Border radius */
.rounded { border-radius: var(--radius); }
.rounded-sm { border-radius: calc(var(--radius) - 4px); }
.rounded-md { border-radius: calc(var(--radius) - 2px); }
.rounded-lg { border-radius: var(--radius); }
.rounded-xl { border-radius: calc(var(--radius) + 4px); }
.rounded-2xl { border-radius: calc(var(--radius) + 8px); }
.rounded-full { border-radius: 9999px; }

/* ===================================
   Component Styles - Button
   =================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 150ms ease;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
}

.btn:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.btn:disabled {
    pointer-events: none;
    opacity: 0.5;
}

.btn-default,
.btn {
    padding: 0.625rem 1rem;
    height: 2.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    height: 2rem;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    height: 3rem;
    font-size: 1rem;
}

.btn-icon {
    padding: 0;
    width: 2.5rem;
    height: 2.5rem;
}

.btn-icon.btn-sm {
    width: 2rem;
    height: 2rem;
}

.btn-icon.btn-lg {
    width: 3rem;
    height: 3rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--primary-foreground) !important;
}

.btn-primary:hover {
    background-color: color-mix(in oklab, var(--primary) 85%, black);
    color: var(--primary-foreground) !important;
    opacity: 1;
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.btn-secondary:hover {
    opacity: 0.8;
}

.btn-outline {
    border: 2px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
}

.btn-outline:hover {
    background-color: var(--muted);
    border-color: var(--primary);
}

.btn-ghost {
    background-color: transparent;
    color: var(--foreground);
}

.btn-ghost:hover {
    background-color: var(--muted);
}

.btn-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
}

.btn-destructive:hover {
    opacity: 0.9;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--primary-foreground);
}

.btn-gradient:hover {
    opacity: 0.9;
}

/* ===================================
   Component Styles - Card
   =================================== */

.card {
    background-color: var(--card);
    color: var(--card-foreground);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--card-foreground);
    margin: 0;
}

.card-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    margin: 0;
}

.card-content {
    padding: 1.5rem;
    padding-top: 0;
}

.card-content:first-child {
    padding-top: 1.5rem;
}

.card-footer {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    padding-top: 0;
}

.card:hover {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

/* ===================================
   Component Styles - Badge
   =================================== */

.badge {
    display: inline-flex;
    align-items: center;
    border-radius: 9999px;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    transition: colors 150ms ease;
}

.badge-default {
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.badge-secondary {
    background-color: var(--secondary);
    color: var(--secondary-foreground);
}

.badge-outline {
    border: 1px solid var(--border);
    background-color: transparent;
    color: var(--foreground);
}

.badge-destructive {
    background-color: var(--destructive);
    color: var(--destructive-foreground);
}

.badge-success {
    background-color: color-mix(in oklch, var(--success) 10%, transparent);
    color: var(--success);
    border: 1px solid color-mix(in oklch, var(--success) 30%, transparent);
}

/* ===================================
   Component Styles - Input
   =================================== */

.input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
    display: flex;
    width: 100%;
    border-radius: var(--radius);
    border: 1px solid var(--input);
    background-color: var(--background);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--foreground);
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:not([type="checkbox"]):not([type="radio"]) {
    height: 2.5rem;
}

input::placeholder,
textarea::placeholder {
    color: var(--muted-foreground);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--ring);
    box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 20%, transparent);
    outline: none;
}

input:disabled,
select:disabled,
textarea:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

textarea {
    min-height: 5rem;
    resize: vertical;
}

/* Checkbox and radio */
input[type="checkbox"],
input[type="radio"] {
    appearance: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--input);
    background: var(--background);
    transition: all 150ms ease;
    cursor: pointer;
}

input[type="checkbox"] {
    border-radius: 0.25rem;
}

input[type="radio"] {
    border-radius: 50%;
}

input[type="checkbox"]:checked,
input[type="radio"]:checked {
    background: var(--primary);
    border-color: var(--primary);
}

input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;
}

input[type="radio"]:checked {
    background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
}

/* ===================================
   Component Styles - Progress
   =================================== */

.progress {
    position: relative;
    height: 0.5rem;
    width: 100%;
    overflow: hidden;
    border-radius: 9999px;
    background-color: var(--secondary);
}

.progress-indicator {
    height: 100%;
    background-color: var(--primary);
    transition: width 500ms ease;
    border-radius: 9999px;
}

/* ===================================
   Component Styles - Tabs
   =================================== */

.tabs-list {
    display: inline-flex;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background-color: var(--muted);
    padding: 0.25rem;
}

.tabs-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: calc(var(--radius) - 2px);
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: all 150ms ease;
    cursor: pointer;
    border: none;
    background: transparent;
}

.tabs-trigger:hover {
    color: var(--foreground);
}

.tabs-trigger[data-state="active"],
.tabs-trigger.active {
    background-color: var(--background);
    color: var(--foreground);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tabs-content {
    margin-top: 0.5rem;
}

.tabs-content[hidden] {
    display: none;
}

/* ===================================
   Component Styles - Dropdown
   =================================== */

.dropdown-content {
    position: absolute;
    top: 100%;
    margin-top: 0.5rem;
    z-index: 50;
    background-color: var(--popover);
    color: var(--popover-foreground);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    min-width: 10rem;
    overflow: hidden;
}

.dropdown-content.right-0 {
    right: 0;
}

.dropdown-content.left-0 {
    left: 0;
}

.dropdown-item {
    display: flex;
    cursor: pointer;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    transition: background-color 150ms ease;
    color: var(--popover-foreground);
    text-decoration: none;
}

.dropdown-item:hover {
    background-color: var(--muted);
}

.dropdown-item svg {
    flex-shrink: 0;
}

/* Dropdown widths */
.w-56 { width: 14rem; }
.w-80 { width: 20rem; }

/* Max heights */
.max-h-96 { max-height: 24rem; }

/* ===================================
   Component Styles - Accordion
   =================================== */

.accordion-item {
    border-bottom: 1px solid var(--border);
}

.accordion-trigger {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: all 150ms ease;
    color: var(--foreground);
    background: transparent;
    border: none;
    width: 100%;
}

.accordion-trigger:hover {
    text-decoration: underline;
}

.accordion-trigger svg {
    transition: transform 200ms ease;
    flex-shrink: 0;
}

.accordion-trigger[data-state="open"] svg,
.accordion-trigger.open svg {
    transform: rotate(180deg);
}

.accordion-content {
    overflow: hidden;
    font-size: 0.875rem;
    color: var(--muted-foreground);
    padding-bottom: 1rem;
}

/* ===================================
   Component Styles - Dialog/Modal
   =================================== */

.dialog-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.8);
    animation: fade-in 150ms ease;
}

.dialog-content {
    position: fixed;
    left: 50%;
    top: 50%;
    z-index: 50;
    width: 100%;
    max-width: 32rem;
    transform: translate(-50%, -50%);
    border-radius: var(--radius);
    background-color: var(--background);
    padding: 1.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: zoom-in 200ms ease;
}

.dialog-header {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    text-align: center;
}

.dialog-footer {
    display: flex;
    flex-direction: column-reverse;
    gap: 0.5rem;
    margin-top: 1rem;
}

@media (min-width: 640px) {
    .dialog-footer {
        flex-direction: row;
        justify-content: flex-end;
    }
}

.dialog-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.025em;
    color: var(--foreground);
}

.dialog-description {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

/* ===================================
   Navigation Styles
   =================================== */

.nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-menu li {
    position: relative;
}

.nav-menu li a {
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--muted-foreground);
    transition: color 150ms ease;
}

.nav-menu li a:hover {
    color: var(--foreground);
}

/* Submenu */
.nav-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 200px;
    background: var(--popover);
    border-radius: var(--radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 200ms ease;
    z-index: 100;
    border: 1px solid var(--border);
}

.nav-menu li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu .sub-menu li {
    display: block;
}

.nav-menu .sub-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    color: var(--popover-foreground);
    transition: background 150ms ease;
}

.nav-menu .sub-menu li a:hover {
    background: var(--muted);
    color: var(--primary);
}

/* Mobile menu */
.mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu li a {
    display: block;
    padding: 0.75rem 0;
    color: var(--foreground);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
}

/* Sheet (mobile drawer) */
.sheet-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    background-color: rgba(0, 0, 0, 0.8);
}

.sheet-content {
    position: fixed;
    z-index: 50;
    background: var(--background);
    transition: transform 300ms ease-in-out;
}

.sheet-content.right {
    inset: 0 0 0 auto;
    width: 100%;
    max-width: 400px;
    border-left: 1px solid var(--border);
}

.sheet-content.left {
    inset: 0 auto 0 0;
    width: 100%;
    max-width: 400px;
    border-right: 1px solid var(--border);
}

/* ===================================
   Header Styles
   =================================== */

/* Transparent header (over hero) */
.header-transparent {
    background-color: transparent !important;
    border-bottom-color: transparent !important;
}

.header-transparent .header-text-primary {
    color: #fff;
}

.header-transparent .header-text-secondary {
    color: rgba(255, 255, 255, 0.6);
}

.header-transparent .header-nav-link {
    color: rgba(255, 255, 255, 0.8);
}

.header-transparent .header-nav-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-transparent .header-nav-active {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.15);
}

.header-transparent .header-icon-btn {
    color: rgba(255, 255, 255, 0.8);
}

.header-transparent .header-icon-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.header-transparent .header-separator {
    background-color: rgba(255, 255, 255, 0.2);
}

/* User avatar button en header transparente */
.header-transparent .header-user-btn {
    color: rgba(255, 255, 255, 0.9);
}
.header-transparent .header-user-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}
.header-transparent .header-user-btn .header-user-name {
    color: rgba(255, 255, 255, 0.9);
}
.header-transparent .header-user-btn .header-user-chevron {
    color: rgba(255, 255, 255, 0.6);
}
.header-transparent .header-user-btn img {
    ring-color: rgba(255, 255, 255, 0.3);
    outline: 2px solid rgba(255, 255, 255, 0.3);
    outline-offset: 0px;
}
.header-transparent .header-divider {
    background-color: rgba(255, 255, 255, 0.2);
}

/* User avatar button en header scrolled */
.header-scrolled .header-user-btn {
    color: var(--foreground);
}
.header-scrolled .header-user-btn:hover {
    background-color: var(--muted);
}
.header-scrolled .header-user-btn .header-user-name {
    color: var(--foreground);
}
.header-scrolled .header-user-btn .header-user-chevron {
    color: var(--muted-foreground);
}
.header-scrolled .header-user-btn img {
    outline: 2px solid var(--border);
    outline-offset: 0px;
}

/* Apple-style glassmorphism for scrolled header */
.header-glass {
    background-color: rgba(255, 255, 255, 0.72) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom-color: rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04);
}

.header-scrolled .header-text-primary {
    color: var(--foreground);
}

.header-scrolled .header-text-secondary {
    color: var(--muted-foreground);
    opacity: 0.6;
}

.header-scrolled .header-nav-link {
    color: var(--muted-foreground);
}

.header-scrolled .header-nav-link:hover {
    color: var(--foreground);
    background-color: color-mix(in oklch, var(--muted) 50%, transparent);
}

.header-scrolled .header-nav-active {
    color: var(--primary) !important;
    background-color: color-mix(in oklch, var(--primary) 8%, transparent);
}

.header-scrolled .header-icon-btn {
    color: var(--muted-foreground);
}

.header-scrolled .header-icon-btn:hover {
    color: var(--foreground);
    background-color: color-mix(in oklch, var(--muted) 50%, transparent);
}

.header-scrolled .header-separator {
    background-color: var(--border);
    opacity: 0.5;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    width: 100%;
    background-color: color-mix(in oklch, var(--background) 80%, transparent);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.site-header-inner {
    display: flex;
    height: 4rem;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.site-logo-icon {
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    background-color: var(--primary);
    color: var(--primary-foreground);
}

.site-logo-text {
    display: flex;
    flex-direction: column;
}

.site-logo-name {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--foreground);
}

.site-logo-tagline {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ===================================
   Footer Styles
   =================================== */

.site-footer {
    width: 100%;
    border-top: 1px solid var(--border);
    background-color: var(--card);
}

.footer-grid {
    display: grid;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }
}

.footer-brand {
    max-width: 300px;
}

.footer-links-title {
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-links a {
    font-size: 0.875rem;
    color: var(--muted-foreground);
    transition: color 150ms ease;
}

.footer-links a:hover {
    color: var(--foreground);
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.footer-social a:hover {
    color: var(--foreground);
}

/* ===================================
   Hero Section Styles
   =================================== */

.hero-section {
    position: relative;
    width: 100%;
    min-height: 50vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-gradient {
    background: linear-gradient(135deg,
        color-mix(in oklch, var(--primary) 20%, transparent),
        var(--background),
        color-mix(in oklch, var(--accent) 20%, transparent)
    );
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    max-width: 64rem;
    margin: 0 auto;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

@media (min-width: 640px) {
    .hero-title {
        font-size: 3rem;
    }
}

@media (min-width: 768px) {
    .hero-title {
        font-size: 3.75rem;
    }
}

@media (min-width: 1024px) {
    .hero-title {
        font-size: 4.5rem;
    }
}

.hero-subtitle {
    font-size: 1.125rem;
    color: var(--muted-foreground);
    max-width: 42rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

/* Hero blobs */
.hero-blob {
    position: absolute;
    border-radius: 9999px;
    filter: blur(60px);
    opacity: 0.4;
    pointer-events: none;
}

.hero-blob-1 {
    top: -10%;
    left: 5%;
    width: 20rem;
    height: 20rem;
    background: var(--primary);
}

.hero-blob-2 {
    bottom: 0;
    right: 10%;
    width: 24rem;
    height: 24rem;
    background: var(--accent);
}

.hero-blob-3 {
    bottom: 20%;
    left: 30%;
    width: 18rem;
    height: 18rem;
    background: color-mix(in oklch, var(--primary), var(--accent));
}

/* Stats bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    padding: 1rem;
    background: color-mix(in oklch, var(--card) 80%, transparent);
    backdrop-filter: blur(10px);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.stat-item {
    text-align: center;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

@media (min-width: 768px) {
    .stat-value {
        font-size: 2rem;
    }
}

.stat-label {
    font-size: 0.75rem;
    color: var(--muted-foreground);
}

/* ===================================
   Course Card Styles
   =================================== */

.course-card {
    transition: transform 200ms ease, box-shadow 200ms ease;
}

.course-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
}

.course-card-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    width: 100%;
}

.course-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
}

/* Course rating stars */
.star-rating {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.star-filled {
    color: var(--accent);
    fill: var(--accent);
}

/* ===================================
   Video Player Styles
   =================================== */

.video-player {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: var(--radius);
    overflow: hidden;
}

.video-player video,
.video-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    transition: opacity 200ms ease;
}

.video-play-button {
    width: 80px;
    height: 80px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 200ms ease, background 200ms ease;
    border: none;
}

.video-play-button:hover {
    transform: scale(1.1);
    background: white;
}

.video-play-button svg {
    width: 32px;
    height: 32px;
    color: var(--primary);
    margin-left: 4px;
}

/* ===================================
   Progress Components
   =================================== */

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring__circle {
    transition: stroke-dashoffset 350ms ease;
    transform-origin: 50% 50%;
}

/* Lesson progress indicator */
.lesson-item {
    position: relative;
}

.lesson-item::before {
    content: '';
    position: absolute;
    left: 1rem;
    top: 2.5rem;
    bottom: -1rem;
    width: 2px;
    background: var(--border);
}

.lesson-item:last-child::before {
    display: none;
}

.lesson-item.completed::before {
    background: var(--success);
}

/* ===================================
   Exam Styles
   =================================== */

.exam-question {
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border);
}

.exam-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 150ms ease;
    margin-bottom: 0.5rem;
}

.exam-option:hover {
    border-color: var(--primary);
    background: color-mix(in oklch, var(--primary) 5%, transparent);
}

.exam-option.selected {
    border-color: var(--primary);
    background: color-mix(in oklch, var(--primary) 10%, transparent);
}

.exam-option.correct {
    border-color: var(--success);
    background: color-mix(in oklch, var(--success) 10%, transparent);
}

.exam-option.incorrect {
    border-color: var(--destructive);
    background: color-mix(in oklch, var(--destructive) 10%, transparent);
}

/* Timer */
.exam-timer {
    font-variant-numeric: tabular-nums;
}

.exam-timer.warning {
    color: var(--warning);
    animation: pulse 1s infinite;
}

.exam-timer.danger {
    color: var(--destructive);
    animation: pulse 0.5s infinite;
}

/* ===================================
   AI Tutor Chat Styles
   =================================== */

.ai-tutor-button {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 100;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: var(--primary-foreground);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: transform 200ms ease, opacity 200ms ease;
}

.ai-tutor-button:hover {
    transform: scale(1.1);
}

@media (min-width: 768px) {
    .ai-tutor-button {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 4rem;
        height: 4rem;
    }
}

.ai-tutor-chat {
    position: fixed;
    bottom: 5.5rem;
    right: 1rem;
    z-index: 100;
    width: calc(100vw - 2rem);
    max-width: 420px;
    height: 600px;
    max-height: calc(100vh - 8rem);
    border-radius: var(--radius);
    background: var(--card);
    border: 2px solid var(--border);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (min-width: 768px) {
    .ai-tutor-chat {
        bottom: 6rem;
        right: 1.5rem;
    }
}

.ai-tutor-chat.minimized {
    height: 64px;
    width: 320px;
}

.ai-tutor-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: linear-gradient(135deg, color-mix(in oklch, var(--primary) 10%, transparent), color-mix(in oklch, var(--accent) 10%, transparent));
    border-bottom: 1px solid var(--border);
}

.ai-tutor-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-tutor-input {
    padding: 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.ai-tutor-message {
    display: flex;
    gap: 0.75rem;
    animation: fade-in 300ms ease;
}

.ai-tutor-message.user {
    flex-direction: row-reverse;
}

.ai-tutor-message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
}

.ai-tutor-message.assistant .ai-tutor-message-bubble {
    background: var(--muted);
    color: var(--foreground);
    border-top-left-radius: 0.25rem;
}

.ai-tutor-message.user .ai-tutor-message-bubble {
    background: var(--primary);
    color: var(--primary-foreground);
    border-top-right-radius: 0.25rem;
}

/* Sidebar mode */
.ai-tutor-sidebar {
    position: fixed;
    right: 0;
    top: 0;
    bottom: 0;
    width: 100%;
    z-index: 90;
    background: var(--background);
    border-left: 1px solid var(--border);
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .ai-tutor-sidebar {
        width: 33.333%;
    }
}

/* Mobile fullscreen */
@media (max-width: 767px) {
    .ai-tutor-chat-mobile {
        position: fixed;
        inset: 0;
        z-index: 100;
        width: 100%;
        height: 100%;
        max-width: none;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}

/* ===================================
   Search Modal Styles
   =================================== */

.search-modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    width: 100vw;
    height: 100vh;
    background: color-mix(in oklch, var(--background) 95%, transparent);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    animation: fade-in 200ms ease;
}

.search-modal-container {
    width: 100%;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .search-modal-container {
        padding: 4rem 2rem;
    }
}

.search-modal-input {
    width: 100%;
    padding: 1rem 3.5rem;
    font-size: 1.25rem;
    border: 2px solid var(--border);
    border-radius: 1.5rem;
    background: color-mix(in oklch, var(--card) 60%, transparent);
    backdrop-filter: blur(10px);
    color: var(--foreground);
}

@media (min-width: 768px) {
    .search-modal-input {
        padding: 1.5rem 5rem;
        font-size: 2rem;
        border-radius: 2rem;
        font-weight: 500;
    }
}

.search-modal-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in oklch, var(--primary) 20%, transparent);
}

.search-modal-input::placeholder {
    color: var(--muted-foreground);
}

/* ===================================
   Categories Section
   =================================== */

.categories-slider {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc(50% - 8px);
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

@media (min-width: 768px) {
    .categories-slider {
        grid-auto-columns: calc(25% - 12px);
    }
}

.categories-slider > * {
    scroll-snap-align: start;
}

.category-card {
    cursor: pointer;
    transition: all 200ms ease;
}

.category-card:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.category-icon {
    display: flex;
    width: 4rem;
    height: 4rem;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: color-mix(in oklch, var(--primary) 10%, transparent);
    transition: all 200ms ease;
}

.category-card:hover .category-icon {
    background: var(--primary);
    color: var(--primary-foreground);
}

/* ===================================
   Microlearning Section
   =================================== */

.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border-radius: 9999px;
    font-weight: 600;
}

.streak-fire {
    animation: pulse 1s infinite;
}

/* ===================================
   Gamification Section
   =================================== */

.achievement-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 1.5rem;
    background: var(--card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 200ms ease;
}

.achievement-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    width: 4rem;
    height: 4rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.achievement-icon.bronze { background: linear-gradient(135deg, #cd7f32, #8b4513); }
.achievement-icon.silver { background: linear-gradient(135deg, #c0c0c0, #808080); }
.achievement-icon.gold { background: linear-gradient(135deg, #ffd700, #ff8c00); }
.achievement-icon.platinum { background: linear-gradient(135deg, #e5e4e2, #a0a0a0); }

/* ===================================
   Animations
   =================================== */

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoom-in {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

@keyframes heart-beat {
    0%, 100% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.2);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(-25%);
        animation-timing-function: cubic-bezier(0.8, 0, 1, 1);
    }
    50% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0, 0, 0.2, 1);
    }
}

@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Animation Classes */
.animate-fade-in { animation: fade-in 300ms ease; }
.animate-fade-in-up { animation: fade-in-up 600ms ease-out forwards; opacity: 0; }
.animate-slide-up { animation: slide-up 300ms ease-out; }
.animate-blob { animation: blob 7s infinite; }
.animate-heart-beat { animation: heart-beat 600ms ease-in-out; }
.animate-pulse { animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.animate-bounce { animation: bounce 1s infinite; }
.animate-spin { animation: spin 1s linear infinite; }

.animation-delay-2000 { animation-delay: 2s; }
.animation-delay-4000 { animation-delay: 4s; }

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, var(--muted) 25%, var(--border) 50%, var(--muted) 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

/* ===================================
   Layout Utilities
   =================================== */

/* Container */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

.max-w-7xl { max-width: 80rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-2xl { max-width: 42rem; }

/* Flexbox */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-stretch { align-items: stretch; }

.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }

/* Grid */
.grid { display: grid; }

.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (min-width: 640px) {
    .sm\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .sm\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 768px) {
    .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .md\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* Spacing */
.m-0 { margin: 0; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-0 { margin-top: 0; margin-bottom: 0; }

.p-0 { padding: 0; }
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-20 { padding-top: 5rem; padding-bottom: 5rem; }

.pt-0 { padding-top: 0; }
.pb-2 { padding-bottom: 0.5rem; }
.pt-8 { padding-top: 2rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-10 { margin-top: 2.5rem; }
.mt-12 { margin-top: 3rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-10 { margin-bottom: 2.5rem; }

/* Width/Height */
.w-full { width: 100%; }
.h-full { height: 100%; }
.min-h-screen { min-height: 100vh; }

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }
.inset-0 { inset: 0; }
.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

/* Z-index (following the hierarchy from docs) */
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.z-30 { z-index: 30; }
.z-40 { z-index: 40; }
.z-50 { z-index: 50; }
.z-60 { z-index: 60; } /* Course sidebar */
.z-90 { z-index: 90; } /* AI Tutor sidebar */
.z-100 { z-index: 100; } /* AI Tutor floating */

/* Display */
.hidden { display: none; }
.block { display: block; }
.inline { display: inline; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

@media (min-width: 640px) {
    .sm\:hidden { display: none; }
    .sm\:block { display: block; }
    .sm\:flex { display: flex; }
    .sm\:inline-flex { display: inline-flex; }
    .sm\:w-auto { width: auto; }
}

@media (min-width: 768px) {
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .md\:flex { display: flex; }
    .md\:inline-flex { display: inline-flex; }
}

@media (min-width: 1024px) {
    .lg\:hidden { display: none; }
    .lg\:block { display: block; }
    .lg\:flex { display: flex; }
}

/* Overflow */
.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-x-auto { overflow-x: auto; }
.overflow-y-auto { overflow-y: auto; }

/* Aspect ratios */
.aspect-video { aspect-ratio: 16/9; }
.aspect-square { aspect-ratio: 1/1; }

/* Text truncation */
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Text alignment */
.text-left { text-align: left; }
.text-center { text-align: center; }
.text-right { text-align: right; }

/* Scrollbar styling */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: var(--muted);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: var(--muted-foreground);
}

/* Hide scrollbar */
.scrollbar-hide {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
    display: none;
}

/* Categories carousel fade edges */
.cat-fade-left {
    background: linear-gradient(to right, var(--muted) 0%, transparent 100%);
}
.cat-fade-right {
    background: linear-gradient(to left, var(--muted) 0%, transparent 100%);
}
.dark .cat-fade-left {
    background: linear-gradient(to right, var(--muted) 0%, transparent 100%);
}
.dark .cat-fade-right {
    background: linear-gradient(to left, var(--muted) 0%, transparent 100%);
}

/* Grid pattern background */
.bg-grid-pattern {
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 40px 40px;
}

/* ===================================
   Gradients
   =================================== */

.gradient-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.gradient-primary-text {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gradient-hero {
    background: linear-gradient(135deg,
        color-mix(in oklch, var(--primary) 20%, transparent),
        var(--background),
        color-mix(in oklch, var(--accent) 20%, transparent)
    );
}

.gradient-section {
    background: linear-gradient(180deg, var(--background), color-mix(in oklch, var(--muted) 30%, transparent));
}

/* Category gradient colors */
.gradient-purple-pink { background: linear-gradient(135deg, #a855f7, #ec4899); }
.gradient-orange-red { background: linear-gradient(135deg, #f97316, #ef4444); }
.gradient-green-teal { background: linear-gradient(135deg, #22c55e, #14b8a6); }
.gradient-blue-cyan { background: linear-gradient(135deg, #3b82f6, #06b6d4); }
.gradient-yellow-orange { background: linear-gradient(135deg, #eab308, #f97316); }
.gradient-pink-purple { background: linear-gradient(135deg, #ec4899, #a855f7); }
.gradient-indigo-blue { background: linear-gradient(135deg, #6366f1, #3b82f6); }
.gradient-cyan-blue { background: linear-gradient(135deg, #06b6d4, #3b82f6); }

/* ===================================
   Print Styles
   =================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .print-break {
        page-break-before: always;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        background: white;
        color: black;
    }

    a[href]::after {
        content: " (" attr(href) ")";
    }
}

/* ===================================
   WordPress Specific Overrides
   =================================== */

/* Remove WordPress admin bar top margin when logged in */
.admin-bar .site-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .site-header {
        top: 46px;
    }
}

/* Screen reader text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--background);
    border-radius: 3px;
    box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
    clip: auto !important;
    clip-path: none;
    color: var(--foreground);
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Alignments */
.alignwide {
    margin-left: -10%;
    margin-right: -10%;
    max-width: 120%;
}

.alignfull {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    max-width: 100vw;
}

.aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.alignleft {
    float: left;
    margin-right: 1.5rem;
}

.alignright {
    float: right;
    margin-left: 1.5rem;
}
