/* ===================================
   ملف التحسينات الحديثة والمتجاوبة
   modern-enhancements.css
   =================================== */

/* ===================================
   1. المتغيرات المحدثة
   =================================== */
:root {
    /* الألوان الرئيسية المحدثة */
    --primary-color: #0D4D3D;
    --primary-light: #145F4C;
    --primary-dark: #082D25;
    --secondary-color: #D4C5A9;
    --accent-color: #FFD700;
    --accent-hover: #FFC700;
    
    /* ألوان الحالات */
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --info-color: #3B82F6;
    
    /* الخلفيات */
    --bg-gradient: linear-gradient(135deg, #0D4D3D 0%, #145F4C 100%);
    --bg-overlay: rgba(13, 77, 61, 0.85);
    
    /* الظلال المحدثة */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.16);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.20);
    
    /* الانتقالات */
    --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* نصف القطر */
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;
}

/* ===================================
   2. تحسينات عامة
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

body {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--bg-color);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   3. الحاوية المتجاوبة
   =================================== */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
}

/* ===================================
   4. Grid System المتجاوب
   =================================== */
.grid {
    display: grid;
    gap: 24px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid-3, .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .grid {
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ===================================
   5. الأزرار الحديثة
   =================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: var(--transition-base);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--bg-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
}

.btn-sm {
    padding: 10px 20px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 18px 40px;
    font-size: 1.125rem;
}

@media (max-width: 768px) {
    .btn {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
    .btn-lg {
        padding: 14px 32px;
        font-size: 1rem;
    }
}

/* ===================================
   6. البطاقات الحديثة
   =================================== */
.card {
    background: white;
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition-base);
    box-shadow: var(--shadow-sm);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.card-image {
    position: relative;
    width: 100%;
    padding-top: 75%; /* 4:3 Aspect Ratio */
    overflow: hidden;
    background: var(--bg-light);
}

.card-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.card:hover .card-image img {
    transform: scale(1.1);
}

.card-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--accent-color);
    color: var(--primary-dark);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 2;
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 8px;
    line-height: 1.4;
}

.card-text {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 16px;
    flex: 1;
}

.card-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

@media (max-width: 768px) {
    .card-body {
        padding: 16px;
    }
    .card-title {
        font-size: 1rem;
    }
    .card-text {
        font-size: 0.85rem;
    }
}

/* ===================================
   7. Hero Section الحديث
   =================================== */
.hero-modern {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-gradient);
    overflow: hidden;
}

.hero-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 20% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    animation: pulse 10s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 80px 20px;
    max-width: 900px;
    margin: 0 auto;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    margin-bottom: 24px;
    line-height: 1.2;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 32px;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .hero-modern {
        min-height: 550px;
    }
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.25rem;
    }
}

@media (max-width: 768px) {
    .hero-modern {
        min-height: 450px;
    }
    .hero-content {
        padding: 60px 20px;
    }
    .hero-title {
        font-size: 2rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .hero-actions {
        flex-direction: column;
        gap: 12px;
    }
    .hero-actions .btn {
        width: 100%;
        max-width: 300px;
    }
}

/* ===================================
   8. Section Headers
   =================================== */
.section {
    padding: 80px 0;
}

.section-header {
    text-align: center;
    margin-bottom: 60px;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-color);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    border-radius: var(--radius-full);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 24px auto 0;
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }
    .section-header {
        margin-bottom: 40px;
    }
    .section-title {
        font-size: 1.875rem;
    }
    .section-subtitle {
        font-size: 1rem;
    }
}

/* ===================================
   9. Mobile Navigation
   =================================== */
.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.mobile-menu-btn span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--primary-color);
    margin: 5px auto;
    transition: var(--transition-base);
}

.mobile-menu-btn.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .mobile-menu-btn {
        display: block;
    }
}

/* ===================================
   10. Loading & Skeleton
   =================================== */
.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid rgba(13, 77, 61, 0.1);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===================================
   11. Utility Classes
   =================================== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }
.p-5 { padding: 48px; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

@media (max-width: 768px) {
    .d-md-none { display: none; }
    .d-md-block { display: block; }
}

@media (max-width: 480px) {
    .d-sm-none { display: none; }
    .d-sm-block { display: block; }
}

/* ===================================
   12. Animation Classes
   =================================== */
.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.6s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* تقليل الحركة للمستخدمين الذين يفضلون ذلك */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
