/* ============================================
   BLOG UNIFIED STYLE SYSTEM v1.0
   Slate & Teal Theme with Dark Mode Support
   ============================================ */

/* ============================================
   CSS VARIABLES - Theme Configuration
   ============================================ */

:root {
    /* Primary Colors - Teal */
    --primary: #0d9488;
    --primary-hover: #0f766e;
    --primary-light: #ccfbf1;
    --primary-lighter: #f0fdfa;

    /* Secondary Accents */
    --accent-emerald: #10b981;
    --accent-emerald-hover: #059669;
    --accent-gold: #D4AF37;
    --accent-purple: #8b5cf6;
    --accent-blue: #3b82f6;

    /* Alert/Info Colors */
    --alert-info-bg: #eff6ff;
    --alert-info-border: #3b82f6;
    --alert-info-text: #1e40af;

    --alert-success-bg: #ecfdf5;
    --alert-success-border: var(--accent-emerald);
    --alert-success-text: #065f46;

    --alert-warning-bg: #fef3c7;
    --alert-warning-border: #f59e0b;
    --alert-warning-text: #92400e;

    --alert-error-bg: #fef2f2;
    --alert-error-border: #ef4444;
    --alert-error-text: #dc2626;

    /* Additional utility colors */
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --gray-400: #d1d5db;

    /* Browser UI colors */
    --browser-dot-red: #f87171;
    --browser-dot-yellow: #fbbf24;

    /* Background Colors - Light Mode */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --bg-code: #1e293b;
    --bg-code-dark: #0f172a;

    /* Text Colors - Light Mode */
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --text-light: #f1f5f9;
    --text-code: #e2e8f0;

    /* Border & UI Colors */
    --border-color: #e2e8f0;
    --divider-color: #f1f5f9;
    --border-focus: var(--primary);

    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-arabic: 'Amiri', serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
    --font-serif: 'Lora', serif;

    /* Font Sizes */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;

    /* Font Weights */
    --font-light: 300;
    --font-normal: 400;
    --font-medium: 600;
    --font-bold: 700;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, #14b8a6 100%);
    --gradient-purple: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    --gradient-gold: linear-gradient(135deg, #D4AF37 0%, #F4D03F 100%);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-base: 300ms ease;
    --transition-slow: 500ms ease;
}

/* Dark Mode Variables */
.dark {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-code: #0f172a;
    --bg-code-dark: #020617;

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --text-code: #e2e8f0;

    --border-color: #334155;
    --divider-color: #1e293b;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

/* ============================================
   RESET & BASE STYLES
   ============================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    font-weight: var(--font-normal);
    line-height: 1.75;
    letter-spacing: 0.01em;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-base), color var(--transition-base);
}

/* Focus Styles */
:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

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

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

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 4px;
    transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-weight: var(--font-bold);
    line-height: 1.25;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

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); }

/* Paragraph */
p {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

/* Links */
a {
    color: var(--primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Text Utilities */
.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); }

.font-light { font-weight: var(--font-light); }
.font-normal { font-weight: var(--font-normal); }
.font-medium { font-weight: var(--font-medium); }
.font-bold { font-weight: var(--font-bold); }

.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.text-primary-color { color: var(--primary); }
.text-emerald { color: var(--accent-emerald); }
.text-gold { color: var(--accent-gold); }

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

.uppercase { text-transform: uppercase; }
.capitalize { text-transform: capitalize; }
.italic { font-style: italic; }

.tracking-wide { letter-spacing: 0.025em; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Arabic Text */
.text-arabic {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    line-height: 2.5;
    direction: rtl;
    text-align: right;
}

/* Serif Text */
.text-serif {
    font-family: var(--font-serif);
}

/* Monospace Text */
.text-mono, code, pre {
    font-family: var(--font-mono);
}

/* ============================================
   LAYOUT COMPONENTS
   ============================================ */

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.container-narrow {
    max-width: 800px;
}

.container-wide {
    max-width: 1400px;
}

/* Section */
.section {
    padding: var(--spacing-2xl) 0;
}

.section-sm {
    padding: var(--spacing-xl) 0;
}

.section-lg {
    padding: var(--spacing-3xl) 0;
}

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

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

.gap-sm { gap: var(--spacing-sm); }
.gap-md { gap: var(--spacing-md); }
.gap-lg { gap: var(--spacing-lg); }
.gap-xl { gap: var(--spacing-xl); }

/* Flex */
.flex { display: flex; }
.inline-flex { display: inline-flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }

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

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

.flex-grow-1 { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

/* ============================================
   CARDS
   ============================================ */

.card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.card-hover:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.card-bordered {
    border: 2px solid var(--border-color);
}

.card-flat {
    box-shadow: none;
    border: none;
}

.card-compact {
    padding: var(--spacing-md);
}

.card-spacious {
    padding: var(--spacing-2xl);
}

/* Card Variants */
.card-primary {
    border-left: 4px solid var(--primary);
}

.card-emerald {
    border-left: 4px solid var(--accent-emerald);
}

.card-gold {
    border-left: 4px solid var(--accent-gold);
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    font-family: var(--font-sans);
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
    user-select: none;
}

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

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Button Sizes */
.btn-sm {
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: var(--text-xs);
}

.btn-lg {
    padding: var(--spacing-md) var(--spacing-xl);
    font-size: var(--text-base);
}

.btn-xl {
    padding: var(--spacing-lg) var(--spacing-2xl);
    font-size: var(--text-lg);
}

/* Button Variants */
.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
    background-color: var(--border-color);
}

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

.btn-ghost:hover:not(:disabled) {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-emerald {
    background-color: var(--accent-emerald);
    color: white;
}

.btn-emerald:hover:not(:disabled) {
    background-color: var(--accent-emerald-hover);
}

/* Full Width Button */
.btn-full {
    width: 100%;
}

/* Rounded Button */
.btn-pill {
    border-radius: var(--radius-full);
}

/* ============================================
   FORM ELEMENTS
   ============================================ */

/* Input */
.input, .select, .textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-base);
    font-family: var(--font-sans);
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}

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

/* Textarea */
.textarea {
    min-height: 100px;
    resize: vertical;
}

/* Select */
.select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6,9 12,15 18,9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--spacing-md) center;
    padding-right: var(--spacing-2xl);
}

/* Label */
.label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
}

/* ============================================
   CODE & TERMINAL
   ============================================ */

/* Inline Code */
code, .code-inline {
    font-family: var(--font-mono);
    font-size: 0.875em;
    padding: 0.125rem 0.375rem;
    background-color: var(--bg-tertiary);
    color: var(--accent-emerald);
    border-radius: var(--radius-sm);
}

/* Code Block */
.code-block, pre {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    padding: var(--spacing-md);
    background-color: var(--bg-code);
    color: var(--text-code);
    border-radius: var(--radius-md);
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

/* Terminal Style */
.terminal {
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    padding: var(--spacing-lg);
    background-color: var(--bg-code-dark);
    color: var(--text-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow-x: auto;
    position: relative;
}

.terminal-prompt {
    color: var(--accent-emerald);
    margin-right: var(--spacing-sm);
}

.terminal-command {
    color: var(--text-light);
}

/* Copy Button for Code */
.copy-btn {
    position: absolute;
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.copy-btn:hover {
    background-color: var(--border-color);
    color: var(--text-primary);
}

/* ============================================
   NAVIGATION
   ============================================ */

/* Nav Link */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-fast);
}

.nav-link:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link-active {
    background-color: var(--primary-lighter);
    color: var(--primary);
    border-left: 3px solid var(--primary);
}

/* Sidebar Navigation */
.nav-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.nav-sidebar .nav-link {
    width: 100%;
    justify-content: flex-start;
}

/* Horizontal Navigation */
.nav-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

/* ============================================
   BADGES & TAGS
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: var(--spacing-xs) var(--spacing-sm);
    font-size: var(--text-xs);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
}

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

.badge-emerald {
    background-color: var(--alert-success-bg);
    color: var(--alert-success-text);
}

.badge-gold {
    background-color: var(--alert-warning-bg);
    color: var(--alert-warning-text);
}

.badge-purple {
    background-color: #ede9fe;
    color: #5b21b6;
}

.badge-gray {
    background-color: var(--bg-tertiary);
    color: var(--text-secondary);
}

/* ============================================
   ALERTS & NOTIFICATIONS
   ============================================ */

.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.alert-info {
    background-color: var(--alert-info-bg);
    border-color: var(--alert-info-border);
    color: var(--alert-info-text);
}

.alert-success {
    background-color: var(--alert-success-bg);
    border-color: var(--alert-success-border);
    color: var(--alert-success-text);
}

.alert-warning {
    background-color: var(--alert-warning-bg);
    border-color: var(--alert-warning-border);
    color: var(--alert-warning-text);
}

.alert-error {
    background-color: var(--alert-error-bg);
    border-color: var(--alert-error-border);
    color: var(--alert-error-text);
}

/* Dark mode alerts */
.dark .alert-info { background-color: #1e3a5f; color: #93c5fd; }
.dark .alert-success { background-color: #064e3b; color: #6ee7b7; }
.dark .alert-warning { background-color: #78350f; color: #fcd34d; }
.dark .alert-error { background-color: #7f1d1d; color: #fca5a5; }

/* Toast Notification */
.toast {
    position: fixed;
    bottom: var(--spacing-xl);
    right: var(--spacing-xl);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--bg-code);
    color: var(--text-light);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    border-left: 4px solid var(--accent-emerald);
    z-index: 1000;
    transform: translateY(150%);
    transition: transform var(--transition-base);
}

.toast.show {
    transform: translateY(0);
}

/* ============================================
   DIVIDERS & SPACERS
   ============================================ */

.divider {
    height: 1px;
    background-color: var(--divider-color);
    margin: var(--spacing-lg) 0;
}

.divider-vertical {
    width: 1px;
    height: auto;
    background-color: var(--divider-color);
    margin: 0 var(--spacing-lg);
}

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

/* Margin Top */
.mt-0 { margin-top: 0; }
.mt-xs { margin-top: var(--spacing-xs); }
.mt-sm { margin-top: var(--spacing-sm); }
.mt-md { margin-top: var(--spacing-md); }
.mt-lg { margin-top: var(--spacing-lg); }
.mt-xl { margin-top: var(--spacing-xl); }

/* Margin Bottom */
.mb-0 { margin-bottom: 0; }
.mb-xs { margin-bottom: var(--spacing-xs); }
.mb-sm { margin-bottom: var(--spacing-sm); }
.mb-md { margin-bottom: var(--spacing-md); }
.mb-lg { margin-bottom: var(--spacing-lg); }
.mb-xl { margin-bottom: var(--spacing-xl); }

/* Margin Left/Right */
.mx-sm { margin-left: var(--spacing-sm); margin-right: var(--spacing-sm); }
.mx-md { margin-left: var(--spacing-md); margin-right: var(--spacing-md); }

/* Margin Top/Bottom */
.my-sm { margin-top: var(--spacing-sm); margin-bottom: var(--spacing-sm); }
.my-md { margin-top: var(--spacing-md); margin-bottom: var(--spacing-md); }
.my-lg { margin-top: var(--spacing-lg); margin-bottom: var(--spacing-lg); }

/* Spacers - Padding */
.p-0 { padding: 0; }
.p-xs { padding: var(--spacing-xs); }
.p-sm { padding: var(--spacing-sm); }
.p-md { padding: var(--spacing-md); }
.p-lg { padding: var(--spacing-lg); }
.p-xl { padding: var(--spacing-xl); }

/* Padding X (left/right) */
.px-0 { padding-left: 0; padding-right: 0; }
.px-xs { padding-left: var(--spacing-xs); padding-right: var(--spacing-xs); }
.px-sm { padding-left: var(--spacing-sm); padding-right: var(--spacing-sm); }
.px-md { padding-left: var(--spacing-md); padding-right: var(--spacing-md); }
.px-lg { padding-left: var(--spacing-lg); padding-right: var(--spacing-lg); }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }

/* Padding Y (top/bottom) */
.py-0 { padding-top: 0; padding-bottom: 0; }
.py-xs { padding-top: var(--spacing-xs); padding-bottom: var(--spacing-xs); }
.py-sm { padding-top: var(--spacing-sm); padding-bottom: var(--spacing-sm); }
.py-md { padding-top: var(--spacing-md); padding-bottom: var(--spacing-md); }
.py-lg { padding-top: var(--spacing-lg); padding-bottom: var(--spacing-lg); }
.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; }

/* Gap Utilities */
.gap-0 { gap: 0; }
.gap-xs { gap: var(--spacing-xs); }
.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; }

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

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

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

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

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

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

.fade-in-up {
    animation: fadeInUp 0.4s ease-out;
}

.slide-down {
    animation: slideDown 0.3s ease-out;
}

.pulse {
    animation: pulse 2s ease-in-out infinite;
}

/* Loading Skeleton */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-tertiary) 25%,
        var(--bg-secondary) 50%,
        var(--bg-tertiary) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

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

/* Position */
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.sticky { position: sticky; }

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

/* Width */
.w-full { width: 100%; }
.w-auto { width: auto; }
.w-fit { width: fit-content; }
.w-1\/2 { width: 50%; }
.w-1\/3 { width: 33.333%; }
.w-2\/3 { width: 66.666%; }
.w-1\/4 { width: 25%; }

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

/* Max Width */
.max-w-xs { max-width: 20rem; }
.max-w-sm { max-width: 24rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }
.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.max-w-6xl { max-width: 72rem; }
.max-w-full { max-width: 100%; }

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

/* Cursor */
.cursor-pointer { cursor: pointer; }
.cursor-not-allowed { cursor: not-allowed; }

/* User Select */
.select-none { user-select: none; }
.select-all { user-select: all; }

/* Opacity */
.opacity-0 { opacity: 0; }
.opacity-50 { opacity: 0.5; }
.opacity-100 { opacity: 1; }

/* Transition */
.transition { transition: all var(--transition-base); }
.transition-fast { transition: all var(--transition-fast); }

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */

@media (max-width: 768px) {
    /* Hide on mobile */
    .hide-mobile { display: none !important; }

    /* Show only on mobile */
    .show-mobile { display: block !important; }

    /* Responsive spacing */
    .section { padding: var(--spacing-lg) 0; }

    /* Responsive grid */
    .grid-cols-2, .grid-cols-3, .grid-cols-4 {
        grid-template-columns: 1fr;
    }

    /* Responsive nav */
    .nav-horizontal {
        flex-direction: column;
    }

    .nav-link {
        width: 100%;
    }
}

@media (min-width: 769px) {
    /* Hide on desktop */
    .hide-desktop { display: none !important; }

    /* Show only on desktop */
    .show-desktop { display: block !important; }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    body {
        background-color: white;
        color: black;
    }

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

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

/* ============================================
   BACKGROUND UTILITIES
   ============================================ */

.bg-white { background-color: #ffffff; }
.bg-primary { background-color: var(--primary); }
.bg-primary-light { background-color: var(--primary-lighter); }
.bg-slate-50 { background-color: #f8fafc; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-transparent { background-color: transparent; }
.bg-current { background-color: currentColor; }

/* Border Radius Utilities */
.rounded-none { border-radius: 0; }
.rounded-sm { border-radius: var(--radius-sm); }
.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-full { border-radius: var(--radius-full); }

/* Shadow Utilities */
.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }
.shadow-none { box-shadow: none; }

/* Responsive Container */
.container-center {
    max-width: 56rem;
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--spacing-md);
    padding-right: var(--spacing-md);
}

/* ============================================
   DARK MODE SPECIFIC OVERRIDES
   ============================================ */

.dark .bg-white {
    background-color: var(--bg-secondary) !important;
}

.dark code, .dark .code-inline {
    background-color: var(--bg-tertiary);
    color: var(--accent-emerald);
}

.dark .badge-primary {
    background-color: rgba(13, 148, 136, 0.2);
    color: #2dd4bf;
}

.dark .badge-emerald {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.dark .badge-gold {
    background-color: rgba(212, 175, 55, 0.2);
    color: #fbbf24;
}

.dark .badge-purple {
    background-color: rgba(139, 92, 246, 0.2);
    color: #a78bfa;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Skip Link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--primary);
    color: white;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --border-color: var(--text-primary);
    }
}

/* ============================================
   THEME TOGGLE COMPONENT
   ============================================ */

.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
}

.theme-toggle:hover {
    background-color: var(--primary);
    border-color: var(--primary);
}

.theme-toggle .theme-icon {
    font-size: 1.25rem;
    line-height: 1;
}

/* ============================================
   PROGRESS BAR (Reading Indicator)
   ============================================ */

.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: var(--gradient-primary);
    width: 0%;
    z-index: 1000;
    transition: width 0.1s ease;
}

/* ============================================
   END OF STYLES
   ============================================ */
