/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #17212b;
    color: #f5f5f5;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    padding-top: 70px; /* To prevent content from being hidden behind sticky navbar */
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Navbar styles */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(10, 17, 25, 0.92); /* Semi-transparent darker background */
    backdrop-filter: blur(10px); /* Glass effect */
    -webkit-backdrop-filter: blur(10px); /* For Safari */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(78, 174, 243, 0.15); /* Subtle border */
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 70px;
}

.logo a {
    color: #ffffff;
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    padding: 10px 0;
    position: relative;
    overflow: hidden;
}

.logo a:hover {
    color: #4eaef3;
    text-shadow: 0 0 10px rgba(78, 174, 243, 0.5);
}

.logo a:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #4eaef3;
    transform: scaleX(0);
    transform-origin: bottom right;
    transition: transform 0.5s ease;
}

.logo a:hover:before {
    transform: scaleX(1);
    transform-origin: bottom left;
}

.nav-menu {
    display: flex;
    list-style: none;
}

.nav-menu li {
    margin-left: 28px;
    position: relative;
}

.nav-menu a {
    color: #ffffff; /* Brighter white color for better contrast */
    text-decoration: none;
    font-weight: 500;
    position: relative;
    padding: 8px 0;
    transition: all 0.3s ease;
    display: inline-block;
    letter-spacing: 0.5px;
}

.nav-menu a:hover, 
.nav-menu a.active {
    color: #4eaef3;
}

.nav-menu a:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: #4eaef3;
    transition: width 0.3s cubic-bezier(0.65, 0, 0.35, 1);
}

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

/* Hamburger menu for mobile */
.menu-icon {
    display: none;
    cursor: pointer;
    padding: 10px;
    margin-left: 10px;
    transition: transform 0.3s ease;
}

.menu-icon:hover {
    transform: scale(1.05);
}

.bar1, .bar2, .bar3 {
    width: 28px;
    height: 2px;
    background-color: #ffffff;
    margin: 6px 0;
    transition: 0.4s cubic-bezier(0.68, -0.6, 0.32, 1.6);
    border-radius: 4px;
}

/* Hamburger animation */
.change .bar1 {
    transform: rotate(-45deg) translate(-5px, 6px);
    background-color: #4eaef3;
    width: 28px;
}

.change .bar2 {
    opacity: 0;
    transform: translateX(-20px);
}

.change .bar3 {
    transform: rotate(45deg) translate(-5px, -6px);
    background-color: #4eaef3;
    width: 28px;
}

/* Mobile nav menu */
@media screen and (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: 70px;
        left: -100%;
        flex-direction: column;
        background-color: rgba(10, 17, 25, 0.95); /* Match navbar but slightly more opaque */
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        width: 100%;
        text-align: center;
        transition: 0.3s cubic-bezier(0.65, 0, 0.35, 1);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
        padding: 25px 0;
        border-bottom: 1px solid rgba(78, 174, 243, 0.15);
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-menu li {
        margin: 20px 0;
    }

    .nav-menu a {
        font-size: 1.1rem;
        padding: 10px 0;
    }

    .menu-icon {
        display: block;
    }

    .bar1, .bar2, .bar3 {
        background-color: #ffffff;
    }
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 40px;
    padding-top: 30px;
    animation: fadeInDown 1s ease-out;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: #ffffff;
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    width: 0;
    height: 2px;
    background-color: #4eaef3;
    transition: all 0.5s ease;
    transform: translateX(-50%);
}

header:hover h1::after {
    width: 100px;
}

.subtitle {
    font-size: 1.1rem;
    color: #a3acb8;
    transition: color 0.3s ease;
}

header:hover .subtitle {
    color: #c5ccd6;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search container */
.search-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    flex: 1;
}

.search-box {
    width: 100%;
    max-width: 600px;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 15px 45px;
    border-radius: 50px;
    border: none;
    background-color: #242f3d;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1rem;
    transition: all 0.3s ease;
    animation: glow 3s infinite alternate;
}

#search-input:focus {
    outline: none;
    box-shadow: 0 4px 20px rgba(78, 174, 243, 0.3);
    background-color: #2b3a4b;
    animation: none;
}

/* Glowing animation for search bar */
@keyframes glow {
    0% {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 15px rgba(78, 174, 243, 0.5);
    }
}

#search-input::placeholder {
    color: #8a99a8;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a99a8;
}

.clear-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #8a99a8;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clear-icon.visible {
    opacity: 1;
}

/* Suggestions dropdown */
.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #242f3d;
    border: 1px solid rgba(78, 174, 243, 0.2);
    border-radius: 10px;
    margin-top: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    display: none;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
}

.suggestions-dropdown.show {
    display: block;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(78, 174, 243, 0.1);
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover {
    background-color: rgba(78, 174, 243, 0.1);
}

.suggestion-title {
    color: #ffffff;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.suggestion-category {
    color: #4eaef3;
    font-size: 0.8rem;
}

.highlight {
    background-color: rgba(78, 174, 243, 0.2);
    padding: 2px 0;
    border-radius: 3px;
}

@media screen and (max-width: 768px) {
    .suggestions-dropdown {
        position: fixed;
        top: 70px;
        left: 10px;
        right: 10px;
        max-height: 50vh;
    }
}

/* Category Filter */
.category-filter-container {
    max-width: 1000px;
    margin: 20px auto;
    background-color: rgba(36, 47, 61, 0.7);
    border-radius: 15px;
    padding: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(78, 174, 243, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 500px;
    overflow: hidden;
    opacity: 1;
}

/* Hidden state for category filter container */
.category-filter-container.hidden {
    max-height: 0;
    opacity: 0;
    margin: 0 auto;
    padding-top: 0;
    padding-bottom: 0;
    border-width: 0;
}

.category-filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(78, 174, 243, 0.2);
}

.category-filter-header h3 {
    color: #ffffff;
    font-size: 1.1rem;
    margin: 0;
    font-weight: 500;
}

.toggle-categories {
    background-color: transparent;
    border: none;
    color: #4eaef3;
    font-size: 1.1rem;
    cursor: pointer;
    display: none;
    padding: 5px 10px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.toggle-categories:hover {
    background-color: rgba(78, 174, 243, 0.15);
}

.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    transition: all 0.3s ease;
}

.category-btn {
    background-color: rgba(36, 47, 61, 0.9);
    color: #a3acb8;
    border: 1px solid rgba(78, 174, 243, 0.2);
    border-radius: 50px;
    padding: 8px 16px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.category-btn:hover {
    background-color: rgba(78, 174, 243, 0.15);
    color: #ffffff;
    transform: translateY(-2px);
}

.category-btn.active {
    background-color: #4eaef3;
    color: #ffffff;
    border-color: #4eaef3;
    box-shadow: 0 3px 10px rgba(78, 174, 243, 0.3);
}

/* Category display */
#category-display {
    font-size: 0.9rem;
    color: #4eaef3;
    font-weight: 500;
    animation: fadeIn 0.5s ease;
}

/* Mobile category filter */
@media screen and (max-width: 768px) {
    .toggle-categories {
        display: block;
    }

    .category-filter {
        max-height: 0;
        overflow: hidden;
        opacity: 0;
    }

    .category-filter.show {
        max-height: 500px;
        opacity: 1;
        margin-top: 10px;
    }

    .category-filter-container {
        padding: 12px;
    }
}

/* Results information */
.results-info {
    text-align: center;
    margin-bottom: 20px;
    min-height: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

#results-count {
    font-size: 0.9rem;
    color: #a3acb8;
}

/* Results container */
.results-container, .all-pdfs-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* All PDFs section */
.all-pdfs-section {
    margin-top: 40px;
    animation: fadeIn 1s ease-out 0.5s both;
}

.section-title {
    text-align: center;
    color: #ffffff;
    margin: 30px 0 20px;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 10px;
    transition: transform 0.3s ease;
}

.section-title:hover {
    transform: scale(1.02);
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #4eaef3;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.section-title:hover:after {
    width: 120px;
    background-color: #61b9ff;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* PDF Card styling */
.pdf-card {
    background-color: #242f3d;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
    padding: 25px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.pdf-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    background-color: #2b3a4b;
}

.pdf-icon {
    font-size: 2rem;
    color: #eb5757;
    margin-bottom: 15px;
    transition: transform 0.3s ease;
}

.pdf-card:hover .pdf-icon {
    transform: scale(1.1) rotate(-5deg);
}

.pdf-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 5px;
    color: #ffffff;
}

.pdf-author {
    font-size: 0.85rem;
    color: #a3acb8;
    margin-bottom: 10px;
    font-style: italic;
}

.pdf-category {
    margin-bottom: 12px;
}

.pdf-category span {
    display: inline-block;
    background-color: rgba(78, 174, 243, 0.15);
    color: #4eaef3;
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 30px;
    font-weight: 500;
    letter-spacing: 0.5px;
    border: 1px solid rgba(78, 174, 243, 0.3);
    transition: all 0.3s ease;
}

.pdf-card:hover .pdf-category span {
    background-color: rgba(78, 174, 243, 0.25);
    transform: translateY(-2px);
}

.pdf-description {
    font-size: 0.9rem;
    color: #a3acb8;
    margin-bottom: 20px;
    flex-grow: 1;
}

.download-btn {
    background-color: #4eaef3;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.download-btn:hover {
    background-color: #61b9ff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 7px 15px rgba(78, 174, 243, 0.25);
}

.download-btn:active {
    transform: translateY(1px) scale(0.98);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.view-details {
    background-color: transparent;
    color: #a3acb8;
    border: 1px solid #2c3e50;
    padding: 10px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.view-details:hover {
    color: #4eaef3;
    border-color: #4eaef3;
    background-color: rgba(78, 174, 243, 0.08);
    transform: translateY(-2px);
}

.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #4eaef3;
    font-size: 1.2rem;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

/* Empty state and initial state */
.no-results, .initial-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px 0;
    color: #a3acb8;
    display: none;
}

.no-results i, .initial-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: #4eaef3;
}

/* Load More Button */
.load-more-btn {
    display: block;
    margin: 30px auto;
    padding: 12px 24px;
    background-color: #4eaef3;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.load-more-btn:hover {
    background-color: #61b9ff;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(78, 174, 243, 0.25);
}

.load-more-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(23, 33, 43, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.loading-content {
    text-align: center;
    color: #fff;
    padding: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(78, 174, 243, 0.3);
    border-top-color: #4eaef3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-scroll {
    overflow: hidden;
    height: 100vh;
    position: fixed;
    width: 100%;
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    background-color: #0d1621;
    color: #a3acb8;
    margin-top: auto;
}

/* Media queries for responsiveness */
@media screen and (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    #search-input {
        padding: 12px 40px;
    }

    .results-container, .all-pdfs-container {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.5rem;
    }
}

@media screen and (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .container {
        padding: 15px;
    }

    .pdf-card {
        padding: 20px;
    }

    .download-btn {
        padding: 10px 15px;
    }
}