/**
 * Main Styles - الأنماط الرئيسية
 * يتم التحكم بالألوان من backend/settings/appearance.php
 */

/* ========================================
   CSS Variables & Reset
======================================== */
:root {
    /* الألوان الافتراضية (يتم تجاوزها من PHP) */
    --primary-color: #6366f1;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --header-color: #1e293b;
    --footer-color: #0f172a;

    /* ألوان النص */
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    /* ألوان الخلفية */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;

    /* ألوان الحدود */
    --border-color: rgba(148, 163, 184, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);

    /* الظلال */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.3);

    /* الخط */
    --font-family: 'Cairo', sans-serif;

    /* الأبعاد */
    --header-height: 80px;
    --container-max-width: 1400px;
    --border-radius: 12px;
    --border-radius-lg: 20px;

    /* الانتقالات */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   الوضع الليلي (Dark Mode) - الألوان من قاعدة البيانات
======================================== */
[data-theme="dark"] {
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: rgba(148, 163, 184, 0.2);
    --border-light: rgba(255, 255, 255, 0.1);
    color-scheme: dark;
}

/* تطبيق ألوان الوضع الليلي من قاعدة البيانات */
html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--dark-body-color, #111827) !important;
}

html[data-theme="dark"] .main-content,
html[data-theme="dark"] .welcome-section {
    background-color: var(--dark-body-color, #111827) !important;
}

[data-theme="dark"] .welcome-text {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ========================================
   الوضع النهاري (Light Mode) - الألوان من قاعدة البيانات
======================================== */
[data-theme="light"] {
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-color: rgba(0, 0, 0, 0.1);
    --border-light: rgba(0, 0, 0, 0.05);
    color-scheme: light;
}

/* تطبيق ألوان الوضع النهاري من قاعدة البيانات */
html[data-theme="light"],
html[data-theme="light"] body {
    background-color: var(--primary-color, #6366f1) !important;
}

html[data-theme="light"] .main-content,
html[data-theme="light"] .welcome-section {
    background-color: var(--primary-color, #6366f1) !important;
}

[data-theme="light"] .welcome-text {
    color: var(--text-primary) !important;
    -webkit-text-fill-color: var(--text-primary) !important;
    background: none !important;
}

/* ========================================
   Reset & Base
======================================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    overflow-x: hidden;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-normal);
}

ul,
ol {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    background: none;
}

input,
textarea,
select {
    font-family: inherit;
    font-size: inherit;
    outline: none;
    border: none;
}

/* ========================================
   Container
======================================== */
.container {
    width: 100%;
    max-width: var(--container-max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ========================================
   Main Content
======================================== */
.main-content {
    min-height: calc(100vh - var(--header-height) - 400px);
    padding-top: var(--header-height);
    background-color: var(--bg-primary);
    overflow-x: hidden;
}

/* ========================================
   Welcome Section
======================================== */
.welcome-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 4rem 0;
    background-color: var(--bg-primary);
}

.welcome-text {
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: fadeInUp 1s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Scrollbar
======================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* ========================================
   Selection
======================================== */
::selection {
    background: var(--primary-color);
    color: white;
}

::-moz-selection {
    background: var(--primary-color);
    color: white;
}

/* ========================================
   Utilities
======================================== */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   Responsive
======================================== */
@media (max-width: 1200px) {
    :root {
        --container-max-width: 100%;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 0 1rem;
    }

    .welcome-section {
        min-height: 50vh;
        padding: 2rem 0;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 13px;
    }
}