/* ====================================
   CSS CUSTOM PROPERTIES (VARIABLES)
   ==================================== */
:root {
    /* New Brand Color Palette */
    --primary-color: #123EDD;
    /* Royal Blue */
    --secondary-color: #2A2A77;
    /* Dark Navy */
    --accent-color: #5CCFF7;
    /* Bright Cyan */
    --text-primary: #1F2937;
    /* Dark Gray */
    --text-secondary: #AAADB8;
    /* Gray */
    --text-light: #9CA3AF;
    /* Light Gray */
    --background-primary: #FFFFFF;
    /* White */
    --background-secondary: #F2F4F4;
    /* Light Gray Background */
    --background-dark: #2A2A77;
    /* Dark Navy */
    --border-color: #C8CAE0;
    /* Light Gray */
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);

    /* Corner accent system */
    --accent-block-size: 10px;
    --accent-strip-width: 28px;
    --accent-bar-height: 22px;
    --accent-corner-width: 28px;
    --accent-corner-height: 32px;
    --accent-section-strip-width: 56px;
    --accent-section-bar-height: 44px;
    --accent-section-corner-width: 56px;
    --accent-section-corner-height: 64px;
    --accent-section-block-size: 20px;
    --accent-section-strip-bg: linear-gradient(to bottom, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
    --accent-section-bar-bg: linear-gradient(90deg, rgba(92, 207, 247, 0.12), rgba(92, 207, 247, 0.06));

    /* Interactive states */
    --primary-hover: #0E32B4;
    --primary-active: #0B2891;
    --error-color: #EF4444;

    /* Globe */
    --globe-purple: #7B2FBE;
    --globe-cyan: #00D4FF;

    /* Typography */
    --font-primary: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-arabic: 'Cairo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* 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: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;
    --radius-xl: 12px;

    /* Derived color channels for rgba() usage */
    --primary-rgb: 18, 62, 221;
    --accent-corner-cyan-start: #5CCFF7;
    --accent-corner-cyan-end: #4ABDE5;
    --accent-corner-purple-start: #7B79F2;
    --accent-corner-purple-end: #6F6CEF;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Z-index layers */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal: 1040;
    --z-popover: 1050;
    --z-tooltip: 1060;
    --z-loading: 9999;
}

/* ====================================
   RESET AND BASE STYLES
   ==================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--background-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* RTL Support */
[dir="rtl"] {
    font-family: var(--font-arabic);
}

[dir="rtl"] body {
    font-family: var(--font-arabic);
}

/* ====================================
   LOADING SCREEN
   ==================================== */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: var(--z-loading);
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-logo {
    width: 120px;
    height: auto;
    margin-bottom: var(--spacing-lg);
    filter: brightness(0) invert(1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}
