/* ========================================
   EDUJOURNEY CUSTOM CSS FRAMEWORK
   Modern, Clean, and Professional Design System
   ======================================== */

/* ========================================
   CSS VARIABLES & DESIGN TOKENS
   ======================================== */
   :root {
    /* Color Palette - Modern & Professional */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;
    
    --secondary-50: #f8fafc;
    --secondary-100: #f1f5f9;
    --secondary-200: #e2e8f0;
    --secondary-300: #cbd5e1;
    --secondary-400: #94a3b8;
    --secondary-500: #64748b;
    --secondary-600: #475569;
    --secondary-700: #334155;
    --secondary-800: #1e293b;
    --secondary-900: #0f172a;
    
    --accent-50: #f0f9ff;
    --accent-100: #e0f2fe;
    --accent-200: #bae6fd;
    --accent-300: #7dd3fc;
    --accent-400: #38bdf8;
    --accent-500: #0ea5e9;
    --accent-600: #0284c7;
    --accent-700: #0369a1;
    --accent-800: #075985;
    --accent-900: #0c4a6e;
    
    --success-50: #f0fdf4;
    --success-100: #dcfce7;
    --success-200: #bbf7d0;
    --success-300: #86efac;
    --success-400: #4ade80;
    --success-500: #22c55e;
    --success-600: #16a34a;
    --success-700: #15803d;
    --success-800: #166534;
    --success-900: #14532d;
    
    --warning-50: #fffbeb;
    --warning-100: #fef3c7;
    --warning-200: #fde68a;
    --warning-300: #fcd34d;
    --warning-400: #fbbf24;
    --warning-500: #f59e0b;
    --warning-600: #d97706;
    --warning-700: #b45309;
    --warning-800: #92400e;
    --warning-900: #78350f;
    
    --danger-50: #fef2f2;
    --danger-100: #fee2e2;
    --danger-200: #fecaca;
    --danger-300: #fca5a5;
    --danger-400: #f87171;
    --danger-500: #ef4444;
    --danger-600: #dc2626;
    --danger-700: #b91c1c;
    --danger-800: #991b1b;
    --danger-900: #7f1d1d;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    
    /* Font Sizes */
    --text-xs: 0.75rem;      /* 12px */
    --text-sm: 0.875rem;     /* 14px */
    --text-base: 1rem;       /* 16px */
    --text-lg: 1.125rem;     /* 18px */
    --text-xl: 1.25rem;      /* 20px */
    --text-2xl: 1.5rem;      /* 24px */
    --text-3xl: 1.875rem;    /* 30px */
    --text-4xl: 2.25rem;     /* 36px */
    --text-5xl: 3rem;        /* 48px */
    --text-6xl: 3.75rem;     /* 60px */
    
    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 500;
    --font-semibold: 600;
    --font-bold: 700;
    --font-extrabold: 800;
    
    /* Line Heights */
    --leading-tight: 1.25;
    --leading-snug: 1.375;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --leading-loose: 2;
    
    /* Spacing Scale */
    --space-0: 0;
    --space-1: 0.25rem;      /* 4px */
    --space-2: 0.5rem;       /* 8px */
    --space-3: 0.75rem;      /* 12px */
    --space-4: 1rem;         /* 16px */
    --space-5: 1.25rem;      /* 20px */
    --space-6: 1.5rem;       /* 24px */
    --space-8: 2rem;         /* 32px */
    --space-10: 2.5rem;      /* 40px */
    --space-12: 3rem;        /* 48px */
    --space-16: 4rem;        /* 64px */
    --space-20: 5rem;        /* 80px */
    --space-24: 6rem;        /* 96px */
    --space-32: 8rem;        /* 128px */
    
    /* Border Radius */
    --radius-none: 0;
    --radius-sm: 0.125rem;   /* 2px */
    --radius-base: 0.25rem;  /* 4px */
    --radius-md: 0.375rem;   /* 6px */
    --radius-lg: 0.5rem;     /* 8px */
    --radius-xl: 0.75rem;    /* 12px */
    --radius-2xl: 1rem;      /* 16px */
    --radius-3xl: 1.5rem;    /* 24px */
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-base: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    
    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1520;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
    
    /* Layout */
    --container-max-width: 80rem;
    --header-height: 4rem;
    --sidebar-width: 16rem;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    line-height: var(--leading-normal);
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: var(--leading-normal);
    color: var(--secondary-800);
    background-color: var(--secondary-50);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ========================================
   ARTICLE TYPOGRAPHY (from styling guide)
   ======================================== */
.article-content {
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 1.0625rem;
    line-height: 1.85;
    color: var(--secondary-800);
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    font-weight: 600;
    color: var(--secondary-900);
}

.article-content h2 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.article-content h3 { font-size: 1.25rem; margin: 1.5rem 0 1rem; }
.article-content h4 { font-size: 1.125rem; margin: 1.25rem 0 0.75rem; }

.article-content p { margin-bottom: 1rem; }

.article-content ul,
.article-content ol {
    margin: 0 0 1.25rem 1.5rem;
    list-style-position: outside;
}

.article-content li { margin-bottom: 0.5rem; }

.article-content a {
    color: var(--primary-600);
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.3s;
}

.article-content a:hover { color: var(--primary-700); }

.article-content blockquote {
    background-color: var(--secondary-50);
    border-left: 4px solid var(--primary-600);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: var(--radius-lg);
    font-style: italic;
    color: var(--secondary-700);
}

.article-content img,
.article-content figure img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-lg);
    display: block;
}

.article-content figure { margin: 1.5rem 0; text-align: center; }
.article-content figcaption {
    font-size: 0.875rem;
    color: var(--secondary-600);
    margin-top: 0.5rem;
}

.article-content code {
    background-color: var(--secondary-100);
    padding: 0.15rem 0.35rem;
    border-radius: 4px;
    font-family: 'Fira Code', var(--font-mono);
    font-size: 0.9em;
}

.article-content pre {
    background-color: var(--secondary-900);
    color: #fff;
    padding: 1rem;
    border-radius: var(--radius-lg);
    overflow-x: auto;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.article-content th,
.article-content td {
    border: 1px solid var(--secondary-200);
    padding: 0.75rem 1rem;
    text-align: left;
}

.article-content thead th {
    background-color: var(--secondary-50);
    color: var(--secondary-700);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: var(--leading-tight);
    color: var(--secondary-900);
    margin-bottom: var(--space-4);
}

h1 { font-size: var(--text-4xl); }
h2 { font-size: var(--text-3xl); }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

/* Ensure headings have explicit sizes inside sectioning elements (avoid UA defaults) */
section h1, article h1, nav h1, aside h1 { font-size: var(--text-4xl); }
section h2, article h2, nav h2, aside h2 { font-size: var(--text-3xl); }
section h3, article h3, nav h3, aside h3 { font-size: var(--text-2xl); }
section h4, article h4, nav h4, aside h4 { font-size: var(--text-xl); }
section h5, article h5, nav h5, aside h5 { font-size: var(--text-lg); }
section h6, article h6, nav h6, aside h6 { font-size: var(--text-base); }

p {
    margin-bottom: var(--space-4);
    color: var(--secondary-700);
    line-height: var(--leading-relaxed);
}

a {
    color: var(--primary-600);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

/* ========================================
   LAYOUT UTILITIES
   ======================================== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

@media (min-width: 640px) {
    .container { padding: 0 var(--space-6); }
}

@media (min-width: 1024px) {
    .container { padding: 0 var(--space-8); }
}

/* Flexbox Utilities */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Grid Utilities */
.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)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

/* Grid Column Span Utilities */
.col-span-1 { grid-column: span 1 / span 1; }
.col-span-2 { grid-column: span 2 / span 2; }
.col-span-3 { grid-column: span 3 / span 3; }
.col-span-4 { grid-column: span 4 / span 4; }
.col-span-5 { grid-column: span 5 / span 5; }
.col-span-6 { grid-column: span 6 / span 6; }

/* Display Utilities */
.block { display: block; }
.inline-block { display: inline-block; }
.inline { display: inline; }
.hidden { display: none; }

/* ========================================
   SPACING UTILITIES
   ======================================== */
/* Margin */
.m-0 { margin: var(--space-0); }
.m-1 { margin: var(--space-1); }
.m-2 { margin: var(--space-2); }
.m-3 { margin: var(--space-3); }
.m-4 { margin: var(--space-4); }
.m-6 { margin: var(--space-6); }
.m-8 { margin: var(--space-8); }

.mt-0 { margin-top: var(--space-0); }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mt-8 { margin-top: var(--space-8); }

.mb-0 { margin-bottom: var(--space-0); }
.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }

.ml-0 { margin-left: var(--space-0); }
.ml-1 { margin-left: var(--space-1); }
.ml-2 { margin-left: var(--space-2); }
.ml-3 { margin-left: var(--space-3); }
.ml-4 { margin-left: var(--space-4); }
.ml-6 { margin-left: var(--space-6); }
.ml-8 { margin-left: var(--space-8); }

.mr-0 { margin-right: var(--space-0); }
.mr-1 { margin-right: var(--space-1); }
.mr-2 { margin-right: var(--space-2); }
.mr-3 { margin-right: var(--space-3); }
.mr-4 { margin-right: var(--space-4); }
.mr-6 { margin-right: var(--space-6); }
.mr-8 { margin-right: var(--space-8); }

/* Padding */
.p-0 { padding: var(--space-0); }
.p-1 { padding: var(--space-1); }
.p-2 { padding: var(--space-2); }
.p-3 { padding: var(--space-3); }
.p-4 { padding: var(--space-4); }
.p-6 { padding: var(--space-6); }
.p-8 { padding: var(--space-8); }

.pt-0 { padding-top: var(--space-0); }
.pt-1 { padding-top: var(--space-1); }
.pt-2 { padding-top: var(--space-2); }
.pt-3 { padding-top: var(--space-3); }
.pt-4 { padding-top: var(--space-4); }
.pt-6 { padding-top: var(--space-6); }
.pt-8 { padding-top: var(--space-8); }

.pb-0 { padding-bottom: var(--space-0); }
.pb-1 { padding-bottom: var(--space-1); }
.pb-2 { padding-bottom: var(--space-2); }
.pb-3 { padding-bottom: var(--space-3); }
.pb-4 { padding-bottom: var(--space-4); }
.pb-6 { padding-bottom: var(--space-6); }
.pb-8 { padding-bottom: var(--space-8); }

.pl-0 { padding-left: var(--space-0); }
.pl-1 { padding-left: var(--space-1); }
.pl-2 { padding-left: var(--space-2); }
.pl-3 { padding-left: var(--space-3); }
.pl-4 { padding-left: var(--space-4); }
.pl-6 { padding-left: var(--space-6); }
.pl-8 { padding-left: var(--space-8); }

.pr-0 { padding-right: var(--space-0); }
.pr-1 { padding-right: var(--space-1); }
.pr-2 { padding-right: var(--space-2); }
.pr-3 { padding-right: var(--space-3); }
.pr-4 { padding-right: var(--space-4); }
.pr-6 { padding-right: var(--space-6); }
.pr-8 { padding-right: var(--space-8); }

/* ========================================
   BACKGROUND COLORS
   ======================================== */
.bg-white { background-color: #ffffff; }
.bg-primary { background-color: var(--primary-600); }
.bg-primary-light { background-color: var(--primary-50); }
.bg-secondary { background-color: var(--secondary-600); }
.bg-secondary-light { background-color: var(--secondary-50); }
.bg-accent { background-color: var(--accent-600); }
.bg-accent-light { background-color: var(--accent-50); }
.bg-success { background-color: var(--success-600); }
.bg-success-light { background-color: var(--success-50); }
.bg-warning { background-color: var(--warning-600); }
.bg-warning-light { background-color: var(--warning-50); }
.bg-danger { background-color: var(--danger-600); }
.bg-danger-light { background-color: var(--danger-50); }

/* ========================================
   TEXT COLORS
   ======================================== */
.text-white { color: #ffffff; }
.text-primary { color: var(--primary-600); }
.text-primary-dark { color: var(--primary-800); }
.text-secondary { color: var(--secondary-600); }
.text-secondary-dark { color: var(--secondary-800); }
.text-accent { color: var(--accent-600); }
.text-success { color: var(--success-600); }
.text-warning { color: var(--warning-600); }
.text-danger { color: var(--danger-600); }

/* ========================================
   BORDER RADIUS
   ======================================== */
.rounded-none { border-radius: var(--radius-none); }
.rounded-sm { border-radius: var(--radius-sm); }
.rounded { border-radius: var(--radius-base); }
.rounded-md { border-radius: var(--radius-md); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-2xl { border-radius: var(--radius-2xl); }
.rounded-3xl { border-radius: var(--radius-3xl); }
.rounded-full { border-radius: var(--radius-full); }

/* ========================================
   SHADOWS
   ======================================== */
.shadow-none { box-shadow: none; }
.shadow-xs { box-shadow: var(--shadow-xs); }
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow { box-shadow: var(--shadow-base); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-2xl { box-shadow: var(--shadow-2xl); }

/* ========================================
   COMPONENTS
   ======================================== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: var(--font-semibold);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-base);
    font-size: var(--text-sm);
    line-height: var(--leading-normal);
    white-space: nowrap;
    user-select: none;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--primary-500);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-700), var(--primary-800));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-200);
    color: var(--secondary-800);
    box-shadow: var(--shadow-sm);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--secondary-300);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-600);
    color: var(--primary-600);
}

.btn-outline:hover:not(:disabled) {
    background-color: var(--primary-600);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-600), var(--success-700));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--success-700), var(--success-800));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-warning {
    background: linear-gradient(135deg, var(--warning-600), var(--warning-700));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-warning:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--warning-700), var(--warning-800));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-600), var(--danger-700));
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-danger:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--danger-700), var(--danger-800));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Button Sizes */
.btn-sm {
    padding: var(--space-2) var(--space-4);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--space-4) var(--space-8);
    font-size: var(--text-lg);
}

/* Cards */
.card {
    background-color: white;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    overflow: hidden;
    border: 1px solid var(--secondary-200);
}

.card:hover {
    box-shadow: var(--shadow-xl);
    transform: translateY(-2px);
}

.card-header {
    padding: var(--space-6);
    border-bottom: 1px solid var(--secondary-200);
    background: linear-gradient(135deg, var(--secondary-50), white);
}

.card-body {
    padding: var(--space-6);
}

.card-footer {
    padding: var(--space-6);
    border-top: 1px solid var(--secondary-200);
    background-color: var(--secondary-50);
}

/* Forms */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-weight: var(--font-medium);
    color: var(--secondary-700);
    margin-bottom: var(--space-2);
    font-size: var(--text-sm);
}

.form-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--secondary-300);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    transition: all var(--transition-base);
    background-color: white;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px var(--primary-100);
}

.form-input:disabled {
    background-color: var(--secondary-100);
    cursor: not-allowed;
    opacity: 0.6;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

.form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right var(--space-3) center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: var(--space-10);
}

/* Alerts */
.alert {
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    margin-bottom: var(--space-4);
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.alert-success {
    background-color: var(--success-50);
    border-color: var(--success-200);
    color: var(--success-800);
}

.alert-warning {
    background-color: var(--warning-50);
    border-color: var(--warning-200);
    color: var(--warning-800);
}

.alert-danger {
    background-color: var(--danger-50);
    border-color: var(--danger-200);
    color: var(--danger-800);
}

.alert-info {
    background-color: var(--primary-50);
    border-color: var(--primary-200);
    color: var(--primary-800);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-2);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    background-color: var(--primary-100);
    color: var(--primary-800);
}

.badge-secondary {
    background-color: var(--secondary-100);
    color: var(--secondary-800);
}

.badge-success {
    background-color: var(--success-100);
    color: var(--success-800);
}

.badge-warning {
    background-color: var(--warning-100);
    color: var(--warning-800);
}

.badge-danger {
    background-color: var(--danger-100);
    color: var(--danger-800);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.table th,
.table td {
    padding: var(--space-4);
    text-align: left;
    border-bottom: 1px solid var(--secondary-200);
}

.table th {
    background-color: var(--secondary-50);
    font-weight: var(--font-semibold);
    color: var(--secondary-700);
    font-size: var(--text-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table tbody tr:hover {
    background-color: var(--secondary-50);
}

/* ========================================
   NAVIGATION
   ======================================== */
.navbar {
    background-color: white;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    border-bottom: 1px solid var(--secondary-200);
}

.navbar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.navbar-brand {
    display: flex;
    align-items: center;
    font-weight: var(--font-bold);
    font-size: var(--text-xl);
    color: var(--secondary-900);
    text-decoration: none;
    transition: color var(--transition-base);
}

.navbar-brand:hover {
    color: var(--primary-600);
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.nav-link {
    color: var(--secondary-600);
    text-decoration: none;
    font-weight: var(--font-medium);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
    position: relative;
}

.nav-link:hover {
    color: var(--primary-600);
    background-color: var(--primary-50);
}

.nav-link.active {
    color: var(--primary-600);
    background-color: var(--primary-100);
}

/* Mobile Menu */
.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    padding: var(--space-2);
    color: var(--secondary-600);
    cursor: pointer;
    border-radius: var(--radius-lg);
    transition: all var(--transition-base);
}

.mobile-menu-button:hover {
    background-color: var(--secondary-100);
    color: var(--secondary-800);
}

.mobile-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: white;
    box-shadow: var(--shadow-xl);
    border-top: 1px solid var(--secondary-200);
    z-index: var(--z-dropdown);
}

.mobile-menu.active {
    display: block;
}

.mobile-menu a {
    display: block;
    padding: var(--space-4);
    color: var(--secondary-700);
    text-decoration: none;
    border-bottom: 1px solid var(--secondary-100);
    transition: all var(--transition-base);
}

.mobile-menu a:hover {
    background-color: var(--secondary-50);
    color: var(--primary-600);
}

/* ========================================
   FOOTER
   ======================================== */
.footer {
    background: linear-gradient(135deg, var(--secondary-900), var(--secondary-800));
    color: white;
    margin-top: auto;
}

.footer-content {
    padding: var(--space-16) 0;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: var(--space-8);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--space-4);
    font-size: var(--text-lg);
}

.footer-section h4 {
    color: var(--secondary-300);
    margin-bottom: var(--space-4);
    font-size: var(--text-base);
}

.footer-section p,
.footer-section li {
    color: var(--secondary-400);
    margin-bottom: var(--space-2);
}

.footer-section a {
    color: var(--secondary-400);
    transition: color var(--transition-base);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--secondary-700);
    padding: var(--space-8) 0;
    text-align: center;
}

.footer-bottom p {
    color: var(--secondary-500);
    margin: 0;
}

/* Hide images in footer specifically on blog listing page */
body[data-page="blog-list"] .footer img { display: none !important; }

/* ========================================
   POST HERO & COVER UTILITIES
   ======================================== */
.post-hero {
    position: relative;
    /* Use solid color to avoid gradient repaints that can cause flicker */
    background: var(--primary-900);
    color: #fff;
}
.post-hero .hero-inner { position: relative; padding: 4rem 1rem; text-align: center; }
/* Disable scrim overlay to avoid flicker */
.post-hero .scrim { display: none !important; }
.post-hero h1 { position: relative; z-index: 1; font-weight: 800; letter-spacing: -0.01em; color: #fff; }
.post-hero .meta { position: relative; z-index: 1; opacity: 0.95; color: #fff; }
.post-hero .hero-inner p { position: relative; z-index: 1; color: #fff; }
.post-cover img { aspect-ratio: 16 / 9; object-fit: cover; }
/* Reduce chances of flicker during image paint */
.post-cover img { backface-visibility: hidden; -webkit-font-smoothing: antialiased; transform: translateZ(0); }

/* Reserve space for post cover to avoid layout shifts/flicker */
.post-cover { position: relative; background: #fff; }
.post-cover::before { content: ""; display: block; padding-bottom: 56.25%; }
.post-cover picture, .post-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Ad slot debug outline */
.ad-slot-debug {
    outline: 2px dashed var(--danger-500);
    outline-offset: -6px;
    background: repeating-linear-gradient(45deg, rgba(239, 68, 68, 0.06), rgba(239, 68, 68, 0.06) 10px, rgba(239, 68, 68, 0.12) 10px, rgba(239, 68, 68, 0.12) 20px);
}

/* Side ads for laptop and larger screens (keeps main content width intact) */
.ad-side {
    display: none;
    position: fixed;
    top: 33vh;
    z-index: var(--z-sticky);
}

/* Ensure main content is centered and not blocked by sidebar ads */
@media (min-width: 1024px) {
    .container {
        max-width: var(--container-max-width);
        margin: 0 auto;
        padding: 0 var(--space-8);
    }
    
    /* Add some margin to prevent content from being too close to ads */
    .container .grid {
        margin: 0 auto;
    }
}

/* Reduced size for better content visibility */
.ad-side .ad-box {
    width: 250px;
    min-height: 500px; /* Reduced height for better fit */
    background: white;
    border: 1px solid var(--secondary-200);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-3);
}

@media (min-width: 1024px) {
    .ad-side { display: block; }
    /* Place ads outside the max container width on both sides with reduced spacing */
    .ad-side-left {
        left: max(10px, calc((100vw - var(--container-max-width)) / 2 - 270px));
    }
    .ad-side-right {
        right: max(10px, calc((100vw - var(--container-max-width)) / 2 - 270px));
    }
}

/* For very wide screens, ensure ads don't get too far from content */
@media (min-width: 1600px) {
    .ad-side-left {
        left: calc((100vw - var(--container-max-width)) / 2 - 270px);
    }
    .ad-side-right {
        right: calc((100vw - var(--container-max-width)) / 2 - 270px);
    }
}

/* Inline ad sizing (Google preferred sizes) */
.ad-inline {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px; /* Mobile banner default */
}

/* 728x90 Leaderboard at >= 1024px */
@media (min-width: 1024px) {
    .ad-inline.ad-728x90, .ad-inline.ad-970x250 {
        min-height: 90px;
    }
    .ad-inline.ad-728x90 > .ad-inner, .ad-inline.ad-970x250 > .ad-inner {
        max-width: 728px;
        width: 100%;
        height: 90px;
    }
}

/* 970x250 Billboard at >= 1440px */
@media (min-width: 1440px) {
    .ad-inline.ad-970x250 {
        min-height: 250px;
    }
    .ad-inline.ad-970x250 > .ad-inner {
        max-width: 970px;
        width: 100%;
        height: 250px;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-semibold { font-weight: var(--font-semibold); }
.font-bold { font-weight: var(--font-bold); }
.font-extrabold { font-weight: var(--font-extrabold); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.w-auto { width: auto; }
.h-auto { height: auto; }

.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

.top-0 { top: 0; }
.right-0 { right: 0; }
.bottom-0 { bottom: 0; }
.left-0 { left: 0; }

.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; }

.overflow-hidden { overflow: hidden; }
.overflow-auto { overflow: auto; }
.overflow-scroll { overflow: scroll; }

.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

.select-none { user-select: none; }
.select-text { user-select: text; }

.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }
.transition-slow { transition: all var(--transition-slow); }

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.animate-slide-up {
    animation: slideInUp 0.3s ease-out;
}

.animate-slide-down {
    animation: slideInDown 0.3s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@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)); }
    .sm\:flex { display: flex; }
    .sm\:hidden { display: none; }
}

@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)); }
    .md\:flex { display: flex; }
    .md\:hidden { display: none; }
    .md\:block { display: block; }
    .footer-grid { 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-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .lg\:col-span-1 { grid-column: span 1 / span 1; }
    .lg\:col-span-2 { grid-column: span 2 / span 2; }
    .lg\:col-span-3 { grid-column: span 3 / span 3; }
    .lg\:col-span-4 { grid-column: span 4 / span 4; }
    .lg\:col-span-5 { grid-column: span 5 / span 5; }
    .lg\:col-span-6 { grid-column: span 6 / span 6; }
    .lg\:flex { display: flex; }
    .lg\:hidden { display: none; }
}

/* Desktop Navigation - Show on laptop and desktop */
.desktop-nav {
    display: flex;
    align-items: center;
    gap: var(--space-6);
}

.desktop-right-nav {
    display: flex;
}

@media (max-width: 1023px) {
    .mobile-menu-button {
        display: block;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .desktop-right-nav {
        display: none;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 var(--space-4);
    }
    .article-content h2 { font-size: 1.25rem; }
    .article-content pre { font-size: 0.875rem; }
}

/* ========================================
   ADDITIONAL UTILITIES
   ======================================== */

/* Size utilities */
.w-5 { width: 1.25rem; }
.h-5 { height: 1.25rem; }
.w-6 { width: 1.5rem; }
.h-6 { height: 1.5rem; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }
.w-8 { width: 2rem; }
.h-8 { height: 2rem; }
.w-10 { width: 2.5rem; }
.h-10 { height: 2.5rem; }
.w-12 { width: 3rem; }
.h-12 { height: 3rem; }
.w-16 { width: 4rem; }
.h-16 { height: 4rem; }
.w-20 { width: 5rem; }
.h-20 { height: 5rem; }

/* Spacing utilities */
.space-x-4 > * + * { margin-left: var(--space-4); }
.space-x-6 > * + * { margin-left: var(--space-6); }
.space-y-4 > * + * { margin-top: var(--space-4); }
.space-y-6 > * + * { margin-top: var(--space-6); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }
.gap-12 { gap: var(--space-12); }

/* Text color utilities */
.text-white\/90 { color: rgba(255, 255, 255, 0.9); }
.text-white\/80 { color: rgba(255, 255, 255, 0.8); }
.text-yellow-400 { color: #fbbf24; }
.text-green-400 { color: #4ade80; }
.text-pink-400 { color: #f472b6; }

/* Text shadow utilities */
.drop-shadow-sm { text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1); }
.drop-shadow { text-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); }
.drop-shadow-md { text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3); }
.drop-shadow-lg { text-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); }

/* Background utilities */
.bg-white\/10 { background-color: rgba(255, 255, 255, 0.1); }
.bg-white\/20 { background-color: rgba(255, 255, 255, 0.2); }
.bg-white\/40 { background-color: rgba(255, 255, 255, 0.4); }
.bg-white\/80 { background-color: rgba(255, 255, 255, 0.8); }
.border-white\/20 { border-color: rgba(255, 255, 255, 0.2); }
.border-white\/40 { border-color: rgba(255, 255, 255, 0.4); }
.backdrop-blur-sm { backdrop-filter: blur(4px); }

/* Hero section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-50), var(--primary-100), var(--accent-50));
    color: var(--secondary-900);
    padding: 5rem 0;
    position: relative;
    min-height: 60vh;
}

/* Section padding */
.section-padding {
    padding: 5rem 0;
}

/* Card hover effect */
.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-2xl);
}

/* Button gradient */
.btn-gradient {
    background: linear-gradient(135deg, white, var(--secondary-100));
    color: var(--primary-600);
    font-weight: var(--font-semibold);
    padding: var(--space-4) var(--space-8);
    border-radius: var(--radius-lg);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--secondary-100), var(--secondary-200));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Footer styles */
.footer {
    background: linear-gradient(135deg, var(--secondary-800), var(--secondary-900));
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    margin-bottom: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h3 {
    color: white;
    font-size: var(--text-xl);
    font-weight: var(--font-bold);
    margin-bottom: var(--space-4);
}

.footer-section h4 {
    color: white;
    font-size: var(--text-lg);
    font-weight: var(--font-semibold);
    margin-bottom: var(--space-3);
}

.footer-section p {
    color: var(--secondary-300);
    line-height: var(--line-height-relaxed);
}

.footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-section ul li {
    margin-bottom: var(--space-2);
}

.footer-section ul li a {
    color: var(--secondary-300);
    text-decoration: none;
    transition: color var(--transition-base);
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--secondary-700);
    padding-top: var(--space-6);
    text-align: center;
}

.footer-bottom p {
    color: var(--secondary-400);
    font-size: var(--text-sm);
    margin: 0;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.line-clamp-1 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.line-clamp-2 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-line-clamp: 2;
}

.line-clamp-3 {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-line-clamp: 3;
}

/* Aspect Ratio Utilities */
.aspect-w-16 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
}

.aspect-h-9 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Blog thumbnail aspect ratio */
.aspect-w-16.aspect-h-9 {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    overflow: hidden;
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.aspect-w-16.aspect-h-9 > * {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Ensure thumbnails are visible */
.aspect-w-16.aspect-h-9 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-base);
}

.aspect-w-16.aspect-h-9:hover img {
    transform: scale(1.05);
}

/* Default thumbnail styling */
.blog-thumbnail-default {
    /* Edge fallback color before gradient */
    background-color: #eaf2ff;
    background: linear-gradient(135deg, var(--primary-100), var(--accent-100));
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    /* subtle border to ensure visibility on light backgrounds */
    border: 1px solid rgba(0,0,0,0.05);
}

/* Ensure aspect container shows a neutral bg even without image */
.aspect-w-16.aspect-h-9 {
    background-color: #f5f7fb;
    display: block;
}

/* Cross-browser SVG icon fallback (Edge) */
.icon, .svg-icon {
    display: inline-block;
    vertical-align: middle;
    stroke: currentColor;
    fill: none;
}

.blog-thumbnail-default::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.blog-thumbnail-icon {
    width: 4rem;
    height: 4rem;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
}

.blog-thumbnail-title {
    color: white;
    font-weight: 600;
    text-align: center;
    line-height: 1.3;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.blog-thumbnail-category {
    background: white;
    color: var(--primary-600);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    box-shadow: var(--shadow-sm);
}

/* ========================================
   PAGINATION STYLES
   ======================================== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .pagination-container {
        gap: 0.375rem;
    }
}
.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-700);
    background-color: white;
    border: 1px solid var(--secondary-300);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    min-width: 2.5rem;
    justify-content: center;
}

.pagination-btn:hover:not(.pagination-btn-disabled) {
    background-color: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-btn-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--secondary-100);
    color: var(--secondary-400);
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--secondary-700);
    background-color: white;
    border: 1px solid var(--secondary-300);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.pagination-number:hover {
    background-color: var(--primary-50);
    border-color: var(--primary-300);
    color: var(--primary-700);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.pagination-number-active {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    color: white;
    border-color: var(--primary-600);
    box-shadow: var(--shadow-lg);
    transform: scale(1.05);
}

.pagination-number-active:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--accent-700));
    transform: scale(1.05);
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.875rem;
    color: var(--secondary-400);
    font-weight: 500;
}

/* Responsive pagination */
@media (max-width: 640px) {
    .pagination-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
    
    .pagination-number {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
    
    .pagination-ellipsis {
        width: 2rem;
        height: 2rem;
        font-size: 0.75rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */
@media print {
    .no-print { display: none !important; }

    body {
        background: white !important;
        color: black !important;
    }

    .card {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }

    .btn {
        border: 1px solid #ccc !important;
        background: white !important;
        color: black !important;
    }
}

/* ========================================
   CUSTOM COMPONENTS
   ======================================== */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-50), var(--accent-50));
    padding: var(--space-20) 0;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="%23e2e8f0" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.section-padding {
    padding: var(--space-16) 0;
}

.card-hover {
    transition: all var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.btn-gradient {
    background: linear-gradient(135deg, var(--primary-600), var(--accent-600));
    color: white;
    border: none;
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-semibold);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}

.btn-gradient:hover {
    background: linear-gradient(135deg, var(--primary-700), var(--accent-700));
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   COMPATIBILITY UTILITIES (Tailwind-like aliases used in templates)
   Keep this minimal and only map what's actually used.
   ======================================== */
/* Text color aliases */
.text-gray-500 { color: var(--secondary-500); }
.text-gray-600 { color: var(--secondary-600); }
.text-gray-700 { color: var(--secondary-700); }
.text-gray-900 { color: var(--secondary-900); }
.text-blue-600 { color: var(--primary-600); }
.text-blue-800 { color: var(--primary-800); }

/* Background color aliases */
.bg-blue-50 { background-color: var(--primary-50); }

/* Border color aliases */
.border-gray-200 { border-color: var(--secondary-200); }
.border-gray-300 { border-color: var(--secondary-300); }
.border-blue-300 { border-color: var(--primary-300); }

/* Simple gaps */
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }

/* Transitions */
.transition-all { transition: all var(--transition-base); }
.duration-200 { transition-duration: 200ms; }

/* Gradient helper */
.bg-gradient-to-r { background-image: linear-gradient(90deg, var(--primary-500), var(--accent-600)); color: #fff; }

/* Hover helpers */
.hover\:bg-gray-50:hover { background-color: var(--secondary-50); }
.hover\:border-gray-400:hover { border-color: var(--secondary-400); }
.hover\:-translate-y-1:hover { transform: translateY(-0.25rem); }
.hover\:scale-105:hover { transform: scale(1.05); }

/* ========================================
   ACCESSIBILITY
   ======================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.focus\:outline-none:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.focus\:ring-2:focus {
    box-shadow: 0 0 0 2px var(--primary-500);
}

/* ========================================
   DARK MODE SUPPORT
   ======================================== */
:root {
    /* Light mode colors (default) */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    /* Dark mode colors */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #475569;
    --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Dark mode specific styles */
[data-theme="dark"] body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
}

[data-theme="dark"] .bg-white {
    background-color: var(--bg-secondary) !important;
}

[data-theme="dark"] .bg-secondary-light {
    background-color: var(--bg-tertiary) !important;
}

[data-theme="dark"] .text-secondary-900 {
    color: var(--text-primary) !important;
}

[data-theme="dark"] .text-secondary-700 {
    color: var(--text-secondary) !important;
}

[data-theme="dark"] .text-secondary-600 {
    color: var(--text-muted) !important;
}

[data-theme="dark"] .border-gray-200 {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .shadow-lg {
    box-shadow: 0 10px 15px -3px var(--shadow-color), 0 4px 6px -2px var(--shadow-color) !important;
}

[data-theme="dark"] .card {
    background-color: var(--bg-secondary);
    border-color: var(--border-color);
}

[data-theme="dark"] .form-input {
    background-color: var(--bg-tertiary);
    border-color: var(--border-color);
    color: var(--text-primary);
}

[data-theme="dark"] .form-input:focus {
    border-color: var(--primary-500);
    background-color: var(--bg-secondary);
}

[data-theme="dark"] .navbar {
    background-color: var(--bg-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .mobile-menu {
    background-color: var(--bg-secondary);
    border-top-color: var(--border-color);
}

[data-theme="dark"] .mobile-menu a {
    color: var(--text-secondary);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .mobile-menu a:hover {
    background-color: var(--bg-tertiary);
    color: var(--primary-600);
}

[data-theme="dark"] .footer {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
}

[data-theme="dark"] .article-content {
    color: var(--text-secondary);
}

[data-theme="dark"] .article-content h1,
[data-theme="dark"] .article-content h2,
[data-theme="dark"] .article-content h3,
[data-theme="dark"] .article-content h4 {
    color: var(--text-primary);
}

[data-theme="dark"] .article-content blockquote {
    background-color: var(--bg-tertiary);
    border-left-color: var(--primary-600);
    color: var(--text-secondary);
}

[data-theme="dark"] .article-content code {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .article-content pre {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .article-content table th,
[data-theme="dark"] .article-content table td {
    border-color: var(--border-color);
}

[data-theme="dark"] .article-content thead th {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* Dark mode toggle button */
.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.dark-mode-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

[data-theme="dark"] .dark-mode-toggle {
    color: var(--text-secondary);
}

[data-theme="dark"] .dark-mode-toggle:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

/* Smooth transitions for theme changes */
* {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

/* Override transitions for specific elements that shouldn't animate */
.dark-mode-toggle,
.dark-mode-toggle * {
    transition: none;
}