/**
 * Bookmark Center Pro - CSS Variables & Base Styles
 * Modern Dark Theme with RTL Support
 * 
 * @package BookmarkCenterPro
 * @version 3.0.0
 */

/* ========================================
   Google Fonts - Modern Arabic Typography
======================================== */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
    /* ========================================
       Color Palette - Premium Dark Theme
    ======================================== */
    --bcp-bg-dark: #080a0f;
    --bcp-bg: #0c0e14;
    --bcp-bg-card: #12151d;
    --bcp-bg-sidebar: #0a0c12;
    --bcp-bg-hover: #1a1f2c;
    --bcp-bg-elevated: #181c26;
    --bcp-bg-surface: #151820;
    
    /* Borders */
    --bcp-border: #2a303e;
    --bcp-border-subtle: #1e232e;
    --bcp-border-light: #353d4f;
    
    /* Text Colors */
    --bcp-text: #f4f6fa;
    --bcp-text-secondary: #c8cdd8;
    --bcp-text-muted: #8892a6;
    --bcp-text-dim: #5e667a;
    
    /* Primary Blue */
    --bcp-primary: #3b82f6;
    --bcp-primary-light: #60a5fa;
    --bcp-primary-dark: #2563eb;
    --bcp-primary-hover: #1d4ed8;
    --bcp-primary-glow: rgba(59, 130, 246, 0.25);
    --bcp-primary-bg: rgba(59, 130, 246, 0.1);
    
    /* Success Green */
    --bcp-success: #22c55e;
    --bcp-success-light: #4ade80;
    --bcp-success-glow: rgba(34, 197, 94, 0.2);
    --bcp-success-bg: rgba(34, 197, 94, 0.1);
    
    /* Danger Red */
    --bcp-danger: #ef4444;
    --bcp-danger-light: #f87171;
    --bcp-danger-hover: #dc2626;
    --bcp-danger-glow: rgba(239, 68, 68, 0.2);
    --bcp-danger-bg: rgba(239, 68, 68, 0.1);
    
    /* Warning Orange */
    --bcp-warning: #f59e0b;
    --bcp-warning-light: #fbbf24;
    --bcp-warning-glow: rgba(245, 158, 11, 0.2);
    --bcp-warning-bg: rgba(245, 158, 11, 0.1);
    
    /* Purple Accent */
    --bcp-purple: #8b5cf6;
    --bcp-purple-light: #a78bfa;
    --bcp-purple-glow: rgba(139, 92, 246, 0.2);
    
    /* Cyan Accent */
    --bcp-cyan: #06b6d4;
    --bcp-cyan-glow: rgba(6, 182, 212, 0.2);
    
    /* Input */
    --bcp-input-bg: #0f1118;
    --bcp-input-border: #252a38;
    --bcp-input-focus: #3b82f6;
    
    /* ========================================
       Shadows & Effects
    ======================================== */
    --bcp-shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.2);
    --bcp-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --bcp-shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
    --bcp-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
    --bcp-shadow-xl: 0 24px 64px rgba(0, 0, 0, 0.5);
    --bcp-shadow-glow: 0 0 40px var(--bcp-primary-glow);
    --bcp-shadow-primary: 0 4px 16px var(--bcp-primary-glow);
    
    /* Glassmorphism */
    --bcp-glass-bg: rgba(18, 21, 29, 0.9);
    --bcp-glass-border: rgba(255, 255, 255, 0.06);
    --bcp-glass-blur: blur(24px);
    
    /* ========================================
       Typography - Larger & Better for Arabic
    ======================================== */
    --bcp-font-family: 'IBM Plex Sans Arabic', 'Tajawal', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    
    /* Fluid Font Sizes - Larger for readability */
    --bcp-text-xs: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);    /* 13-15px */
    --bcp-text-sm: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);   /* 15-17px */
    --bcp-text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);       /* 16-18px */
    --bcp-text-lg: clamp(1.125rem, 1.05rem + 0.35vw, 1.3125rem);    /* 18-21px */
    --bcp-text-xl: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);         /* 20-24px */
    --bcp-text-2xl: clamp(1.5rem, 1.35rem + 0.75vw, 2rem);          /* 24-32px */
    --bcp-text-3xl: clamp(1.875rem, 1.7rem + 0.9vw, 2.5rem);        /* 30-40px */
    
    /* Line Heights - Better for Arabic */
    --bcp-line-tight: 1.35;
    --bcp-line-normal: 1.6;
    --bcp-line-relaxed: 1.8;
    --bcp-line-loose: 2;
    
    /* Letter Spacing */
    --bcp-letter-tight: -0.02em;
    --bcp-letter-normal: 0;
    --bcp-letter-wide: 0.02em;
    
    /* ========================================
       Spacing System
    ======================================== */
    --bcp-space-0: 0;
    --bcp-space-1: 0.25rem;   /* 4px */
    --bcp-space-2: 0.5rem;    /* 8px */
    --bcp-space-3: 0.75rem;   /* 12px */
    --bcp-space-4: 1rem;      /* 16px */
    --bcp-space-5: 1.25rem;   /* 20px */
    --bcp-space-6: 1.5rem;    /* 24px */
    --bcp-space-8: 2rem;      /* 32px */
    --bcp-space-10: 2.5rem;   /* 40px */
    --bcp-space-12: 3rem;     /* 48px */
    --bcp-space-16: 4rem;     /* 64px */
    
    /* ========================================
       Border Radius
    ======================================== */
    --bcp-radius-xs: 4px;
    --bcp-radius-sm: 8px;
    --bcp-radius-md: 12px;
    --bcp-radius-lg: 16px;
    --bcp-radius-xl: 20px;
    --bcp-radius-2xl: 24px;
    --bcp-radius-full: 9999px;
    
    /* ========================================
       Transitions & Animations
    ======================================== */
    --bcp-transition-fast: 0.15s ease;
    --bcp-transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --bcp-transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    --bcp-transition-bounce: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    
    /* ========================================
       Layout
    ======================================== */
    --bcp-sidebar-width: 280px;
    --bcp-sidebar-collapsed: 72px;
    --bcp-header-height: 64px;
    --bcp-toolbar-height: 56px;
    --bcp-max-content-width: 1400px;
    
    /* ========================================
       Z-Index Scale
    ======================================== */
    --bcp-z-dropdown: 1000;
    --bcp-z-sticky: 1020;
    --bcp-z-fixed: 1030;
    --bcp-z-modal-backdrop: 1040;
    --bcp-z-modal: 1050;
    --bcp-z-popover: 1060;
    --bcp-z-tooltip: 1070;
    --bcp-z-toast: 1080;
}

/* ========================================
   CSS Reset & Isolation for BCP
======================================== */
.bcp-app *,
.bcp-app *::before,
.bcp-app *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ========================================
   Base App Container
======================================== */
.bcp-app {
    font-family: var(--bcp-font-family);
    font-size: var(--bcp-text-base);
    line-height: var(--bcp-line-normal);
    color: var(--bcp-text);
    background: var(--bcp-bg);
    direction: rtl;
    text-align: right;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Full Screen Mode */
.bcp-app.bcp-fullscreen {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    overflow: hidden;
}

/* ========================================
   Scrollbar Styling
======================================== */
.bcp-app ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.bcp-app ::-webkit-scrollbar-track {
    background: transparent;
}

.bcp-app ::-webkit-scrollbar-thumb {
    background: var(--bcp-border);
    border-radius: var(--bcp-radius-full);
    border: 2px solid transparent;
    background-clip: padding-box;
}

.bcp-app ::-webkit-scrollbar-thumb:hover {
    background: var(--bcp-primary);
    background-clip: padding-box;
}

/* Firefox */
.bcp-app {
    scrollbar-width: thin;
    scrollbar-color: var(--bcp-border) transparent;
}

/* ========================================
   Selection Styling
======================================== */
.bcp-app ::selection {
    background: var(--bcp-primary);
    color: white;
}

/* ========================================
   Focus Visible
======================================== */
.bcp-app :focus-visible {
    outline: 2px solid var(--bcp-primary);
    outline-offset: 2px;
}

/* ========================================
   Typography Utilities
======================================== */
.bcp-heading-1 {
    font-size: var(--bcp-text-3xl);
    font-weight: 700;
    line-height: var(--bcp-line-tight);
    letter-spacing: var(--bcp-letter-tight);
}

.bcp-heading-2 {
    font-size: var(--bcp-text-2xl);
    font-weight: 600;
    line-height: var(--bcp-line-tight);
}

.bcp-heading-3 {
    font-size: var(--bcp-text-xl);
    font-weight: 600;
    line-height: var(--bcp-line-tight);
}

.bcp-body-lg {
    font-size: var(--bcp-text-lg);
    line-height: var(--bcp-line-normal);
}

.bcp-body {
    font-size: var(--bcp-text-base);
    line-height: var(--bcp-line-normal);
}

.bcp-body-sm {
    font-size: var(--bcp-text-sm);
    line-height: var(--bcp-line-normal);
}

.bcp-caption {
    font-size: var(--bcp-text-xs);
    line-height: var(--bcp-line-normal);
    color: var(--bcp-text-muted);
}

/* ========================================
   Animation Keyframes
======================================== */
@keyframes bcpFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bcpSlideUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bcpSlideDown {
    from {
        opacity: 0;
        transform: translateY(-16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bcpSlideRight {
    from {
        opacity: 0;
        transform: translateX(-16px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bcpScale {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bcpSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes bcpPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

@keyframes bcpBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes bcpShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

/* ========================================
   Utility Classes
======================================== */
.bcp-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bcp-line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bcp-line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bcp-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
