/* ===== منصة حكايا - ملف التنسيق الرئيسي ===== */

/* متغيرات الألوان المتطورة - لوحة ألوان عصرية متطورة مستوحاة من تصميم المدرسة */
:root {
    /* الألوان الأساسية المتطورة */
    --primary-color: #FF8C42;          /* برتقالي نابض بالحياة */
    --primary-dark: #E67335;           /* برتقالي عميق */
    --primary-light: #FFB366;          /* برتقالي فاتح */
    --secondary-color: #4A90E2;         /* أزرق سماوي */
    --secondary-dark: #357ABD;          /* أزرق بحري */
    --secondary-light: #6BA3EA;         /* أزرق فاتح */
    --accent-color: #7CB342;            /* أخضر طبيعي */
    --accent-dark: #689F38;             /* أخضر غامق */
    --accent-light: #8BC34A;            /* أخضر فاتح */
    --warning-color: #FFB300;           /* ذهبي مشرق */
    --success-color: #43A047;           /* أخضر نجاح */
    --danger-color: #E53935;            /* أحمر حيوي */

    /* ألوان النصوص المتطورة */
    --text-primary: #1A1A1A;            /* أسود غامق */
    --text-secondary: #424242;          /* رمادي غامق */
    --text-light: #757575;              /* رمادي متوسط */
    --text-muted: #BDBDBD;              /* رمادي فاتح */
    --text-white: #FFFFFF;              /* أبيض نقي */

    /* خلفيات متطورة */
    --bg-primary: #FAFBFC;              /* أبيض كريمي */
    --bg-secondary: #F5F6F8;            /* رمادي أزرق فاتح */
    --bg-card: #FFFFFF;                 /* أبيض نقي */
    --bg-overlay: rgba(255, 255, 255, 0.95); /* طبقة شفافة */

    /* الحدود والظلال المتطورة */
    --border-light: #E8F0FE;            /* حدود سماوية */
    --border-medium: #CDE0F7;           /* حدود متوسطة */
    --light-gray: #F8F9FA;              /* رمادي فاتح */
    --border-color: #E2E8F0;            /* لون الحدود */
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.16);
    --shadow-2xl: 0 24px 64px rgba(0, 0, 0, 0.20);
    --shadow-inner: inset 0 2px 4px rgba(0, 0, 0, 0.06);

    /* الحدود الدائرية المتطورة */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 50%;

    /* الانتقالات المتطورة */
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-slow: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* الظلال المتخصصة */
    --shadow: 0 4px 15px var(--shadow-sm);
    --shadow-hover: 0 8px 25px var(--shadow-md);
    --shadow-active: 0 2px 8px var(--shadow-xs);
}

/* الإعدادات الأساسية */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Tajawal', Tahoma, Arial, sans-serif;
    line-height: 1.7;
    color: var(--text-primary);
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 140, 66, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(74, 144, 226, 0.03) 0%, transparent 50%),
        linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    margin: 0;
    padding: 0;
    min-height: 100vh;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 40% 50%, rgba(124, 179, 66, 0.02) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* النصوص */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    text-rendering: optimizeLegibility;
}

h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }
h4 { font-size: 1.5rem; }
h5 { font-size: 1.25rem; }
h6 { font-size: 1rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

/* الروابط */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
}

/* الأزرار - تصميم عصري متطور */
.btn {
    display: inline-block;
    padding: 1rem 2rem;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: var(--radius-full);
    transition: var(--transition-bounce);
    user-select: none;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(90deg,
            transparent 0%,
            rgba(255, 255, 255, 0.2) 50%,
            transparent 100%);
    transition: var(--transition-normal);
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background:
        radial-gradient(circle,
            rgba(255, 255, 255, 0.3) 0%,
            transparent 70%);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%);
    transition: var(--transition-bounce);
    z-index: 1;
}

.btn > * {
    position: relative;
    z-index: 2;
}

.btn:hover::before {
    left: 100%;
}

.btn:hover::after {
    width: 120%;
    height: 120%;
}

.btn-primary {
    color: var(--text-white);
    background:
        linear-gradient(135deg,
            var(--primary-color) 0%,
            var(--primary-dark) 100%);
    border-color: var(--primary-color);
    box-shadow:
        0 4px 15px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
    background:
        linear-gradient(135deg,
            var(--primary-dark) 0%,
            var(--secondary-color) 100%);
    border-color: var(--primary-dark);
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(255, 140, 66, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    color: var(--text-white);
    background:
        linear-gradient(135deg,
            var(--secondary-color) 0%,
            var(--secondary-dark) 100%);
    border-color: var(--secondary-color);
    box-shadow:
        0 4px 15px rgba(74, 144, 226, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-secondary:hover {
    background:
        linear-gradient(135deg,
            var(--secondary-dark) 0%,
            var(--accent-color) 100%);
    border-color: var(--secondary-dark);
    transform: translateY(-4px) scale(1.05);
    box-shadow:
        0 8px 25px rgba(74, 144, 226, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-outline-primary {
    color: var(--primary-color);
    background-color: rgba(255, 255, 255, 0.9);
    border-color: var(--primary-color);
    border-width: 2px;
    backdrop-filter: blur(10px);
}

.btn-outline-primary:hover {
    color: var(--text-white);
    background:
        linear-gradient(135deg,
            var(--primary-color) 0%,
            var(--primary-dark) 100%);
    border-color: var(--primary-color);
    transform: translateY(-3px) scale(1.02);
    box-shadow:
        0 6px 20px rgba(255, 140, 66, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* البطاقات - تصميم متطور وحديث */
.card {
    background:
        linear-gradient(145deg,
            var(--bg-card) 0%,
            var(--bg-primary) 50%,
            var(--bg-card) 100%);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: var(--transition-slow);
    position: relative;
    backdrop-filter: blur(20px);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background:
        linear-gradient(135deg,
            rgba(255, 140, 66, 0.03) 0%,
            rgba(74, 144, 226, 0.03) 50%,
            rgba(124, 179, 66, 0.03) 100%);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: 1;
}

.card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background:
        linear-gradient(90deg,
            var(--primary-color) 0%,
            var(--warning-color) 50%,
            var(--secondary-color) 100%);
    transition: var(--transition-normal);
    z-index: 2;
}

.card > * {
    position: relative;
    z-index: 3;
}

.card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: var(--shadow-hover);
    border-color: var(--secondary-color);
}

.card:hover::before {
    opacity: 1;
}

.card:hover::after {
    height: 100%;
    background:
        linear-gradient(135deg,
            rgba(255, 140, 66, 0.08) 0%,
            rgba(74, 144, 226, 0.08) 50%,
            rgba(124, 179, 66, 0.08) 100%);
}

.card-header {
    padding: 1rem 1.5rem;
    background-color: var(--light-gray);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    padding: 1rem 1.5rem;
    background-color: var(--light-gray);
    border-top: 1px solid var(--border-color);
}

/* النماذج */
.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-color);
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(108, 99, 255, 0.25);
}

/* الرسائل التنبيهية */
.alert {
    position: relative;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f1c2c7;
}

.alert-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeaa7;
}

.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* الأدوات المساعدة */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.d-none { display: none !important; }
.d-block { display: block !important; }
.d-flex { display: flex !important; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

/* التصميم المتجاوب */
@media (max-width: 768px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.75rem; }
    h3 { font-size: 1.5rem; }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* تنسيق خاص للمنصة - رأس المنصة المحدث */
.platform-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.platform-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

.section-divider {
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color), var(--secondary-color));
    border: none;
    margin: 2rem 0;
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    margin: 0 auto 1rem;
}

.stats-card {
    text-align: center;
    padding: 2rem;
    border: none;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.stats-number {
    font-size: 2.8rem;
    font-weight: 900;
    background:
        linear-gradient(135deg,
            var(--primary-color) 0%,
            var(--warning-color) 30%,
            var(--secondary-color) 70%,
            var(--accent-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
}

.stats-number::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120%;
    height: 120%;
    background:
        linear-gradient(135deg,
            rgba(255, 140, 66, 0.1) 0%,
            rgba(255, 179, 0, 0.1) 50%,
            rgba(74, 144, 226, 0.1) 100%);
    border-radius: var(--radius-full);
    transform: translate(-50%, -50%) rotate(45deg);
    opacity: 0;
    transition: var(--transition-normal);
    z-index: -1;
}

.stats-number:hover::before {
    opacity: 1;
    transform: translate(-50%, -50%) rotate(45deg) scale(1.2);
}

.stats-label {
    color: var(--text-light);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
}

.stats-label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transform: translateX(-50%);
    transition: var(--transition-normal);
    border-radius: 1px;
}

.stats-label:hover::after {
    width: 100%;
}

/* الرسوم المتحركة المتطورة */
@keyframes rotate {
    0% {
        transform: rotate(0deg) scale(1);
        filter: brightness(1);
    }
    50% {
        transform: rotate(180deg) scale(1.08);
        filter: brightness(1.2);
    }
    100% {
        transform: rotate(360deg) scale(1);
        filter: brightness(1.1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        filter: brightness(1);
    }
    25% {
        transform: translateY(-6px) rotate(2deg);
        filter: brightness(1.1);
    }
    50% {
        transform: translateY(-12px) rotate(0deg);
        filter: brightness(1.2);
    }
    75% {
        transform: translateY(-6px) rotate(-2deg);
        filter: brightness(1.1);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.4);
        filter: brightness(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 15px rgba(255, 140, 66, 0);
        filter: brightness(1.3);
    }
}

@keyframes shimmer {
    0% {
        opacity: 0.5;
        transform: translateX(-100%) scale(1);
        filter: brightness(0.8);
    }
    50% {
        opacity: 1;
        transform: translateX(0%) scale(1.02);
        filter: brightness(1.4);
    }
    100% {
        opacity: 0.5;
        transform: translateX(100%) scale(1);
        filter: brightness(0.8);
    }
}

@keyframes titleGlow {
    0% {
        filter: brightness(1) saturate(1) hue-rotate(0deg);
        transform: scale(1) rotate(0deg);
    }
    25% {
        filter: brightness(1.1) saturate(1.2) hue-rotate(5deg);
        transform: scale(1.02) rotate(0.5deg);
    }
    50% {
        filter: brightness(1.2) saturate(1.4) hue-rotate(0deg);
        transform: scale(1.03) rotate(0deg);
    }
    75% {
        filter: brightness(1.1) saturate(1.2) hue-rotate(-5deg);
        transform: scale(1.02) rotate(-0.5deg);
    }
    100% {
        filter: brightness(1.05) saturate(1.1) hue-rotate(0deg);
        transform: scale(1.01) rotate(0deg);
    }
}

@keyframes slideInUp {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
        filter: blur(10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0px);
    }
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* تأثيرات التحويم المتطورة */
.btn:hover {
    transform: translateY(-4px) scale(1.05);
    filter: brightness(1.1);
}

.feature-icon {
    background:
        linear-gradient(135deg,
            var(--primary-color) 0%,
            var(--secondary-color) 50%,
            var(--accent-color) 100%);
    animation: pulse 4s ease-in-out infinite;
    border-radius: var(--radius-lg);
    position: relative;
    overflow: hidden;
}

.feature-icon::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        linear-gradient(45deg,
            rgba(255, 255, 255, 0.1) 0%,
            transparent 50%,
            rgba(255, 255, 255, 0.1) 100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.feature-icon:hover {
    transform: scale(1.15) rotate(5deg);
    animation: none;
    box-shadow:
        0 12px 30px rgba(255, 140, 66, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.3);
    filter: brightness(1.2);
}

.feature-icon:hover::before {
    opacity: 1;
}

/* العناصر الإضافية المتطورة */
.section-divider {
    height: 4px;
    background:
        linear-gradient(90deg,
            var(--primary-color) 0%,
            var(--secondary-color) 30%,
            var(--accent-color) 70%,
            var(--warning-color) 100%);
    border: none;
    margin: 3rem 0;
    position: relative;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.section-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 8px;
    background:
        linear-gradient(135deg,
            var(--warning-color) 0%,
            var(--primary-color) 100%);
    transform: translate(-50%, -50%);
    border-radius: var(--radius-full);
    box-shadow: 0 2px 6px rgba(255, 140, 66, 0.4);
    animation: shimmer 3s ease-in-out infinite alternate;
}

.section-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 4px;
    background: var(--text-white);
    transform: translate(-50%, -50%);
    border-radius: var(--radius-full);
    opacity: 0.6;
}

/* تطبيق الرسوم المتحركة على العناصر */
.card {
    animation: fadeInScale 0.6s ease-out;
}

.card:nth-child(1) { animation-delay: 0.1s; }
.card:nth-child(2) { animation-delay: 0.2s; }
.card:nth-child(3) { animation-delay: 0.3s; }
.card:nth-child(4) { animation-delay: 0.4s; }

.stats-number {
    animation: slideInUp 0.8s ease-out;
}

.btn {
    animation: fadeInScale 0.4s ease-out;
}

h1, h2, h3 {
    animation: titleGlow 6s ease-in-out infinite;
}
