/* ============================================
   BeGeorgian Design Tokens
   Single source of truth for all design values
   ============================================ */

:root {
    /* === Brand Colors === */
    --color-primary: #DC2626;
    --color-primary-hover: #B91C1C;
    --color-primary-dark: #991B1B;
    --color-primary-light: #FEE2E2;

    --color-secondary: #475569;
    --color-accent: #F59E0B;

    /* === Subject Colors === */
    --color-history: #DC2626;
    --color-history-dark: #991B1B;
    --color-law: #059669;
    --color-law-dark: #047857;
    --color-grammar: #7C3AED;
    --color-grammar-dark: #5B21B6;

    /* === Semantic Colors === */
    --color-success: #10B981;
    --color-success-light: #D1FAE5;
    --color-error: #EF4444;
    --color-error-light: #FEE2E2;
    --color-warning: #F59E0B;
    --color-warning-light: #FEF3C7;
    --color-info: #3B82F6;
    --color-info-light: #DBEAFE;

    /* === Neutrals === */
    --color-bg: #FAFAFA;
    --color-bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --color-surface: #FFFFFF;
    --color-border: #E5E7EB;
    --color-border-light: #F1F5F9;

    /* === Text === */
    --color-text-1: #0F172A;
    --color-text-2: #64748B;
    --color-text-3: #94A3B8;

    /* === Typography === */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-georgian: 'Noto Sans Georgian', sans-serif;

    --font-size-xs: 0.75rem;    /* 12px */
    --font-size-sm: 0.85rem;    /* ~14px */
    --font-size-base: 1rem;     /* 16px */
    --font-size-md: 1.1rem;     /* ~18px */
    --font-size-lg: 1.25rem;    /* 20px */
    --font-size-xl: 1.5rem;     /* 24px */
    --font-size-2xl: 2rem;      /* 32px */
    --font-size-3xl: 2.5rem;    /* 40px */
    --font-size-4xl: 3.5rem;    /* 56px */

    /* === Spacing (4px base) === */
    --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 */

    /* === Border Radius === */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-2xl: 20px;
    --radius-full: 9999px;

    /* === Shadows === */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.08);
    --shadow-xl: 0 24px 48px rgba(0, 0, 0, 0.10);
    --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 32px rgba(0, 0, 0, 0.12);

    /* === Transitions === */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out: cubic-bezier(0, 0, 0.2, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.6, 1);
    --duration-fast: 0.15s;
    --duration-normal: 0.3s;
    --duration-slow: 0.5s;

    /* === Layout === */
    --max-width: 1280px;
    --max-width-content: 1200px;
    --max-width-narrow: 630px;
    --nav-height: 64px;

    /* === Z-Index Scale === */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-navbar: 1000;
    --z-modal-backdrop: 5000;
    --z-modal: 5500;
    --z-toast: 8000;
    --z-tooltip: 9000;
    --z-loader: 9999;
}

/* ============================================
   Toast Notification System
   ============================================ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: var(--z-toast, 8000);
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 400px;
    pointer-events: none;
}

@media (max-width: 480px) {
    .toast-container {
        top: 12px;
        left: 12px;
        right: 12px;
        max-width: none;
        align-items: stretch;
    }
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 10px;
    background: var(--color-surface, #fff);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
    border-left: 4px solid #64748B;
    font-family: var(--font-primary, 'Inter', sans-serif);
    font-size: 0.9rem;
    color: var(--color-text-1, #0F172A);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(100%) scale(0.95);
    transition: none;
}

.toast-visible {
    animation: toastSlideIn 0.35s ease-out forwards;
}

.toast-dismissing {
    animation: toastSlideOut 0.3s ease-in forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(60px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0) scale(1); }
    to { opacity: 0; transform: translateX(60px) scale(0.95); }
}

@media (max-width: 480px) {
    @keyframes toastSlideIn {
        from { opacity: 0; transform: translateY(-20px) scale(0.95); }
        to { opacity: 1; transform: translateY(0) scale(1); }
    }
    @keyframes toastSlideOut {
        from { opacity: 1; transform: translateY(0) scale(1); }
        to { opacity: 0; transform: translateY(-20px) scale(0.95); }
    }
}

/* Toast types */
.toast-success { border-left-color: #10B981; }
.toast-error { border-left-color: #EF4444; }
.toast-info { border-left-color: #3B82F6; }
.toast-warning { border-left-color: #F59E0B; }

.toast-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-success .toast-icon { color: #10B981; }
.toast-error .toast-icon { color: #EF4444; }
.toast-info .toast-icon { color: #3B82F6; }
.toast-warning .toast-icon { color: #F59E0B; }

.toast-body {
    flex: 1;
    min-width: 0;
}

.toast-message {
    line-height: 1.4;
}

.toast-action {
    background: none;
    border: none;
    color: #3B82F6;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    font-family: inherit;
}

.toast-action:hover {
    background: rgba(59, 130, 246, 0.1);
}

.toast-close {
    background: none;
    border: none;
    color: var(--color-text-3, #94A3B8);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--color-text-1, #0F172A);
    background: rgba(0,0,0,0.05);
}
