/* General Styles */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600&family=Roboto:wght@300;400;500;700&display=swap');

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
}

/* Navbar Styles */
nav {
    background: linear-gradient(90deg, #4b0082, #7b68ee); /* Gradient */
    color: #fff;
    padding: 0.5rem 1rem;
    position: relative;
}

.nav_container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
}

.nav_container a {
    text-decoration: none;
    color: #fff;
}

.nav_container h4 {
    font-size: 2rem;
    font-weight: 600;
    letter-spacing: 0.1rem;
    margin: 0;
    text-transform: uppercase;
    display: inline-block;
    font-family: 'Roboto', sans-serif;
}

.nav_container h6 {
    font-size: 1rem;
    font-weight: 300;
    color: #dcdcdc;
    letter-spacing: 0.05rem;
    margin: 0;
    font-family: 'Poppins', sans-serif;
}

.nav_container a:hover h4,
.nav_container a:hover h6 {
    color: #00bfae; /* Light teal for hover */
}

.nav_menu {
    list-style: none;
    display: flex;
    gap: 1rem;
    margin: 0;
    padding: 0;
}

.nav-item {
    margin: 0;
}

.navlink {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.3s ease, color 0.3s ease;
    border-radius: 5px;
}

.navlink:hover {
    background-color: #7b68ee; /* Medium Slate Blue */
    color: #fff;
}

#open-menu-btn, #close-menu-btn {
    display: none;
}

/* Header */
header {
    background: linear-gradient(to right, #008080, #00bfae); /* Teal gradient */
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #fff;
    letter-spacing: 0.2rem;
    font-family: 'Roboto', sans-serif;
}

header h1::after {
    content: "";
    display: block;
    width: 100%;
    height: 2px;
    background: #fff;
    margin-top: 0.5rem;
}

/* Category Headers (e.g. Databases, Journals) */
h2 {
    font-size: 2.2rem;
    font-weight: bold;
    color: #4b0082; /* Purple */
    text-transform: uppercase;
    letter-spacing: 0.1rem;
    padding: 0.5rem 0;
    text-align: center;
    border-bottom: 3px solid #00bfae; /* Light teal underline */
    margin-bottom: 2rem;
    font-family: 'Poppins', sans-serif;
}

/* Card Container */
.card-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: space-between;
}

/* Card Styles */
.card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    width: calc(33.333% - 1rem);
    margin-bottom: 2rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    opacity: 0.9;
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    opacity: 1;
}

.card img {
    width: 100%;
    height: auto;
    display: block;
    opacity: 0.9;
    transition: opacity 0.3s ease;
}

.card img:hover {
    opacity: 1;
}

.card-content {
    padding: 1rem;
}

.card-content h3 {
    margin: 0;
    font-size: 1.4rem;
    color: #4b0082; /* Purple */
    font-family: 'Roboto', sans-serif;
}

.card-content p {
    margin: 0.5rem 0;
    color: #666;
}

/* Visit Site Button as Glass Button */
.card-content a {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.7rem 1.5rem;
    color: #ffffff;
    background: rgba(190, 4, 184, 0.526);
    border-radius: 25px;
    text-decoration: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.card-content a:hover {
    background: #00bfae;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

/* Static "Online E-Resources" Text */
header h1 {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    color: #fff;
    font-size: 3rem;
}

/* Footer (Sticky) */
footer {
    background-color: #4b0082; /* Deep Purple */
    color: #fff;
    text-align: center;
    padding: 1rem 0;
    position: sticky;
    bottom: 0;
    left: 0;
    width: 100%;
    font-family: 'Poppins', sans-serif;
}

/* Fade-in Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.5s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .card {
        width: calc(50% - 1rem);
    }

    .nav_menu {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 60px;
        left: 0;
        background-color: #4b0082;
        padding: 1rem;
    }

    .nav_menu.active {
        display: flex;
    }

    #open-menu-btn, #close-menu-btn {
        display: block;
        background: none;
        border: none;
        color: #fff;
        font-size: 1.5rem;
        cursor: pointer;
        margin-left: auto;
    }

    #close-menu-btn {
        display: none;
    }

    .nav_menu.active #close-menu-btn {
        display: block;
    }

    .nav_menu.active #open-menu-btn {
        display: none;
    }

    .nav-item {
        margin: 0;
        text-align: center;
    }

    .navlink {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        width: 100%;
    }
}
