/* Base Styles */
:root {
    --primary-color: #c30e2e;
    --secondary-color: #0e2240;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gray-color: #6c757d;
    --white-color: #ffffff;
    --high-school-color: #4a6fa5;
    --regional-color: #c30e2e;
    --international-color: #0e2240;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--dark-color);
    padding-top: 56px;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

p, li {
    font-size: 20px !important;
    font-family: Arial, Helvetica, sans-serif;
}

.ft {
    font-size: 15px !important;
}

.lead {
    font-size: 20px;
}

.card {
    border-color: #0e2240;
}

a:hover {
    color: #8a0a21;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #8a0a21;
    border-color: #8a0a21;
}

.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);
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.text-primary {
    color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

.text-secondary {
    color: var(--secondary-color) !important;
}

/* Navigation */
.navbar {
    background-color: var(--secondary-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.navbar.scrolled {
    padding-top: 5px;
    padding-bottom: 5px;
}

.navbar-brand img {
    transition: all 0.3s ease;
}

.navbar.scrolled .navbar-brand img {
    height: 50px;
}

.nav-link {
    font-weight: 500;
    font-size: 20px;
    color: #ffffff;
    padding: 0.5rem 1rem;
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-item.dropdown:hover {
    background-color: #c30e2e; /* Light gray, change to your preferred color */
}
    
/* Position dropdown toggle to the right */
.nav-item.dropdown {
    position: relative;
}

.nav-link.dropdown-toggle::after {
    position: static;
    margin-left: 0.255em;
    vertical-align: 0.15em;
    content: "";
    border-top: 0.6em solid;
    border-right: 0.3em solid transparent;
    border-bottom: 0;
    border-left: 0.3em solid transparent;
    transition: transform 0.3s ease;
}

.nav-link.dropdown-toggle:hover::after {
    transform: rotate(-180deg);
}

.dropdown-item {
    transition: all 0.2s ease;
}
    
.dropdown-menu {
    right: 0;
    left: auto !important;
}

.dropdown-hover:hover > .dropdown-menu {
    display: block;
}

.dropdown-item:hover {
    background-color: #0e2240;
    color: #ffffff;
}

/* Ensure dropdown menus stay open during hover */
.nav-item.dropdown:hover .dropdown-menu {
    display: block !important;
}

/* Adjust dropdown positioning for better hover experience */
.dropdown-menu {
    margin-top: 0;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Smooth transition for dropdown */
.dropdown-menu {
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: block;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.nav-item.dropdown:hover .dropdown-menu {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Mobile devices should keep click behavior */
@media (max-width: 991.98px) {
    .nav-item.dropdown:hover .dropdown-menu {
        display: none !important;
    }
    
    .navbar-brand img {
        height: 50px;
    }
    
    .nav-item.dropdown.show .dropdown-menu {
        display: block !important;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    
    /* Ensure dropdown menus are hidden by default on mobile */
    .dropdown-menu {
        display: none !important;
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }
    
    /* Remove hover effects on mobile */
    .nav-item.dropdown:hover {
        background-color: transparent;
    }
    .nav-link.dropdown-toggle {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    
    .nav-link.dropdown-toggle::after {
        position: static;
        margin-left: auto;
        flex-shrink: 0;
        width: auto;
        border-top: 0.6em solid;
        border-right: 0.3em solid transparent;
        border-bottom: 0;
        border-left: 0.3em solid transparent;
        transition: transform 0.3s ease;
    }
    
    /* Rotate arrow when dropdown is open */
    .nav-item.dropdown.show .nav-link.dropdown-toggle::after {
        transform: rotate(-180deg);
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(14, 34, 64, 0.8), rgba(14, 34, 64, 0.8)), 
                url('../assets/images/hero_bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white-color);
    position: relative;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
}

.hero-section h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-section p {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.3);
}

/* Page Header */
.page-header {
    background: linear-gradient(rgba(14, 34, 64, 0.8), rgba(14, 34, 64, 0.8)), 
                url('../assets/images/page-header-bg.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--white-color);
}

.fixed-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.winner-year {
    font-weight: bolder;
    font-size: larger;
    color: #8a0a21;
}

/* Section Titles */
.section-title {
    position: relative;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Countdown Section */
.countdown-section {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.countdown-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

.countdown-box {
    text-align: center;
    margin: 0 10px;
    min-width: 100px;
}

.countdown-value {
    font-size: 3rem;
    font-weight: 700;
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 10px 20px;
    border-radius: 5px;
    margin-bottom: 5px;
}

.countdown-label {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Feature Cards */
.feature-card {
    transition: all 0.3s ease;
    border-radius: 10px;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.feature-icon {
    width: 70px;
    height: 70px;
    background-color: rgba(195, 14, 46, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.8rem;
    color: var(--primary-color);
}

/* Testimonial Cards */
.testimonial-card {
    max-width: 600px;
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.carousel-control-prev,
.carousel-control-next {
    width: 40px;
    height: 40px;
    background-color: var(--primary-color);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
}

.carousel-control-prev {
    left: -20px;
}

.carousel-control-next {
    right: -20px;
}

/* Sponsor Logos */
.sponsor-logo {
    padding: 20px;
    background-color: var(--white-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100px;
    transition: all 0.3s ease;
}

.sponsor-logo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.sponsor-logo img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.sponsor-logo:hover img {
    filter: grayscale(0%);
    opacity: 1;
}

/* Timeline */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50px; /* Start below first circle */
    left: 50px; /* Half of circle width */
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
    z-index: 0;
}

.timeline-item {
    position: relative;
    padding-left: 100px; /* Space for circle */
    margin-bottom: 40px;
    min-height: 100px;
}

.timeline-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

.timeline-date {
    position: absolute;
    left: 0;
    top: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--white-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 0 0 5px rgba(195, 14, 46, 0.2);
    text-align: center;
    padding: 15px;
    box-sizing: border-box;
    z-index: 2;
    font-size: 0.9em; /* Ensures text fits */
    line-height: 1.3;
}

.timeline-content {
    background-color: #FDC745;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-left: 30px; /* Space from circle */
    position: relative;
    z-index: 2;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 40px;
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 15px solid var(--white-color);
}

/* Problem Cards */
.problem-card {
    transition: all 0.3s ease;
    border-radius: 10px;
}

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

.problem-difficulty {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.problem-difficulty.easy {
    background-color: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.problem-difficulty.medium {
    background-color: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.problem-difficulty.hard {
    background-color: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

/* Registration Steps */
.step-card {
    position: relative;
    transition: all 0.3s ease;
    border-radius: 10px;
    border-color: #c30e2e;
    overflow: hidden;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.step-number {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.step-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(195, 14, 46, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Contact Info Cards */
.info-card {
    transition: all 0.3s ease;
    border-radius: 10px;
}

.info-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.info-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(195, 14, 46, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
    color: var(--primary-color);
}

/* Director Cards */
.director-card {
    transition: all 0.3s ease;
    border-radius: 10px;
    overflow: hidden;
}

.director-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.director-card img {
    height: 200px;
    object-fit: cover;
    transition: all 0.3s ease;
}

.director-card:hover img {
    transform: scale(1.05);
}

/* Map Container */
.map-container {
    position: relative;
    overflow: hidden;
    height: 450px;
}

.map-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Footer */
.footer {
    background-color: var(--secondary-color);
    color: var(--white-color);
}

.footer a {
    color: var(--white-color);
    opacity: 0.8;
    transition: all 0.3s ease;
}

.footer a:hover {
    opacity: 1;
    color: var(--white-color);
    text-decoration: underline;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: var(--primary-color);
    text-decoration: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fadeInUp {
    animation: fadeInUp 0.5s ease forwards;
}

/* Responsive Adjustments */
@media (max-width: 992px) {
    .hero-section h1 {
        font-size: 2.5rem;
    }
    
    .hero-section p {
        font-size: 1.2rem;
    }
    
    .countdown-value {
        font-size: 2rem;
        padding: 8px 15px;
    }
    
    .countdown-box {
        min-width: 80px;
    }
}

@media (max-width: 768px) {
    body {
        padding-top: 72px;
    }
    
    .hero-section {
        min-height: 500px;
    }
    
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .hero-section p {
        font-size: 1rem;
    }
    
    .countdown-container {
        flex-wrap: wrap;
    }
    
    .countdown-box {
        margin: 5px;
        min-width: 70px;
    }
    
    .countdown-value {
        font-size: 1.5rem;
    }
    
    .countdown-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .timeline {
        padding-left: 30px;
    }
    
    .timeline-date {
        left: -20px;
        width: 80px;
        height: 80px;
        font-size: 0.8rem;
    }
    
    .timeline-content::before {
        left: -10px;
        border-top: 10px solid transparent;
        border-bottom: 10px solid transparent;
        border-right: 10px solid var(--white-color);
    }
}

/* Level Specific Backgrounds */
.high-school-header {
    background: linear-gradient(rgba(74, 111, 165, 0.8), rgba(74, 111, 165, 0.8)), 
                url('../assets/images/high-school-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white-color);
    padding-top: 80px;
}

.regional-header {
    background: linear-gradient(rgba(195, 14, 46, 0.8), rgba(195, 14, 46, 0.8)), 
                url('../assets/images/regional-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white-color);
}

.international-header {
    background: linear-gradient(rgba(14, 34, 64, 0.8), rgba(14, 34, 64, 0.8)), 
                url('../assets/images/international-bg.jpg');
    background-size: cover;
    background-position: center;
    color: var(--white-color);
}

/* Level Specific Buttons */
.btn-high-school {
    background-color: var(--primary-color);
    border-color: var(--high-school-color);
    color: var(--white-color);
}

.btn-high-school:hover {
    background-color: #3a5a8c;
    border-color: #3a5a8c;
    color: var(--white-color);
}

.btn-outline-high-school {
    color: var(--high-school-color);
    border-color: var(--high-school-color);
}

.btn-outline-high-school:hover {
    background-color: var(--high-school-color);
    border-color: var(--high-school-color);
    color: var(--white-color);
}

.bg-high-school {
    background-color: var(--high-school-color) !important;
}

.text-high-school {
    color: var(--high-school-color) !important;
}

.btn-regional {
    background-color: var(--regional-color);
    border-color: var(--regional-color);
    color: var(--white-color);
}

.btn-regional:hover {
    background-color: #8a0a21;
    border-color: #8a0a21;
    color: var(--white-color);
}

.btn-outline-regional {
    color: var(--regional-color);
    border-color: var(--regional-color);
}

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

.bg-regional {
    background-color: var(--regional-color) !important;
}

.text-regional {
    color: var(--regional-color) !important;
}

.btn-international {
    background-color: var(--international-color);
    border-color: var(--international-color);
    color: var(--white-color);
}

.btn-international:hover {
    background-color: #08162d;
    border-color: #08162d;
    color: var(--white-color);
}

.btn-outline-international {
    color: var(--international-color);
    border-color: var(--international-color);
}

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

.bg-international {
    background-color: var(--international-color) !important;
}

.text-international {
    color: var(--international-color) !important;
}

/* Level Icons */
.level-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
    color: var(--white-color);
}

.level-icon.high-school {
    background-color: var(--high-school-color);
}

.level-icon.regional {
    background-color: var(--regional-color);
}

.level-icon.international {
    background-color: var(--international-color);
}

.feature-icon.high-school {
    background-color: rgba(74, 111, 165, 0.1);
    color: var(--high-school-color);
}

.feature-icon.regional {
    background-color: rgba(195, 14, 46, 0.1);
    color: var(--regional-color);
}

.feature-icon.international {
    background-color: rgba(14, 34, 64, 0.1);
    color: var(--international-color);
}

/* Level Cards */
.level-card {
    transition: all 0.3s ease;
    
}

.level-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Team Page Specific Styles */
.team-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.team-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1) !important;
}

.card-img-wrapper {
    position: relative;
    overflow: hidden;
}

.card-img-wrapper img {
    transition: transform 0.5s ease;
}

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

.overlay-dark {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.team-card:hover .overlay-dark {
    opacity: 1;
}

.social-links {
    transform: translateY(20px);
    transition: transform 0.3s ease;
    margin-bottom: 15px;
}

.team-card:hover .social-links {
    transform: translateY(0);
}

.social-links a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(195, 14, 46, 0.8);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.cta-section {
    background: linear-gradient(rgba(195, 14, 46, 0.9), rgba(195, 14, 46, 0.9)), 
                url('../assets/images/team-cta-bg.jpg');
    background-size: cover;
    background-position: center;
}