/* ===== Global Styles ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Cairo', sans-serif;
    line-height: 1.6;
    color: #333;
}

:root {
    --primary-color: #4CAF50;
    --secondary-color: #f8f9fa;
    --accent-color: #ffc107;
    --text-dark: #212529;
    --text-muted: #6c757d;
}

/* تحسين السلوك العام للتمرير */
html { scroll-behavior: smooth; }

/* ===== Navigation ===== */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    transition: color 0.3s;
}

.nav-link:hover {
    color: var(--primary-color) !important;
}

/* تمييز الرابط النشط في شريط التنقل */
.nav-link.active,
.nav-link[aria-current="page"] {
    color: var(--primary-color) !important;
    font-weight: 700;
}
.nav-link:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
    border-radius: 8px;
}

.navbar {
    background: rgba(255,255,255,0.75);
    backdrop-filter: saturate(120%) blur(8px);
    transition: background-color .2s ease, box-shadow .2s ease;
}

.navbar.scrolled {
    background: #fff;
    box-shadow: 0 6px 16px rgba(0,0,0,0.06);
}

.btn-success {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-success:hover {
    background-color: #245d3d;
    border-color: #245d3d;
}

/* ===== Hero Section ===== */
.hero-section {
    position: relative;
    color: white;
    padding: 140px 0;
    text-align: center;
    overflow: hidden;
    min-height: 90vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a4d30 0%, #2d7a4f 100%);
}

.hero-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(135deg, #1a4d30 0%, #2d7a4f 100%);
}

.hero-slideshow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.2) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-slideshow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.1) 100%);
    z-index: 2;
    pointer-events: none;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #1a4d30;
    opacity: 0;
    animation: heroFade 18s infinite, heroZoom 18s infinite;
    transition: opacity 2s ease-in-out;
    transform: scale(1.1);
    will-change: opacity, transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.hero-slide.active {
    transform: scale(1);
    opacity: 1;
    z-index: 2;
}

@keyframes heroZoom {
    0% {
        transform: scale(1.1);
    }
    1.5% {
        transform: scale(1);
    }
    31.5% {
        transform: scale(1);
    }
    33% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1.1);
    }
}

.hero-slide:nth-child(1) {
    background-image: url('../images/hero/hero1.jpg');
    background-color: #1a4d30;
    animation-delay: 0s;
    opacity: 1;
    z-index: 1;
}

.hero-slide:nth-child(2) {
    background-image: url('../images/hero/hero2.jpg');
    background-color: #1a4d30;
    animation-delay: 6s;
}

.hero-slide:nth-child(3) {
    background-image: url('../images/hero/hero3.jpg');
    background-color: #1a4d30;
    animation-delay: 12s;
}

.hero-slide:nth-child(4) {
    background-image: url('../images/hero/hero4.jpg');
    background-color: #1a4d30;
    animation-delay: 18s;
}

.hero-slide:nth-child(5) {
    background-image: url('../images/hero/hero5.jpg');
    background-color: #1a4d30;
    animation-delay: 24s;
}

@keyframes heroFade {
    0% {
        opacity: 0;
    }
    1.5% {
        opacity: 1;
    }
    31.5% {
        opacity: 1;
    }
    33% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

.hero-section .container {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.hero-section h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    line-height: 1.2;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.5);
    letter-spacing: -0.5px;
    animation: fadeInUp 1s ease-out;
}

.hero-section p {
    font-size: 1.35rem;
    margin-bottom: 2.5rem;
    line-height: 1.8;
    text-shadow: 1px 2px 4px rgba(0, 0, 0, 0.5);
    font-weight: 400;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-section .btn {
    margin: 0.5rem;
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-section .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.hero-section .btn-outline-light {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.hero-section .btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-section .btn i {
    margin-inline-end: 0.5rem;
}

/* Hero Indicators */
.hero-indicators {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    display: flex;
    gap: 12px;
    align-items: center;
}

.hero-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.hero-indicator:hover {
    background: rgba(255, 255, 255, 0.6);
    transform: scale(1.2);
}

.hero-indicator.active {
    width: 40px;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(255, 255, 255, 1);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero Scroll Indicator */
.hero-scroll-indicator {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    animation: bounce 2s infinite;
}

.hero-scroll-indicator i {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-10px);
    }
    60% {
        transform: translateX(-50%) translateY(-5px);
    }
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.hero-section p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* ===== Cards ===== */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

/* ===== Program Cards ===== */
.program-card {
    text-align: center;
    background: #fff;
    border-radius: 16px;
    transition: transform .25s ease, box-shadow .25s ease;
}

.program-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.program-card .card-img-top {
    height: 220px;
    object-fit: cover;
}

/* ===== Brand Button ===== */
.btn-brand {
    background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 60%, #43A047 100%);
    color: #fff !important;
    border: none;
    box-shadow: 0 8px 18px rgba(76, 175, 80, 0.25);
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn-brand:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(76, 175, 80, 0.28);
    filter: brightness(1.03);
}
.btn-brand:active {
    transform: translateY(0);
}
.btn-brand:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(76, 175, 80, 0.25);
}

/* ===== Card Image Overlay ===== */
.program-card .card-img-wrap {
    position: relative;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
}
.program-card .card-img-wrap img {
    transition: transform .25s ease, filter .25s ease;
}
.program-card .card-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.35) 60%, rgba(0,0,0,0.55) 100%);
    opacity: 0;
    transition: opacity .25s ease;
}
.program-card:hover .card-img-wrap::after {
    opacity: 1;
}
.program-card:hover .card-img-wrap img {
    transform: scale(1.05);
    filter: brightness(0.9);
}

/* Overlay عام للبطاقات التي تستخدم card-img-wrap */
.card .card-img-wrap {
    position: relative;
    overflow: hidden;
}
.card .card-img-wrap img {
    width: 100%;
    height: auto;
    transition: transform .25s ease, filter .25s ease;
}
.card .card-img-wrap::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 60%, rgba(0,0,0,0.45) 100%);
    opacity: 0;
    transition: opacity .25s ease;
}
.card:hover .card-img-wrap::after {
    opacity: 1;
}
.card:hover .card-img-wrap img {
    transform: scale(1.03);
    filter: brightness(0.95);
}

/* ===== CTA Spacing (logical directions) ===== */
.btn-cta {
    margin-inline-start: 0.75rem;
    margin-inline-end: 0.75rem;
}

/* ===== Reveal on Scroll ===== */
.reveal-on-scroll {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
    will-change: opacity, transform;
}
.reveal-visible {
    opacity: 1;
    transform: none;
}
@media (prefers-reduced-motion: reduce) {
    .reveal-on-scroll {
        transition: none;
    }
}

.program-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
}

/* ===== Stats Section ===== */
.stats-section {
    background: var(--secondary-color);
    padding: 60px 0;
}

.stat-item {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.stat-label {
    color: var(--text-muted);
    font-size: 1rem;
}

/* ===== Buttons ===== */
.btn {
    padding: 0.75rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #245d3d;
    border-color: #245d3d;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ===== Badge ===== */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
}

/* ===== Forms ===== */
.form-control, .form-select {
    border-radius: 10px;
    padding: 0.75rem 1rem;
    border: 2px solid #e0e0e0;
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(45, 122, 79, 0.25);
}

/* ===== Tables ===== */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead {
    background-color: var(--primary-color);
    color: white;
}

/* ===== Footer ===== */
footer {
    background-color: #212529;
}

footer a {
    transition: color 0.3s;
}

footer a:hover {
    color: var(--primary-color) !important;
}

/* ===== Utility Classes ===== */
.section-padding {
    padding: 80px 0;
}

.text-primary-custom {
    color: var(--primary-color);
}

.bg-primary-custom {
    background: linear-gradient(135deg, #39B54A 0%, #4CAF50 60%, #2E7D32 100%);
}

.bg-light-custom {
    background-color: var(--secondary-color);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .hero-section {
        padding: 100px 0;
        min-height: 80vh;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
        margin-bottom: 1rem;
    }
    
    .hero-section p {
        font-size: 1.1rem;
        margin-bottom: 2rem;
    }
    
    .hero-section .btn {
        display: block;
        width: 100%;
        max-width: 300px;
        margin: 0.5rem auto;
        padding: 0.9rem 2rem;
        font-size: 1rem;
    }
    
    .hero-indicators {
        bottom: 20px;
    }
    
    .hero-scroll-indicator {
        bottom: 60px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .program-icon {
        font-size: 3rem;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 80px 0;
        min-height: 70vh;
    }
    
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .hero-section .btn {
        font-size: 0.95rem;
        padding: 0.8rem 1.5rem;
    }
}

/* ===== Admin Panel ===== */
.admin-sidebar {
    background-color: #212529;
    min-height: 100vh;
    color: white;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 1rem 1.5rem;
    border-radius: 5px;
    margin-bottom: 0.5rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
}

.admin-header {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 1rem 0;
}

/* ===== Loading Spinner ===== */
.spinner-border-custom {
    width: 3rem;
    height: 3rem;
    border-width: 0.3rem;
}

/* ===== Image Gallery ===== */
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
