* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    background-color: #f5f5f5;
}

/* Search Container */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 1rem 3rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    font-size: 1rem;
    background-color: white;
}

.fa-search {
    position: absolute;
    left: 2rem;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* Universities Grid */
.universities-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
}

.university-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.university-card:hover {
    transform: translateY(-10px);
}

.image-container {
    position: relative;
    height: 200px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.location {
    position: absolute;
    bottom: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.content {
    padding: 1.5rem;
}

.university-card .content h2 { 
    font-size: 1.2rem;
    margin: 15px 0;
    color: #333;
    line-height: 1.4;
    height: 3.4em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    position: relative;
}

.university-card .content h2:hover {
    overflow: visible;
    height: auto;
    background: #fff;
    z-index: 1;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    padding: 5px;
    border-radius: 4px;
}

.description {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    height: 4.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    /* overflow: hidden; */
}

.details {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #555;
}

.details span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.learn-more {
    width: 100%;
    padding: 0.8rem;
    background-color: #6659E1;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.learn-more:hover {
    background-color: #333;
}

footer {
    background-color: #1a1a1a;
    color: white;
    text-align: center;
    padding: 1.5rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (min-width: 1200px) {
    .universities-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1199px) {
    .universities-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 1.5rem;
    }
    
    .content h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 767px) {
    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
        padding: 1rem;
    }
    
    .search-container {
        max-width: 500px;
    }
    
    .content h2 {
        font-size: 1.3rem;
    }
    
    .description {
        font-size: 0.9rem;
    }
}

@media (max-width: 576px) {
    .universities-grid {
        grid-template-columns: 1fr;
        padding: 1rem;
    }
    
    .search-container {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    #searchInput {
        padding: 1rem 2.5rem;
    }
    
    .fa-search {
        left: 2rem;
    }
    
    .content {
        padding: 1.5rem;
    }
    
    .content h2 {
        font-size: 1.2rem;
    }
    
    .details {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .learn-more {
        padding: 0.8rem;
    }
}

@media (max-width: 375px) {
    .universities-grid {
        padding: 0.8rem;
    }
    
    .image-container {
        height: 200px;
    }
    
    .content {
        padding: 1.2rem;
    }
    
    .content h2 {
        font-size: 1.1rem;
    }
    
    .description {
        font-size: 0.85rem;
    }
    
    .details {
        font-size: 0.8rem;
    }
}

@media (max-width: 320px) {
    .universities-grid {
        padding: 0.5rem;
    }
    
    .content {
        padding: 1rem;
    }
    
    .learn-more {
        padding: 0.7rem;
        font-size: 0.9rem;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .image-container {
        height: 180px;
    }
}

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .image-container img {
        image-rendering: -webkit-optimize-contrast;
    }
}

@media (max-width: 768px) {
    .university-card {
        width: 100%;
    }

    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

    .logo img {
        margin-right: 0;
        margin-bottom: 1rem;
    }
}

.edu-header {
    width: 100%;
    background-color: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
    position: fixed;
    z-index: 1000;
    top: 0;
    left: 0;
}

main {
    padding-top: 80px;
}

.edu-navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    height: 60px;
}

.edu-logo__img {
    height: 40px;
    width: auto;
    display: block;
}

.edu-nav-container {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.edu-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.edu-nav__item {
    margin: 0 15px;
    position: relative;
}

.edu-nav__link {
    color: #333333;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    padding: 10px 5px;
    display: block;
    transition: color 0.3s ease;
}

.edu-nav__link:hover,
.edu-nav__item--active .edu-nav__link {
    color: #007bff;
}

.edu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 220px;
    background-color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 10px 0;
    z-index: 100;
}

.edu-nav__item:hover .edu-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.edu-dropdown__item {
    display: block;
    padding: 10px 20px;
    color: #333333;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
}

.edu-dropdown__item:hover {
    background-color: #f8f9fa;
    color: #007bff;
    padding-left: 25px;
}

.edu-subdropdown {
    position: relative;
}

.edu-subdropdown__menu {
    position: absolute;
    top: 0;
    left: 100%;
    width: 220px;
    background-color: #ffffff;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.3s ease;
    border-radius: 5px;
    padding: 10px 0;
}

.edu-subdropdown:hover .edu-subdropdown__menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

.edu-apply {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.edu-apply__btn {
    background-color: #007bff;
    color: #ffffff;
    padding: 10px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.edu-apply__btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
}

.edu-navbar__toggler {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #333333;
    padding: 5px;
}

.edu-navbar__toggler-icon {
    display: inline-block;
    width: 1.5em;
    height: 1.5em;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100%;
}

.edu-nav-close {
    display: none;
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #333;
    cursor: pointer;
    padding: 5px;
    z-index: 1003;
}

.edu-nav-close:hover {
    color: #007bff;
}

/* Mobile Navbar Styles */
@media (max-width: 576px) {
    .edu-navbar__toggler {
        display: block;
        z-index: 1002;
    }

    .edu-nav-close {
        display: none !important;
        position: fixed;
        top: 15px;
        right: 15px;
        background: none;
        border: none;
        font-size: 24px;
        color: #333;
        cursor: pointer;
        padding: 5px;
        z-index: 1003;
        width: 40px;
        height: 40px;
        align-items: center;
        justify-content: center;
    }

    .edu-nav--open .edu-navbar__toggler {
        display: none;
    }

    .edu-nav--open .edu-nav-close {
        display: flex !important;
    }

    .edu-nav-close:hover {
        color: #007bff;
    }

    .edu-nav-container {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        width: 100%;
        height: calc(100vh - 60px);
        background-color: #ffffff;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        padding: 1rem;
        overflow-y: auto;
        z-index: 1001;
    }

    .edu-nav--open .edu-nav-container {
        display: block;
    }

    .edu-nav {
        flex-direction: column;
        align-items: flex-start;
    }

    .edu-nav__item {
        margin: 0.5rem 0;
        width: 100%;
    }

    .edu-nav__link {
        font-size: 18px;
        padding: 10px 15px;
        display: block;
        width: 100%;
        position: relative;
    }

    /* Add dropdown arrow indicator */
    .edu-nav__item:has(.edu-dropdown) .edu-nav__link::after {
        content: '▼';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .edu-nav__item--open .edu-nav__link::after {
        transform: translateY(-50%) rotate(180deg);
    }

    .edu-dropdown {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: #f8f9fa;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-top: 5px;
    }

    .edu-nav__item--open .edu-dropdown {
        display: block;
    }

    .edu-dropdown__item {
        padding: 12px 30px;
        font-size: 16px;
        position: relative;
    }

    /* Add subdropdown arrow indicator */
    .edu-subdropdown .edu-dropdown__item::after {
        content: '▶';
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 12px;
        transition: transform 0.3s ease;
    }

    .edu-subdropdown--open .edu-dropdown__item::after {
        transform: translateY(-50%) rotate(90deg);
    }

    .edu-subdropdown__menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        display: none;
        background-color: #f0f1f2;
        box-shadow: none;
        border-radius: 0;
        padding: 0;
        margin-left: 15px;
    }

    .edu-subdropdown--open .edu-subdropdown__menu {
        display: block;
    }

    .edu-subdropdown__menu .edu-dropdown__item {
        padding-left: 45px;
    }

    .edu-apply {
        display: none;
    }

    .edu-nav--open .edu-apply {
        display: flex;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }

    .edu-apply__btn {
        width: 100%;
        text-align: center;
        padding: 12px;
        font-size: 18px;
    }

    main {
        padding-top: 60px;
    }
}

@media (max-width: 992px) {
    main {
        padding-top: 70px;
    }
    
    .edu-navbar {
        height: auto;
        min-height: 60px;
    }
}


/* Update the universities-grid styles */
.universities-grid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Shows 4 cards per row */
    gap: 2rem;
}

/* Update responsive design for the grid */
@media (max-width: 1400px) {
    .universities-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1024px) {
    .universities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .universities-grid {
        grid-template-columns: 1fr;
    }
}

/* Ensure uniform card heights */
.university-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.description {
    flex: 1;
}