@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;900&display=swap');

/* --- CSS Variables & Theme Definitions --- */
:root {
    /* Fonts */
    --font-primary: 'Tajawal', sans-serif;

    /* Transition Speeds */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;

    /* Base Dimensions */
    --radius-sm: 8px;
    --radius-md: 15px;
    --radius-lg: 25px;
    --max-width: 1200px;

    /* Common Gradients */
    --grad-primary: linear-gradient(135deg, #00c6ff 0%, #0072ff 100%);
    --grad-premium: linear-gradient(135deg, #ffd700 0%, #ffa500 100%);
    --grad-encyclopedia: linear-gradient(135deg, #8e2de2 0%, #4a00e0 100%);
    --grad-tiktok: linear-gradient(135deg, #fe2c55 0%, #25f4ee 100%);
    --grad-danger: linear-gradient(135deg, #ff416c 0%, #ff4b2b 100%);
    --grad-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);

    /* Dark Theme (Default) */
    --bg-main: #0a0e17;
    --bg-radial: radial-gradient(circle at center, #111a2e 0%, #0a0e17 100%);
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-color-hover: rgba(255, 255, 255, 0.15);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-inverse: #1f2937;
    --shadow-soft: rgba(0, 0, 0, 0.5);
    --glass-blur: blur(12px);
    --accent-glow: rgba(0, 198, 255, 0.15);
}

/* Light Theme overrides */
[data-theme="light"] {
    --bg-main: #f3f7fa;
    --bg-radial: radial-gradient(circle at center, #ffffff 0%, #e9eff5 100%);
    --bg-card: rgba(255, 255, 255, 0.7);
    --bg-card-hover: rgba(255, 255, 255, 0.9);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-color-hover: rgba(0, 0, 0, 0.15);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-inverse: #f3f4f6;
    --shadow-soft: rgba(0, 0, 0, 0.05);
    --accent-glow: rgba(0, 114, 255, 0.08);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
    width: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-primary);
    background: var(--bg-radial);
    color: var(--text-main);
    line-height: 1.6;
    direction: rtl;
    min-height: 100%;
    width: 100%;
    overflow-x: hidden;
    transition: background var(--transition-normal), color var(--transition-normal);
}

/* --- Typography --- */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-main);
}

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-fast);
}

p {
    color: var(--text-muted);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 198, 255, 0.3);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 198, 255, 0.6);
}

/* --- Layout Utilities --- */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

.section-padding {
    padding: 80px 0;
}

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

.flex {
    display: flex;
}

.grid {
    display: grid;
}

/* --- Glassmorphism Card Base --- */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px 0 var(--shadow-soft);
    transition: background var(--transition-normal), border var(--transition-normal), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.glass-panel:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-color-hover);
}

/* --- Theme Toggler Utility --- */
.theme-switch-btn {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.25rem;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.theme-switch-btn:hover {
    background: var(--border-color);
    transform: rotate(15deg);
}

/* --- Animation Utilities --- */
[data-reveal] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

[data-reveal].revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Glow effects */
.glow-text-primary {
    text-shadow: 0 0 15px rgba(0, 198, 255, 0.5);
}

.glow-text-premium {
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.5);
}