/* ZambiaFiles v3 - Main Stylesheet
   Consolidated from previous versions and optimized
   Last updated: April 16, 2025
*/

:root {
    /* Color Variables */
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --primary-light: #eaefff;
    --primary-lighter: #f5f7ff;
    --secondary: #f8f9fa;
    --success: #2ecc71;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --dark: #343a40;
    --light: #f8f9fa;
    --white: #ffffff;
    --text-dark: #343a40;
    --text-light: #6c757d;
    --border-color: #e1e5eb;
    --shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --transition: all 0.3s ease;
    
    /* Spacing Variables */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-xxl: 3rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-round: 50%;

    /* Layout */
    --site-header-height: 70px;
}

/* Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: #f5f8fe;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: var(--site-header-height);
}

h1, h2, h3, h4, h5, h6 {
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    color: var(--text-dark);
}

a {
    text-decoration: none;
    color: var(--primary);
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
}

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

@keyframes slideInRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
    from { transform: translateX(-50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-15px); }
    100% { transform: translateY(0px); }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ===== LAYOUT COMPONENTS ===== */

/* Container */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header Styles */
header {
    background-color: transparent;
    box-shadow: none;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    height: auto;
    padding: 0.75rem 0;
}

.main-content {
    padding-top: calc(var(--site-header-height, 70px) + 24px);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
}

.topbar {
    padding: 0.85rem 1rem;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(14px);
    box-shadow: 0 16px 30px rgba(15, 23, 42, 0.08);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
}

.logo-icon {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon img {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    object-fit: contain;
    display: block;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Navigation */
nav {
    display: block;
}

nav ul {
    display: flex;
    gap: var(--spacing-lg);
}

nav a {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border-radius: 10px;
    position: relative;
    transition: var(--transition);
}

nav a::after {
    display: none;
}

nav a:hover {
    color: var(--text-dark);
    background-color: rgba(15, 23, 42, 0.06);
}

nav a.active {
    color: var(--primary);
}

nav a.active {
    color: var(--primary);
}

.header-buttons {
    display: flex;
    gap: var(--spacing-md);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-dark);
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    transition: var(--transition);
    position: relative;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1001;
}

/* Ensure mobile menu toggle is hidden on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    /* Hide mobile menu backdrop on desktop */
    .mobile-menu-backdrop {
        display: none !important;
    }
    
    /* Ensure nav is visible on desktop - only override mobile-specific properties */
    nav {
        position: static !important;
        transform: none !important;
        background-color: transparent !important;
        box-shadow: none !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        top: auto !important;
        left: auto !important;
        width: auto !important;
    }
}

.mobile-menu-toggle:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

/* Mobile Menu Backdrop */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 998;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Hamburger Icon
   Expected HTML structure:
   <button class="mobile-menu-toggle">
       <span class="hamburger"></span>
   </button>
*/
.mobile-menu-toggle .hamburger {
    width: 20px;
    height: 2px;
    background-color: currentColor;
    position: relative;
    transition: var(--transition);
}

.mobile-menu-toggle .hamburger::before,
.mobile-menu-toggle .hamburger::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    background-color: currentColor;
    transition: var(--transition);
}

.mobile-menu-toggle .hamburger::before {
    top: -6px;
}

.mobile-menu-toggle .hamburger::after {
    bottom: -6px;
}

/* Hamburger Animation */
.mobile-menu-toggle.active .hamburger {
    background-color: transparent;
}

.mobile-menu-toggle.active .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.mobile-menu-toggle.active .hamburger::after {
    bottom: 0;
    transform: rotate(-45deg);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    padding: 4rem 2rem 2rem;
    margin-top: 4rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.footer-logo-icon {
    width: 40px;
    height: 40px;
    background-color: white;
    color: var(--primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.footer-logo-text {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.footer-about {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
    max-width: 300px;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.social-icon {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    text-decoration: none;
}

.social-icon:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.footer-title {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--primary);
}

.footer-links {
    list-style: none;
}

.footer-link {
    margin-bottom: 0.8rem;
}

.footer-link a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-link a:hover {
    color: white;
    padding-left: 5px;
}

.contact-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.contact-icon {
    color: var(--primary);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* ===== UI COMPONENTS ===== */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 0.9rem;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px rgba(67, 97, 238, 0.2);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
    color: white;
}

.btn-secondary {
    background-color: var(--secondary);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--light);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1rem;
}

/* Cards */
.card {
    background-color: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    transition: var(--transition);
    border: 1px solid rgba(0, 0, 0, 0.02);
}

.card:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.card-body {
    padding: var(--spacing-md) 0;
}

.card-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding-top: var(--spacing-md);
    margin-top: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--white);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: 15px;
    color: #aaa;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.form-check-input {
    width: 18px;
    height: 18px;
}

.form-check-label {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Alerts */
.alert {
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    font-size: 14px;
}

.alert-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* ===== HOME PAGE COMPONENTS ===== */

/* Hero Section */
.library-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 8rem 2rem 5rem;
    position: relative;
    overflow: hidden;
    text-align: center;
}

.hero-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: white;
}

.hero-subtitle {
    font-size: 1.25rem;
    max-width: 800px;
    margin: 0 auto 2rem;
    opacity: 0.9;
}

/* Search Container */
.search-container {
    background-color: var(--white);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    margin: -2rem auto 2rem;
    max-width: 1000px;
    position: relative;
    z-index: 10;
}

.search-title {
    text-align: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-dark);
}

.search-form {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-input {
    flex: 1;
    padding: 1rem 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.search-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.search-filter {
    padding: 0.5rem 1rem;
    border-radius: 30px;
    background-color: var(--secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.search-filter:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.search-filter.active {
    background-color: var(--primary);
    color: white;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 3rem auto;
    max-width: 1200px;
}

.stat-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.stat-header {
    margin-bottom: 1.5rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background-color: var(--primary-light);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
}

.stat-card h3 {
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem;
}

.value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.stat-footer {
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Collections Section */
.collections-section {
    margin: 4rem auto;
    max-width: 1200px;
}

.section-title {
    text-align: center;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 2rem;
}

.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.collection-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.collection-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.collection-image {
    height: 180px;
    overflow: hidden;
}

.collection-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.collection-card:hover .collection-image img {
    transform: scale(1.05);
}

.collection-content {
    padding: 1.5rem;
}

.collection-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.collection-description {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.collection-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-light);
}

/* Library Tabs */
.library-tabs-section {
    margin: 3rem auto;
    max-width: 1200px;
}

.view-tabs {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.view-tab {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background-color: var(--secondary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.view-tab:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.view-tab.active {
    background-color: var(--primary);
    color: white;
}

/* Filters Section */
.filters-section {
    margin: 2rem auto;
    max-width: 1200px;
}

.filters-container {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.filters-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

.filter-reset {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    background-color: var(--primary-lighter);
    color: var(--primary);
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.filter-reset:hover {
    background-color: var(--primary-light);
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.filter-group {
    margin-bottom: 1rem;
}

.filter-label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-option {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    background-color: var(--secondary);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
}

.filter-option:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.filter-option.active {
    background-color: var(--primary);
    color: white;
}

.filter-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    color: var(--text-dark);
}

/* Library Content */
.library-content {
    margin: 2rem auto;
    max-width: 1200px;
}

.library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.library-card {
    background-color: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.library-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.library-cover {
    height: 200px;
    position: relative;
    overflow: hidden;
}

.library-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.library-card:hover .library-cover img {
    transform: scale(1.05);
}

.library-type {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.library-type.pdf {
    background-color: #f8d7da;
    color: #721c24;
}

.library-type.ebook {
    background-color: #d4edda;
    color: #155724;
}

.library-type.doc {
    background-color: #d1ecf1;
    color: #0c5460;
}

.library-type.audio {
    background-color: #e2d9f3;
    color: #5b3da2;
}

.library-content-inner {
    padding: 1.5rem;
    flex-grow: 1;
}

.library-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.library-author {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.library-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.rating-stars {
    color: #f39c12;
    font-size: 0.9rem;
}

.library-year {
    font-size: 0.9rem;
    color: var(--text-light);
}

.library-actions {
    padding: 1rem 1.5rem;
    display: flex;
    gap: 1rem;
    background-color: var(--secondary);
}

.library-btn {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.library-btn.preview {
    background-color: var(--white);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.library-btn.preview:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.library-btn.download {
    background-color: var(--primary);
    color: white;
}

.library-btn.download:hover {
    background-color: var(--primary-dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination-item, .pagination-arrow {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination-item {
    background-color: var(--white);
    color: var(--text-dark);
    font-weight: 500;
}

.pagination-item:hover {
    background-color: var(--primary-light);
    color: var(--primary);
}

.pagination-item.active {
    background-color: var(--primary);
    color: white;
}

.pagination-arrow {
    background-color: var(--white);
    color: var(--text-dark);
}

.pagination-arrow:hover:not(.disabled) {
    background-color: var(--primary-light);
    color: var(--primary);
}

.pagination-arrow.disabled {
    background-color: var(--secondary);
    color: var(--text-light);
    cursor: not-allowed;
}

/* ===== USER DASHBOARD COMPONENTS ===== */

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
    margin-top: 70px;
    background-color: #f8faff;
    width: 100%;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: var(--white);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: calc(100vh - 70px);
    overflow-y: auto;
    z-index: 10;
    transition: transform 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.03);
}

.sidebar-menu {
    padding: var(--spacing-xl) var(--spacing-md);
}

.menu-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-light);
    font-weight: 600;
    padding: var(--spacing-sm) var(--spacing-lg);
    margin-top: var(--spacing-lg);
    letter-spacing: 0.8px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.menu-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-lg);
    color: var(--text-dark);
    transition: var(--transition);
    cursor: pointer;
    border-radius: var(--radius-md);
    margin: var(--spacing-xs) 0;
}

.menu-item.active {
    background: var(--primary-light);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.15);
}

.menu-item:hover:not(.active) {
    background: var(--primary-lighter);
    color: var(--primary);
    transform: translateX(4px);
}

.menu-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
    color: inherit;
}

.menu-label {
    font-size: 0.95rem;
    font-weight: 500;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    padding: var(--spacing-md);
    width: calc(100% - 260px);
    overflow-x: hidden;
}

.dashboard-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    width: 100%;
}

/* Welcome Card */
.welcome-card {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary);
    position: relative;
    overflow: hidden;
    width: 100%;
    transition: var(--transition);
}

.welcome-avatar {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-round);
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 3px solid var(--white);
}

.welcome-content {
    flex-grow: 1;
    padding: 0 var(--spacing-md);
}

.welcome-stats {
    display: flex;
    gap: var(--spacing-sm);
    flex-shrink: 0;
}

.welcome-stat {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-xs) var(--spacing-sm);
    background: rgba(255, 255, 255, 0.9);
    color: var(--primary);
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

/* Dashboard Card */
.dashboard-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow);
    transition: var(--transition);
    width: 100%;
    border: 1px solid rgba(0, 0, 0, 0.02);
    position: relative;
    overflow: hidden;
}

.card-action {
    font-size: 0.9rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    cursor: pointer;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

/* File Categories */
.file-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    width: 100%;
}

.category-item {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: var(--transition);
    border-left: 3px solid transparent;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.category-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Activity Feed */
.activity-feed {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.activity-item {
    display: flex;
    gap: var(--spacing-md);
    padding: var(--spacing-md) 0;
    border-bottom: 1px solid var(--primary-lighter);
    width: 100%;
}

.activity-icon {
    width: 42px;
    height: 42px;
    border-radius: var(--radius-round);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    margin-top: var(--spacing-md);
    width: 100%;
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: var(--spacing-md);
}

/* Storage Usage */
.storage-usage {
    margin-top: var(--spacing-lg);
    background-color: var(--primary-lighter);
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    width: 100%;
}

.storage-bar {
    height: 8px;
    background-color: var(--white);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: var(--spacing-sm);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.storage-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(to right, var(--primary), var(--info));
}

/* ===== DARK MODE STYLES ===== */

/* Dark Mode Toggle */
.dark-mode-toggle {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--primary);
    color: var(--white);
    border: none;
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.16);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
    z-index: 90;
}

.dark-mode-toggle:hover {
    transform: scale(1.05);
}

/* Dark Mode */
body.dark-mode {
    background-color: #121212;
}

body.dark-mode header,
body.dark-mode .search-container,
body.dark-mode .stat-card,
body.dark-mode .collection-card,
body.dark-mode .library-card,
body.dark-mode .filters-container,
body.dark-mode .dashboard-sidebar,
body.dark-mode .dashboard-card,
body.dark-mode .welcome-card {
    background-color: #1f2737;
    color: #e1e1e1;
}

body.dark-mode .library-actions {
    background-color: #2a2f45;
}

body.dark-mode .hero-title,
body.dark-mode .section-title,
body.dark-mode .search-title,
body.dark-mode .card-title,
body.dark-mode .collection-title,
body.dark-mode .library-title,
body.dark-mode h1, 
body.dark-mode h2, 
body.dark-mode h3, 
body.dark-mode h4, 
body.dark-mode h5, 
body.dark-mode h6 {
    color: #e1e1e1;
}

body.dark-mode .hero-subtitle,
body.dark-mode .search-input,
body.dark-mode .collection-description,
body.dark-mode .library-author,
body.dark-mode .form-control,
body.dark-mode .text-light {
    color: #a0a0a0;
}

body.dark-mode .search-input,
body.dark-mode .form-control {
    background-color: #252942;
    border-color: #3a3f58;
}

body.dark-mode .view-tab:not(.active),
body.dark-mode .filter-option:not(.active),
body.dark-mode .search-filter:not(.active),
body.dark-mode .pagination-item:not(.active),
body.dark-mode .pagination-arrow:not(.disabled) {
    background-color: #2a2f45;
    color: #a0a0a0;
}

body.dark-mode .view-tab.active,
body.dark-mode .filter-option.active,
body.dark-mode .search-filter.active,
body.dark-mode .pagination-item.active {
    background-color: var(--primary);
    color: white;
}

body.dark-mode .library-btn.preview {
    background-color: #2a2f45;
    color: #e1e1e1;
    border-color: #3a3f58;
}

body.dark-mode .dark-mode-toggle {
    background-color: #3a3f58;
    color: #e1e1e1;
}

body.dark-mode .mobile-menu-toggle {
    color: #e1e1e1;
}

body.dark-mode .mobile-menu-toggle:hover {
    background-color: #3a3f58;
    color: var(--primary);
}

body.dark-mode .upload-area {
    border-color: #3a3f58;
}

body.dark-mode .storage-usage {
    background-color: #252942;
}

body.dark-mode .storage-bar {
    background-color: #3a3f58;
}

body.dark-mode nav a {
    color: var(--white);
}

body.dark-mode .topbar {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(255, 255, 255, 0.12);
}

body.dark-mode nav a:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Optional: Adjust hover/active states if needed */
body.dark-mode nav a:hover,
body.dark-mode nav a.active {
    /* Keep the primary color for hover/active, or change if desired */
    color: var(--primary); 
    /* Or maybe a lighter shade for better contrast on dark bg? e.g., color: #aaa; */
}

/* ===== RESPONSIVE STYLES ===== */

@media (max-width: 1200px) {
    .hero-title {
        font-size: 2.5rem;
    }
    .hero-subtitle {
        font-size: 1.1rem;
    }
    .collections-grid,
    .library-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
}

@media (max-width: 992px) {
    .hero-title {
        font-size: 2rem;
    }
    .search-form {
        flex-direction: column;
    }
    .welcome-card {
        flex-direction: column;
        text-align: center;
    }
    .welcome-stats {
        margin-top: 1rem;
    }
    .dashboard-main {
        margin-left: 0;
        width: 100%;
    }
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    .dashboard-sidebar.active {
        transform: translateX(0);
    }
}

@media (max-width: 768px) {
    .header-container {
        position: relative;
    }
    .mobile-menu-toggle {
        display: flex !important;
        justify-content: center;
        align-items: center;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        z-index: 1001;
    }
    nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        padding: 1.5rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        transform: translateY(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
        z-index: 999;
        max-height: calc(100vh - 70px);
        overflow-y: auto;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
    nav.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    body.dark-mode nav {
        background-color: #1f2737;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    body.dark-mode nav.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    nav ul {
        flex-direction: column;
        gap: 1rem;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    nav.active ul {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    nav a {
        padding: 1rem;
        border-radius: var(--radius-md);
        background-color: var(--primary-lighter);
        transition: var(--transition);
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    nav a:hover {
        background-color: var(--primary-light);
        transform: translateX(5px);
    }
    nav a.active {
        background-color: var(--primary);
        color: white;
    }
    body.dark-mode nav a {
        background-color: #2a2f45;
        color: #e1e1e1;
    }
    body.dark-mode nav a:hover {
        background-color: #3a3f58;
    }
    body.dark-mode nav a.active {
        background-color: var(--primary);
        color: white;
    }
    .header-buttons {
        display: none;
    }
    .search-container {
        margin-top: -1rem;
        padding: 1.5rem;
    }
    .search-filters {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        flex-wrap: nowrap;
    }
    .filters-grid {
        grid-template-columns: 1fr;
    }
    .file-categories {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }
    .search-title {
        font-size: 1.25rem;
    }
    .stat-card {
        padding: 1.5rem;
    }
    .value {
        font-size: 1.5rem;
    }
    .section-title {
        font-size: 1.5rem;
    }
    .footer-container {
        grid-template-columns: 1fr;
    }
}
/* Loading Skeleton Styles */
.loading-skeleton {
    padding: 2rem 0;
}

.skeleton-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.skeleton-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
}

.skeleton-content {
    padding: 1.5rem;
}

.skeleton-title {
    height: 24px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.skeleton-text {
    height: 16px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 4px;
    margin-bottom: 0.75rem;
}

.skeleton-text:last-child {
    width: 70%;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Dark mode skeleton styles */
body.dark-mode .skeleton-card {
    background: var(--dark-card-bg, #2a2a2a);
}

body.dark-mode .skeleton-image,
body.dark-mode .skeleton-title,
body.dark-mode .skeleton-text {
    background: linear-gradient(90deg, #3a3a3a 25%, #4a4a4a 50%, #3a3a3a 75%);
    background-size: 200% 100%;
}

/* Empty state styling */
.empty-state-card {
    text-align: center;
    padding: 3rem 2rem;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}

.empty-state-card i {
    font-size: 3rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state-card h3 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.empty-state-card p {
    color: var(--text-light);
}

body.dark-mode .empty-state-card {
    background: var(--dark-card-bg, #2a2a2a);
}

body.dark-mode .empty-state-card h3 {
    color: var(--dark-text, #e0e0e0);
}

body.dark-mode .empty-state-card p {
    color: var(--dark-text-secondary, #a0a0a0);
}

