:root {
    --primary-red: #A61F24;
    --accent-gold: #D4AF37;
    --text-white: #FFFFFF;
    --text-dark: #333333;
    --bg-light: #F9F9F9;
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    color: var(--text-dark);
    background-color: var(--bg-light);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

/* Header */
header {
    background-color: var(--primary-red);
    color: var(--text-white);
    padding: 0;
}

.header-container {
    display: flex;
    flex-direction: column;
    max-width: 1200px;
    margin: 0 auto;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 20px;
    height: 70px;
}

.logo img {
    height: 50px;
    width: auto;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    flex: 1;
    max-width: 600px;
    margin-left: 2rem;
}

.search-bar input {
    padding: 0.5rem 1rem;
    border-radius: 4px 0 0 4px;
    /* Squared corners for seamless look */
    border: none;
    outline: none;
    width: 100%;
    font-size: 0.9rem;
}

.search-bar button {
    background: #F37021;
    /* Orange CTA color from example */
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 1.5rem;
    height: 38px;
    /* Match input height */
    cursor: pointer;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-bottom {
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-secondary ul {
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-secondary a {
    display: block;
    color: #333;
    /* Dark text for white background */
    font-weight: 500;
    font-size: 0.9rem;
    padding: 1rem 0.5rem;
    position: relative;
    transition: color 0.3s;
}

.nav-secondary a:hover {
    color: var(--primary-red);
}

.nav-secondary a:hover::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--accent-gold);
}

/* Hero Section */
.hero {
    position: relative;
    height: 500px;
    background-image: url('../assets/hero.png');
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
    padding: 20px;
}

.hero h1 {
    font-size: 3rem;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.6);
}

.hero-search {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 5px;
    display: flex;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
}

.hero-search input {
    flex: 1;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.hero-search button {
    padding: 15px 30px;
    background-color: var(--primary-red);
    color: white;
    border: none;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

.nav-secondary {
    position: relative;
    /* Ensure mega menu positions relative to this */
}

.nav-secondary .has-dropdown {
    position: static;
    /* Allows mega menu to stretch full width of the nav/container */
}

.mega-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Enhanced shadow */
    display: none;
    z-index: 1000;
    border-top: 2px solid var(--primary-red);
    /* Branding accent */
}

.nav-secondary .has-dropdown:hover .mega-menu {
    display: block;
}

.mega-menu-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    min-height: 350px;
    /* Minimal height for professional look */
    background: #fff;
}

/* Sidebar Styles */
.mega-menu-sidebar {
    width: 250px;
    background-color: #f7f9fa;
    border-right: 1px solid #eee;
    padding: 10px 0;
    flex-shrink: 0;
}

.menu-tab {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #444;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.menu-tab i {
    font-size: 0.8rem;
    color: #999;
}

.menu-tab:hover,
.menu-tab.active {
    background-color: #ffffff;
    color: var(--primary-red);
    border-left-color: var(--primary-red);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.menu-tab.active i {
    color: var(--primary-red);
}

/* Content Panel Styles */
.mega-menu-main {
    flex-grow: 1;
    padding: 25px 40px;
    background: #fff;
}

.mega-menu-panel {
    display: none;
    animation: fadeIn 0.2s ease;
}

.mega-menu-panel.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.mega-menu-panel h4 {
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: 700;
}

.mega-menu-panel .panel-links-grid {
    display: grid;
    grid-template-columns: 1fr;
    /* Single column for links */
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.panel-links-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    list-style: none;
    padding: 0;
}

.mega-menu-panel li a {
    color: #555;
    font-size: 0.95rem;
    text-decoration: none;
    transition: color 0.2s;
    display: inline-block;
}

.mega-menu-panel li a:hover {
    color: var(--primary-red);
    transform: translateX(3px);
}



.header-bottom {
    position: relative;
    /* Context for absolute positioning of mega menu */
}

/* Sections */
.section {
    padding: 4rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* College List Page Layout */
.page-container {
    display: flex;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 20px;
    gap: 2rem;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.filter-box {
    background: white;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filter-box h3 {
    margin-bottom: 1rem;
    color: var(--primary-red);
    border-bottom: 2px solid var(--accent-gold);
    padding-bottom: 0.5rem;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-group h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #555;
    font-weight: 600;
}

.filter-group label {
    display: block;
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.3rem;
    cursor: pointer;
}

.filter-group input {
    margin-right: 0.5rem;
}

.filter-search {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-bottom: 10px;
    font-size: 0.9rem;
    outline: none;
}

.filter-search:focus {
    border-color: var(--primary-red);
}

.filter-option {
    display: block;
    /* Ensure options stack vertically */
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.3rem;
    cursor: pointer;
}

.college-list-section {
    flex: 1;
}

.page-title {
    font-size: 1.8rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--primary-red);
    padding-left: 1rem;
}

.college-card {
    display: flex;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.3s;
}

.college-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.college-logo {
    width: 120px;
    flex-shrink: 0;
    text-align: center;
    margin-right: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-placeholder {
    width: 80px;
    height: 80px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-bottom: 0.5rem;
    color: var(--primary-red);
    font-size: 2rem;
    border: 1px solid #ddd;
}

.img-caption {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

.college-info {
    flex: 1;
}

.college-header h2 {
    font-size: 1.3rem;
    color: var(--primary-red);
    margin-bottom: 0.3rem;
}

.location {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.8rem;
    display: block;
}

.college-rating {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.badge-rating {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: bold;
}

.reviews {
    font-size: 0.85rem;
    color: #555;
    text-decoration: underline;
}

.rank {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    border: 1px solid #ffeeba;
}

.college-details p {
    font-size: 0.9rem;
    margin-bottom: 0.3rem;
    color: #444;
}

.college-actions {
    width: 180px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding-left: 1.5rem;
    border-left: 1px solid #eee;
    justify-content: center;
}

.btn-primary {
    display: block;
    background: #337ab7;
    /* Blue like Shiksha */
    color: white;
    /* Changed to match typical primary buttons, user asked for "like Shiksha" which uses Orange/Blue */
    text-align: center;
    padding: 0.6rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #286090;
}

.btn-secondary {
    display: block;
    background: white;
    color: var(--text-dark);
    text-align: center;
    padding: 0.6rem 0;
    border-radius: 4px;
    font-size: 0.9rem;
    border: 1px solid #ccc;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #f9f9f9;
}

.btn-outline {
    display: block;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-outline input {
    vertical-align: middle;
}

@media (max-width: 768px) {
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 1rem;
    }

    .college-card {
        flex-direction: column;
    }

    .college-logo,
    .college-actions {
        width: 100%;
        text-align: center;
        margin: 0;
        padding: 0;
        border: none;
    }

    .college-logo {
        margin-bottom: 1rem;
        flex-direction: row;
        gap: 1rem;
        justify-content: flex-start;
    }

    .college-actions {
        margin-top: 1rem;
        flex-direction: row;
    }

    .college-actions a {
        flex: 1;
    }
}

.section-title {
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--primary-red);
    font-size: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-gold);
    margin: 10px auto 0;
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    border-bottom: 3px solid var(--accent-gold);
}

.slide-in-left.visible,
.slide-in-right.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Mobile Responsiveness */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
    /* Dark grey for visibility against white or red */
    cursor: pointer;
    margin-left: auto;
    /* Push to right */
    padding: 10px;
    /* Increase clickable area */
}

@media (max-width: 992px) {
    .header-top {
        padding: 10px 20px;
        position: relative;
        /* Ensure toggles are positioned relative if needed */
        z-index: 1001;
        /* Above the menu */
    }

    .header-top .search-bar {
        display: none;
    }

    /* Mobile Header adjustments */
    .header-container {
        position: relative;
        /* Ensure absolute menu positions relative to this or header-bottom */
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: auto;
    }

    /* Mobile Navigation Drawer - Professional Off-Canvas (Right Side) */
    /* Mobile Navigation Dropdown (Full Width) */
    /* Mobile Navigation Dropdown (Full Width) */
    .nav-secondary {
        display: none;
        position: absolute;
        top: 100%;
        /* Align to bottom of header-bottom (which sits below header-top) */
        left: 0;
        width: 100%;
        /* Match container width */
        background: #ffffff;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        z-index: 2000;
        border-top: 2px solid var(--primary-red);
        padding: 0;
    }

    .nav-secondary.active {
        display: block;
        animation: slideDown 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    }

    .nav-secondary ul li a {
        padding: 15px 20px;
        border-bottom: 1px solid #f0f0f0;
    }

    /* Menu Overlay */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        /* Semi-transparent black */
        z-index: 1500;
        /* Below menu, above everything else */
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
        backdrop-filter: blur(2px);
        /* Premium glass effect */
    }

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    /* Close Button Removed */
    /* Close Button Logic Removed */
    .menu-close-btn {
        display: none;
    }

    /* End of First Mobile Block - Merging with next block */

    .nav-secondary ul {
        flex-direction: column;
        text-align: left;
    }

    .nav-secondary ul li {
        border-bottom: 1px solid #eee;
        width: 100%;
    }

    .nav-secondary ul li a {
        display: block;
        padding: 15px 20px;
    }

    /* Mega Menu on Mobile (Accordion) */
    .mega-menu {
        position: static;
        /* Relative flow for accordion */
        display: none;
        box-shadow: none;
        border-top: none;
        padding: 0;
        /* Remove container padding, let items handle it */
        background: #f9f9f9;
        border-bottom: 1px solid #eee;
    }

    .mega-menu.active {
        display: block;
    }

    .mega-menu-content,
    .mega-menu-container {
        display: block;
        /* Disable flex */
        padding: 0;
    }

    /* Hide the Desktop Tab Sidebar on Mobile */
    .mega-menu-sidebar {
        display: none;
    }

    /* Stack the Content Panels */
    .mega-menu-main {
        width: 100%;
        padding: 0;
        background: transparent;
    }

    /* Force show all panels or style them as list blocks */
    .mega-menu-panel {
        display: block !important;
        /* Override 'none' from desktop tabs */
        padding: 15px 20px;
        border-bottom: 1px solid #e0e0e0;
        animation: none;
        /* No fade in needed for static stack */
    }

    .mega-menu-panel:last-child {
        border-bottom: none;
    }

    /* Adjust list styles inside panels */
    .mega-menu-panel .panel-links-grid,
    .mega-menu-panel .panel-links-list {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding-left: 10px;
        /* Indent links */
    }

    .menu-column {
        padding: 15px 20px;
        border-bottom: 1px solid #e0e0e0;
    }

    .menu-column:last-child {
        border-bottom: none;
    }

    .menu-column h4 {
        margin-bottom: 10px;
        color: var(--primary-red);
        font-size: 0.95rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .menu-column ul {
        padding-left: 10px;
    }

    .menu-column ul li {
        border-bottom: none;
        margin-bottom: 8px;
    }

    .menu-column ul li a {
        padding: 5px 0;
        font-size: 0.9rem;
        color: #555;
        border-bottom: none;
    }

    /* Hero Section Mobile */
    .hero h1 {
        font-size: 2rem;
        padding: 0 1rem;
    }

    .hero-search {
        flex-direction: column;
        width: 90%;
        border-radius: 8px;
    }

    .hero-search input,
    .hero-search button {
        width: 100%;
        border-radius: 8px;
        margin-bottom: 0.5rem;
    }

    /* College List Mobile */
    .page-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-bottom: 2rem;
    }

    .filter-box {
        margin-bottom: 2rem;
    }

    .filter-box h3 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .filter-box h3::after {
        content: '\f078';
        /* FontAwesome chevron down */
        font-family: 'Font Awesome 5 Free';
        font-weight: 900;
        font-size: 1rem;
        transition: transform 0.3s;
    }

    .filter-box.active h3::after {
        transform: rotate(180deg);
    }

    .filter-box .filter-group {
        display: none;
        /* Hide filters by default on mobile */
    }

    .filter-box.active .filter-group {
        display: block;
    }
}

/* Professional Footer */
footer {
    background-color: #1a1a1a;
    color: #f0f0f0;
    padding: 60px 0 20px;
    font-size: 0.95rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    gap: 40px;
    justify-content: space-between;
}

.footer-column {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    max-width: 150px;
    border-radius: 4px;
    /* Optional softness */
}

.footer-column h3 {
    color: var(--accent-gold);
    margin-bottom: 20px;
    font-size: 1.2rem;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-red);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #ccc;
    text-decoration: none;
    transition: color 0.3s, padding-left 0.3s;
}

.footer-links a:hover {
    color: var(--accent-gold);
    padding-left: 5px;
}

.footer-contact p {
    margin-bottom: 15px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #ccc;
}

.footer-contact i {
    color: var(--accent-gold);
    margin-top: 4px;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: background-color 0.3s, transform 0.3s;
}

.social-links a:hover {
    background-color: var(--primary-red);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #888;
    font-size: 0.85rem;
}

.college-card {
    flex-direction: column;
    text-align: center;
}

.college-logo {
    width: 100%;
    margin: 0 0 1rem 0;
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
}

.college-actions {
    width: 100%;
    border-left: none;
    border-top: 1px solid #eee;
    padding: 1rem 0 0 0;
    margin-top: 1rem;
    flex-direction: row;
    flex-wrap: wrap;
}

.college-actions a {
    flex: 1;
    min-width: 120px;
}

/* Adjust Stagger for Mobile (reduce delay or remove if too slow) */
.stagger-delay-1,
.stagger-delay-2,
.stagger-delay-3,
.stagger-delay-4,
.stagger-delay-5 {
    transition-delay: 0s;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-content {
    padding: 1.5rem;
}

.card:hover {
    transform: translateY(-5px);
}

.card-content {
    padding: 1.5rem;
}

.card h3 {
    color: var(--primary-red);
    margin-bottom: 0.5rem;
}

.btn-cta {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--primary-red);
    color: var(--accent-gold);
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    border: 2px solid var(--accent-gold);
    margin-top: 1rem;
}

.btn-cta:hover {
    background: #8e1a1f;
}

/* Footer */
footer {
    background: #222;
    color: #eee;
    padding: 3rem 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 1rem;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .hero h1 {
        font-size: 2rem;
    }
}