/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Poppins:wght@300;400;500;600;700&display=swap');

/* Variables */
:root {
    --primary: #003366; /* Navy Blue */
    --primary-dark: #002244;
    --accent: #D4AF37; /* Gold */
    --accent-hover: #B5952F;
    --text-main: #1e293b;
    --text-light: #64748b;
    --bg-body: #f8fafc;
    --bg-card: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.9);
    --nav-border: 1px solid rgba(226, 232, 240, 0.8);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
}

body.dark-mode {
    --primary: #3b82f6; /* Brighter blue for dark mode */
    --primary-dark: #2563eb;
    --accent: #fbbf24;
    --accent-hover: #f59e0b;
    --text-main: #f1f5f9;
    --text-light: #94a3b8;
    --bg-body: #0f172a;
    --bg-card: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.9);
    --nav-border: 1px solid rgba(51, 65, 85, 0.5);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.7;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

html[dir="rtl"] body {
    font-family: 'Cairo', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', sans-serif; /* Headings always Cairo for style */
    color: var(--text-main);
    line-height: 1.3;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    display: block;
    border-radius: var(--radius);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Buttons */
.btn {
    display: inline-block;
    background: var(--accent);
    color: #000; /* Gold bg needs dark text */
    padding: 12px 32px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.btn:hover {
    background: transparent;
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: var(--nav-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

body.dark-mode .logo {
    color: var(--accent);
}

.logo img {
    height: 50px;
    margin-right: 12px;
    border-radius: 0; /* Logo shouldn't be rounded if it's transparent */
}

html[dir="rtl"] .logo img {
    margin-right: 0;
    margin-left: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}

.nav-links a {
    font-weight: 500;
    color: var(--text-main);
    position: relative;
    font-size: 0.95rem;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:hover {
    color: var(--accent);
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: 24px;
    padding-left: 24px;
    border-left: 1px solid var(--text-light);
}

html[dir="rtl"] .nav-controls {
    margin-left: 0;
    margin-right: 24px;
    padding-left: 0;
    padding-right: 24px;
    border-left: none;
    border-right: 1px solid var(--text-light);
}

.control-btn {
    background: transparent;
    border: none;
    color: var(--text-main);
    font-size: 1.2rem;
    cursor: pointer;
    transition: transform 0.2s, color 0.2s;
}

.control-btn:hover {
    color: var(--accent);
    transform: scale(1.1);
}

.hamburger {
    display: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;
    min-height: 600px;
    background: url('imgs/WhatsApp Image 2025-12-22 at 4.25.18 PM.jpeg') no-repeat center center/cover;
    background-attachment: fixed; /* Parallaxish */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 80px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.9), rgba(0, 0, 0, 0.7));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 40px;
    font-weight: 300;
}

/* Sections */
.section {
    padding: 100px 0;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 auto 60px; /* Centered with margin */
    position: relative;
    display: table; /* Fits content */
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: var(--accent);
    margin: 16px auto 0;
    border-radius: 2px;
}

.bg-light {
    background-color: var(--bg-body);
}

.bg-dark {
    background-color: var(--primary-dark);
    color: #fff;
}

/* About */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-text h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--primary);
}

body.dark-mode .about-text h3 {
    color: var(--accent);
}

.about-text p {
    margin-bottom: 20px;
    color: var(--text-light);
}

.info-list li {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    font-weight: 500;
}

.info-list i {
    color: var(--accent);
    margin-right: 12px;
    font-size: 1.1rem;
}

.about-image {
    position: relative;
}

.about-image::before {
    content: '';
    position: absolute;
    top: -20px;
    left: -20px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: var(--radius);
    z-index: -1;
}

html[dir="rtl"] .about-image::before {
    left: auto;
    right: -20px;
}

/* Cards (Academics, Activities) */
.cards-grid, .activities-grid, .achievements-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.card, .activity-item, .achievement-block {
    background: var(--bg-card);
    padding: 40px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.card:hover, .activity-item:hover, .achievement-block:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(212, 175, 55, 0.3); /* Gold tint */
}

.card-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 24px;
}

body.dark-mode .card-icon {
    color: var(--accent);
}

.card h3, .activity-content h3, .achievement-block h3 {
    font-size: 1.4rem;
    margin-bottom: 16px;
}

.card p, .activity-content p, .achievement-block p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* Activity Item Specifics */
.activity-item {
    padding: 0;
}

.activity-item img {
    width: 100%;
    height: 240px;
    object-fit: cover;
    border-radius: var(--radius) var(--radius) 0 0;
    transition: transform 0.5s ease;
}

.activity-item:hover img {
    transform: scale(1.05);
}

.activity-content {
    padding: 30px;
}

/* Extra Activities */
.extra-activities {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-top: 40px;
}

.extra-box {
    background: var(--bg-card);
    padding: 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--accent);
}

html[dir="rtl"] .extra-box {
    border-left: none;
    border-right: 4px solid var(--accent);
}

.extra-box h4 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.extra-box h4 i {
    color: var(--accent);
    margin-right: 10px;
}

html[dir="rtl"] .extra-box h4 i {
    margin-right: 0;
    margin-left: 10px;
}

/* Achievements Dark Section */
#achievements.bg-dark {
    background: linear-gradient(to bottom, var(--primary-dark), #000);
}

.achievement-block {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.achievement-block h3 {
    color: var(--accent);
}

.achievement-block p {
    color: rgba(255, 255, 255, 0.7);
}

/* Alumni Slider */
.alumni-section {
    margin-top: 80px;
    text-align: center;
}

.alumni-title {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 40px;
    position: relative;
    display: inline-block;
}

.marquee-container {
    width: 100%;
    overflow: hidden;
    position: relative;
    padding: 20px 0;
    /* Removed mask-image to prevent visibility issues */
}

.marquee-track {
    display: flex;
    gap: 32px;
    width: max-content;
    animation: scroll 40s linear infinite; /* Slower for better readability */
}

.marquee-track:hover {
    animation-play-state: paused;
}

.alumni-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 24px;
    border-radius: var(--radius);
    width: 250px; /* Fixed width */
    flex-shrink: 0; /* Prevent shrinking */
    text-align: center;
    transition: transform 0.3s ease, background 0.3s;
}

.alumni-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--accent);
}

.alumni-card img {
    width: 100px; /* Larger images */
    height: 100px;
    border-radius: 50%;
    margin: 0 auto 16px;
    border: 3px solid var(--accent);
    object-fit: cover;
    background-color: #fff; /* Fallback */
}

.alumni-card h4 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.alumni-card p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    font-weight: 400;
}

@keyframes scroll {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(calc(-50% - 16px));
    }
}

/* RTL Scroll - Move Right */
html[dir="rtl"] .marquee-track {
    animation: scroll-rtl 40s linear infinite;
}

@keyframes scroll-rtl {
    0% {
        transform: translateX(calc(-50% - 16px)); /* Start from left (hidden) */
    }
    100% {
        transform: translateX(0); /* Move to 0 */
    }
}

/* Contact */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 60px;
    background: var(--bg-card);
    padding: 40px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.info-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 32px;
}

.info-item i {
    font-size: 1.5rem;
    color: var(--accent);
    margin-right: 20px;
    background: rgba(212, 175, 55, 0.1);
    padding: 12px;
    border-radius: 50%;
}

html[dir="rtl"] .info-item i {
    margin-right: 0;
    margin-left: 20px;
}

.map-container iframe {
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

/* Developers Section */
.developers-grid {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.developer-card {
    background: var(--bg-card);
    padding: 20px 30px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid transparent;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    gap: 20px;
    min-width: 300px;
}

.developer-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.dev-avatar {
    width: 60px;
    height: 60px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    border: 2px solid var(--accent);
}

.dev-info h3 {
    font-size: 1.1rem;
    margin-bottom: 4px;
    color: var(--primary);
}

body.dark-mode .dev-info h3 {
    color: #fff;
}

.dev-school {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

.dev-links {
    display: flex;
    gap: 12px;
}

.dev-link {
    color: var(--text-main);
    font-size: 1.3rem;
    transition: color 0.2s;
}

.dev-link:hover {
    color: var(--accent);
}

/* Footer */
footer {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 40px 0;
    font-size: 0.9rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

/* Animations */
[data-animate] {
    opacity: 0;
    transform: translateY(40px) scale(0.98);
    transition: opacity 0.8s cubic-bezier(0.22, 1, 0.36, 1), transform 0.8s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

[data-animate].active {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.delay-100 { transition-delay: 0.1s; }
.delay-200 { transition-delay: 0.2s; }
.delay-300 { transition-delay: 0.3s; }

/* Responsive */
@media (max-width: 992px) {
    .hero-content h1 { font-size: 2.8rem; }
    .about-grid, .contact-wrapper { grid-template-columns: 1fr; }
    .extra-activities { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .hero {
        background-attachment: scroll; /* Fix for mobile browsers */
    }

    .navbar .container {
        position: relative;
    }
    
    .nav-links {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        flex-direction: column;
        padding: 40px 0;
        box-shadow: var(--shadow-lg);
        transform: translateY(-150%);
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
        gap: 24px;
        border-bottom: 1px solid var(--accent);
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-controls {
        border: none;
        margin: 0;
        padding: 0;
        justify-content: center;
        width: 100%;
    }

    .hamburger {
        display: block;
    }

    .hero-content h1 { font-size: 2.2rem; }
    .hero-content p { font-size: 1rem; }
    .section { padding: 50px 0; } /* Reduced padding */
    .section-title { font-size: 1.8rem; margin-bottom: 30px; }
    
    /* Mobile Alumni */
    .alumni-section {
        overflow-x: auto;
        padding: 10px 0 0 0;
    }

    .marquee-container {
        overflow-x: auto;
        padding: 0 0 10px 0;
        background: transparent !important;
        box-shadow: none;
    }

    .marquee-track {
        display: flex;
        gap: 12px;
        min-width: 100vw;
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: stretch;
        padding: 0 8px;
    }

    .alumni-card {
        background: rgba(255,255,255,0.13) !important;
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        border: 1.5px solid var(--accent);
        box-shadow: 0 2px 8px rgba(0,0,0,0.10);
        min-width: 120px;
        max-width: 130px;
        padding: 10px 8px 16px 8px;
        margin: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        transition: box-shadow 0.2s;
    }

    .alumni-card img {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        border: 2px solid var(--accent);
        margin-bottom: 8px;
        object-fit: cover;
        background: #fff;
    }

    .alumni-card h4 {
        color: var(--accent);
        text-shadow: 0 1px 4px rgba(0,0,0,0.18);
        font-weight: 700;
        font-size: 0.95rem;
        margin-bottom: 2px;
        text-align: center;
    }

    .alumni-card p {
        font-size: 0.7rem;
        color: var(--text-light);
        text-align: center;
        margin: 0;
        font-weight: 400;
    }
    
    .contact-wrapper {
        padding: 20px;
        gap: 30px;
    }
    
    .map-container iframe {
        height: 250px;
    }

    /* Mobile Developers */
    .developer-card {
        width: 100%;
        min-width: auto;
        padding: 16px;
    }
}
