/* Global Variables */
:root {
    --primary: #760b0d;
    /* Dark Red */
    --secondary: #760b0d;
    /* Same as Primary for consistency */
    --accent: #f59e0b;
    /* Amber */
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --light-text: #64748b;
}

/* Reset & Base Styles */
body {
    font-family: 'Tajawal', sans-serif;
    margin: 0;
    padding: 0;
    color: var(--dark-text);
    background: #fff;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Typography Utilities */
.text-center {
    text-align: center;
}

/* Wrapper/Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    width: 100%;
    box-sizing: border-box;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem 0;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--dark-text);
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--secondary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--secondary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(118, 11, 13, 0.3);
}

.btn-primary:hover {
    background: #5a090a;
    /* Darker shade of primary */
    transform: translateY(-1px);
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    background: transparent;
}

.btn-outline-light:hover {
    background: white;
    color: var(--primary);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Animations */
.animate-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}

.delay-1 {
    animation-delay: 0.2s;
}

.delay-2 {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sections & Grids */
.hero-section {
    background-size: cover;
    background-position: center;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    padding: 0 1rem;
    /* Prevent text touching edges on small screens */
}

.section {
    padding: 5rem 0;
}

.bg-light {
    background: #f8fafc;
}

.section-title {
    margin-bottom: 3rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary);
}

.stats-section {
    padding: 4rem 0;
    background: var(--light-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    text-align: center;
}

.stat-item i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.competitions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.sustainability-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.card-img {
    background: #eee;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-body {
    padding: 1.5rem;
}

/* Footer Specifics */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    color: white;
    font-size: 1.2rem;
}

.contact-item {
    color: #cbd5e1;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.contact-item i {
    margin-left: 0.5rem;
    color: var(--accent);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Badges */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
}

footer {
    background: var(--primary);
    color: white;
    padding: 4rem 0 2rem;
    margin-top: auto;
}

footer h3,
footer h4 {
    color: white;
}

footer a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

footer a:hover {
    color: white;
}

/* Mobile Toggle Button (Hidden by default) */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
}

/* Winner Card */
.winner-card {
    background: white;
    border-radius: 1rem !important;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    position: relative;
    margin: 10px;
    height: 100%;
}

.rank-badge {
    position: absolute;
    top: -20px;
    right: 20px;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    z-index: 2;
}

.student-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    margin: 0 auto 1.5rem;
    border: 3px solid #eee;
}

.student-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sustainability Card */
.sustainability-card {
    display: flex;
    flex-direction: row !important;
    /* Force row on desktop */
    overflow: hidden;
    border-radius: 1rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.sustainability-card .card-img {
    width: 40%;
}

.sustainability-card .card-body {
    width: 60%;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    /* Mobile Navbar */
    .mobile-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        /* Adjust based on navbar height */
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        transform: translateY(-150%);
        transition: transform 0.3s ease-in-out;
        z-index: 999;
    }

    .nav-links.active {
        transform: translateY(0);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-link {
        display: block;
        padding: 0.5rem;
    }

    /* Adjust Font Sizes */
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    /* Hero Section Fixes */
    .hero-section {
        height: auto !important;
        min-height: 60vh;
        padding: 4rem 0;
    }

    /* Card Grids */
    .stats-grid,
    .competitions-grid,
    .sustainability-grid {
        grid-template-columns: 1fr !important;
    }

    /* Footer Stack */
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    /* Mobile Adjustments for Cards */
    .sustainability-card {
        flex-direction: column !important;
    }

    .sustainability-card .card-img {
        width: 100%;
        height: 200px;
    }

    .sustainability-card .card-body {
        width: 100%;
    }
}