/* Main Header & Nav */
.main-header {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.logo a {
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4e73df;
}

.search-bar form {
    display: flex;
}

.search-bar input {
    padding: 0.5rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px 0 0 4px;
    width: 300px;
}

.search-bar button {
    background: #4e73df;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-nav a {
    text-decoration: none;
    color: #4b5563;
    font-weight: 500;
}

.main-nav a:hover {
    color: #4e73df;
}

/* Dropdown Menu */
.user-menu {
    position: relative;
    padding-bottom: 10px;
    /* Bridge gap */
    margin-bottom: -10px;
}

.user-menu .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    min-width: 200px;
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 0;
    z-index: 1001;
    border: 1px solid #f3f4f6;
}

.user-menu:hover .dropdown {
    display: flex;
}

.user-menu .dropdown li {
    width: 100%;
}

.user-menu .dropdown a {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #4b5563;
    transition: background 0.1s;
}

.user-menu .dropdown a:hover {
    background: #f8f9fa;
    color: #4e73df;
}

/* Global Styles */
body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    color: #4b5563;
    background-color: #f3f4f6;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: #1f2937;
    margin-top: 0;
}

a {
    transition: color 0.2s;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, #4e73df 0%, #224abe 100%);
    color: white;
    padding: 5rem 0;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-section h1 {
    color: white;
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero-section p {
    font-size: 1.25rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* Sections */
.mb-5 {
    margin-bottom: 3rem;
}

.section-header {
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 0.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    margin: 0;
    border-bottom: 3px solid #4e73df;
    display: inline-block;
    padding-bottom: 0.5rem;
    margin-bottom: -0.6rem;
}

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

.category-card {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e5e7eb;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
    border-color: #4e73df;
}

.category-card .icon {
    font-size: 2.5rem;
    color: #4e73df;
    margin-bottom: 1rem;
}

.category-card h3 {
    font-size: 1.1rem;
    margin: 0;
    color: #374151;
}

/* Documents Grid */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
    /* Increased width slightly */
    gap: 1.5rem;
}

.document-card {
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: none;
    /* Cleaner look like Scribd */
    transition: transform 0.2s;
    border: none;
    display: flex;
    flex-direction: column;
}

.document-card:hover {
    transform: none;
    box-shadow: none;
}

.doc-thumb {
    height: 250px;
    /* Reduced height */
    background: #f8f9fa;
    position: relative;
    border-bottom: none;
    padding: 20px;
    display: flex;
    align-items: flex-end;
    /* Align bottom like simple book stand */
    justify-content: center;
    border-radius: 8px;
    /* Rounded background */
}

.doc-thumb img {
    width: auto;
    height: 100%;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s;
}

.document-card:hover .doc-thumb img {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.file-type-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #2c3e50;
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 2px;
    text-transform: uppercase;
    z-index: 10;
}

.doc-info {
    padding: 1rem 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.doc-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    line-height: 1.3;
    font-weight: 700;
    color: #1a1a1a;
}

.doc-info h3 a {
    text-decoration: none;
    color: inherit;
}

.doc-info h3 a:hover {
    color: #4e73df;
}

.doc-meta-user {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 1rem;
}

.doc-stats {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 0.75rem;
    color: #666;
    font-size: 0.9rem;
}

.doc-stats i {
    margin-right: 5px;
}

/* Footer */
.main-footer {
    background: #1f2937;
    color: #f3f4f6;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-col h3 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-col ul li {
    margin-bottom: 0.75rem;
}

.footer-col a {
    color: #9ca3af;
    text-decoration: none;
}

.footer-col a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid #374151;
    padding-top: 2rem;
    text-align: center;
    color: #9ca3af;
    font-size: 0.9rem;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #4e73df;
    cursor: pointer;
    padding: 0.5rem;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {

    /* Header */
    .main-header .container {
        flex-wrap: wrap;
        position: relative;
    }

    .mobile-menu-toggle {
        display: block;
        order: 2;
    }

    .logo {
        order: 1;
    }

    .logo a {
        font-size: 1.2rem;
    }

    .search-bar {
        order: 4;
        width: 100%;
        margin-top: 1rem;
    }

    .search-bar input {
        width: 100%;
    }

    .main-nav {
        order: 3;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        display: none;
        padding: 1rem 0;
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }

    .main-nav ul li {
        width: 100%;
        border-bottom: 1px solid #f3f4f6;
    }

    .main-nav ul li a {
        display: block;
        padding: 1rem 1.5rem;
    }

    .user-menu .dropdown {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 2rem;
    }

    /* Hero Section */
    .hero-section {
        padding: 3rem 0;
    }

    .hero-section h1 {
        font-size: 2rem;
    }

    .hero-section p {
        font-size: 1rem;
    }

    /* Grids */
    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .documents-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 1rem;
    }

    .doc-thumb {
        height: 200px;
        padding: 10px;
    }

    .doc-info {
        padding: 0.75rem;
    }

    .doc-info h3 {
        font-size: 0.95rem;
    }

    .doc-meta-user {
        font-size: 0.75rem;
    }

    .doc-stats {
        font-size: 0.8rem;
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .main-footer {
        padding: 2rem 0 1rem;
    }
}

@media (max-width: 480px) {
    .documents-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .category-card {
        padding: 1.5rem;
    }

    .doc-thumb {
        height: 180px;
    }
}