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

* {
    font-family: 'Tajawal', sans-serif;
}

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.social-icon {
    transition: all 0.3s ease;
}

.social-icon:hover {
    transform: scale(1.2);
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
    100% { transform: translateY(0px); }
}

.float-animation {
    animation: float 3s ease-in-out infinite;
}

/* Flash Animation */
@keyframes flash {
    0%, 100% { 
        background: linear-gradient(45deg, 
            rgba(255,255,255,0) 0%, 
            rgba(255,255,255,0.3) 50%, 
            rgba(255,255,255,0) 100%);
        transform: translateX(-100%);
    }
    50% { 
        background: linear-gradient(45deg, 
            rgba(255,255,255,0) 0%, 
            rgba(255,255,255,0.6) 50%, 
            rgba(255,255,255,0) 100%);
        transform: translateX(100%);
    }
}

.flash-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255,255,255,0.4) 50%, 
        transparent 70%);
    animation: flash 3s ease-in-out infinite;
}

/* Particle Animations */
@keyframes particle-float {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) rotate(360deg);
        opacity: 0;
    }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
}

.particle-1 {
    left: 10%;
    animation: particle-float 8s linear infinite;
    animation-delay: 0s;
}

.particle-2 {
    left: 25%;
    animation: particle-float 10s linear infinite;
    animation-delay: 2s;
}

.particle-3 {
    left: 50%;
    animation: particle-float 12s linear infinite;
    animation-delay: 4s;
}

.particle-4 {
    left: 75%;
    animation: particle-float 9s linear infinite;
    animation-delay: 1s;
}

.particle-5 {
    left: 90%;
    animation: particle-float 11s linear infinite;
    animation-delay: 3s;
}

/* Text Shadow Effect */
.text-shadow-lg {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

/* Logo Glow Effect */
.logo-container img {
    box-shadow: 0 0 20px rgba(255,255,255,0.5);
    transition: all 0.3s ease;
}

.logo-container img:hover {
    box-shadow: 0 0 30px rgba(255,255,255,0.8);
    transform: scale(1.1);
}

.academy-banner {
    position: relative;
    margin: 22px 0;
    padding: 0;
    border-radius: 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, #1e222d 0%, #0b0e14 100%);
    box-shadow: 0 15px 35px rgba(0,0,0,0.22);
    border: 2px solid #c2a35d;
}

.banner-content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    position: relative;
    z-index: 2;
}

.banner-logo {
    width: 12rem;
    height: 12rem;
    object-fit: cover;
    border-radius: 1rem;
    box-shadow: 0 8px 20px rgba(0,0,0,0.24);
}

.banner-text {
    flex: 1;
    color: #fff;
}

.banner-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #fff;
}

.banner-subtitle {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: #9db2bd;
}

.banner-description {
    font-size: 1rem;
    color: #cbd5f5;
    margin-bottom: 1rem;
}

.banner-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9rem 2rem;
    border-radius: 999px;
    font-weight: 700;
    color: #000;
    background: #f7db66;
    box-shadow: 0 12px 24px rgba(255, 215, 0, 0.18);
    transition: transform 0.25s ease, background 0.25s ease;
}

.banner-cta:hover {
    background: #ffd43b;
    transform: translateY(-2px);
}

.flash-animation {
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.35) 50%, transparent 70%);
    animation: flash 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes flash {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    border-radius: 50%;
    opacity: 0.7;
    animation: particle-float 8s linear infinite;
}

.particle-1 { top: 20%; left: 10%; animation-delay: 0s; }
.particle-2 { top: 30%; left: 80%; animation-delay: 1.2s; }
.particle-3 { top: 60%; left: 20%; animation-delay: 2.1s; }
.particle-4 { top: 75%; left: 60%; animation-delay: 3.3s; }
.particle-5 { top: 10%; left: 90%; animation-delay: 4.5s; }

@keyframes particle-float {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(-8px); opacity: 1; }
}

.promo-block {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.promo-item {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.promo-item img,
.promo-item a img {
    width: 100%;
    max-width: 728px;
    height: auto;
    object-fit: contain;
    border-radius: 0.75rem;
}

/* Unified Header/Footer */
.main-header {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    background: rgba(255,255,255,0.95);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    backdrop-filter: blur(12px);
}

.main-header .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1f2937;
}

.main-header .logo-image {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    object-fit: cover;
}

.main-nav ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-nav a {
    color: #374151;
    font-weight: 600;
    transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
    color: #7c3aed;
}

.menu-toggle {
    border: none;
    background: transparent;
    color: #374151;
    font-size: 2rem;
    cursor: pointer;
    display: none;
}

.main-nav a.login-btn-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #7c3aed;
    color: #fff;
    text-decoration: none;
}

.main-nav a.login-btn-nav:hover {
    background: #6d28d9;
    color: #fff;
}

.main-footer {
    width: 100%;
    padding: 32px 24px;
    background: #111827;
    color: #e5e7eb;
}

.main-footer p {
    text-align: center;
    margin: 0 0 14px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 16px;
}

.footer-links a {
    color: #9ca3af;
    font-weight: 600;
    text-decoration: none;
}

.footer-links a:hover {
    color: #fff;
}

.social-media-links {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.main-footer .social-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    color: #fff;
    transition: transform 0.2s ease, background 0.2s ease;
}

.main-footer .social-icon:hover {
    background: #7c3aed;
    transform: translateY(-2px);
}

@media (max-width: 900px) {
    .main-header {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .main-nav ul {
        justify-content: center;
        gap: 12px;
    }
}

@media (max-width: 640px) {
    .main-nav {
        display: none;
        width: 100%;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 12px;
        width: 100%;
    }

    .menu-toggle {
        display: inline-flex;
    }
}

@media (max-width: 768px) {
    .banner-content { padding: 1.5rem; }
    .banner-logo { width: 10rem; height: 10rem; }
    .banner-title { font-size: 1.8rem; }
}

/* ─── Code & Pre - Mobile Responsive ─── */
code, pre, kbd, samp {
    font-family: 'Courier New', Courier, monospace;
    background: rgba(0, 0, 0, 0.06);
    border-radius: 4px;
}
code {
    padding: 2px 6px;
    font-size: 0.88em;
    word-break: break-all;
}
pre {
    padding: 12px 16px;
    overflow-x: auto;
    font-size: 0.85em;
    white-space: pre;
    max-width: 100%;
}
pre code {
    background: none;
    padding: 0;
    font-size: inherit;
}

@media (max-width: 768px) {
    code {
        font-size: 0.75em;
        padding: 1px 5px;
    }
    pre {
        font-size: 0.72em;
        padding: 10px 12px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: calc(100vw - 32px);
        white-space: pre;
    }
}

/* ─── Responsive Banners & Ads ─── */
img, .banner-img, .ad-img {
    max-width: 100%;
    height: auto;
}

@media (max-width: 768px) {
    .banner-content {
        flex-direction: column !important;
        text-align: center;
    }
    .banner-logo {
        width: 8rem !important;
        height: 8rem !important;
    }
    img[src*="baner"], img[src*="banner"], img[src*="ad"] {
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }
}

/* محاذاة عناصر القائمة */
.main-nav ul li {
    display: flex;
    align-items: center;
}

/* عرض الحساب الشخصي كنص عادي - مش قابل للضغط */
.main-nav span#profileLink.plain-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #374151;
    font-weight: 600;
    cursor: default;
}

.main-nav span#profileLink.plain-nav-link i {
    color: #7c3aed;
    font-size: 1.1em;
}

/* زرار تسجيل الخروج */
.main-nav a#logoutLink.logout-btn-header {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: #fef2f2;
    color: #dc2626;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #fecaca;
    transition: background 0.2s ease, transform 0.2s ease;
}

.main-nav a#logoutLink.logout-btn-header:hover {
    background: #fee2e2;
    color: #b91c1c;
    transform: translateY(-2px);
}