/* ============================================
   Modern UI/UX Fixes for E-Libraro
   Mobile-First App-Like Experience
   ============================================ */

/* Modern Font Import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* Override base font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    background: #F7F8FC;
}

/* ============================================
   1️⃣ Modern Hero Section
   ============================================ */
.hero-section-modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: 200% 200%;
    animation: gradientShift 15s ease infinite;
    padding: 3rem 0 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-section-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.hero-content-modern {
    position: relative;
    z-index: 1;
}

.hero-content-modern h1 {
    font-size: 2rem;
    font-weight: 800;
    color: white;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.hero-content-modern p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 1.75rem;
    font-weight: 400;
}

.hero-cta {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-hero {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.btn-hero.btn-primary {
    background: white;
    color: #667eea;
}

.btn-hero.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-hero.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid white;
}

.btn-hero.btn-secondary:hover {
    background: white;
    color: #667eea;
    transform: translateY(-3px);
}

@media (max-width: 767px) {
    .hero-section-modern {
        padding: 2.5rem 0 2rem;
    }

    .hero-content-modern h1 {
        font-size: 1.75rem;
    }

    .hero-content-modern p {
        font-size: 1rem;
    }

    .hero-cta {
        flex-direction: column;
        padding: 0 1rem;
    }

    .btn-hero {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}

/* ============================================
   2️⃣ Modern Stats Cards
   ============================================ */
.stats-section {
    padding: 0;
    margin-top: -1.5rem;
    position: relative;
    z-index: 10;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    max-width: 900px;
    margin: 0 auto;
}

.stat-card-modern {
    background: white;
    border-radius: 16px;
    padding: 1.5rem 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s ease;
}

.stat-card-modern:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.stat-icon-modern {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.75rem;
}

.stat-content-modern {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}

.stat-number-modern {
    font-size: 2rem;
    font-weight: 800;
    color: #2d3748;
    line-height: 1;
}

.stat-label-modern {
    font-size: 0.875rem;
    color: #718096;
    font-weight: 500;
}

@media (max-width: 767px) {
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card-modern {
        flex-direction: row;
        justify-content: flex-start;
        padding: 1.25rem;
    }

    .stat-icon-modern {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .stat-content-modern {
        align-items: flex-start;
        flex: 1;
    }

    .stat-number-modern {
        font-size: 1.75rem;
    }
}

/* ============================================
   3️⃣ Content Sections Improvements
   ============================================ */
.section {
    padding: 2.5rem 0;
}

.section-header {
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2d3748;
}

/* ============================================
   4️⃣ Floating Action Button (Upload)
   ============================================ */
.bottom-nav {
    background: white;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
    border-top: none;
}

.nav-item:nth-child(3) {
    /* Upload button - make it floating */
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    border-radius: 50%;
    width: 56px;
    height: 56px;
    transform: translateY(-20px);
    box-shadow: 0 8px 16px rgba(245, 87, 108, 0.4);
    padding: 0;
    min-width: 56px;
}

.nav-item:nth-child(3)::before {
    display: none;
}

.nav-item:nth-child(3) i {
    font-size: 1.75rem;
    margin: 0;
}

.nav-item:nth-child(3) span {
    display: none;
}

.nav-item:nth-child(3):active {
    transform: translateY(-18px) scale(0.95);
}

/* Other nav items */
.nav-item {
    color: #a0aec0;
    font-weight: 600;
}

.nav-item.active {
    color: #667eea;
}

.nav-item i {
    font-size: 1.4rem;
}

.nav-item span {
    font-size: 0.7rem;
    margin-top: 0.25rem;
}

@media (max-width: 767px) {
    .nav-item:nth-child(3) {
        width: 52px;
        height: 52px;
        transform: translateY(-18px);
    }

    .nav-item:nth-child(3) i {
        font-size: 1.5rem;
    }
}

/* ============================================
   5️⃣ Modern Login Button
   ============================================ */
.btn-login {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-login i {
    font-size: 1rem;
}

/* ============================================
   6️⃣ Typography & Spacing Improvements
   ============================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    line-height: 1.3;
    color: #2d3748;
}

p {
    line-height: 1.7;
    max-width: 65ch;
}

.section-header h2 {
    letter-spacing: -0.01em;
}

/* Better spacing */
.container {
    max-width: 1140px;
}

@media (max-width: 767px) {
    .section {
        padding: 2rem 0;
    }
}

/* ============================================
   7️⃣ Color & Visual Polish
   ============================================ */
/* Card shadows */
.book-card,
.stat-card,
.profile-card,
.dashboard-section,
.upload-card,
.category-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.book-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* Smooth animations */
.btn,
.book-card,
.nav-item,
.stat-card-modern {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern button styles */
.btn {
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

.btn-secondary:hover {
    background: #667eea;
    color: white;
}

/* ============================================
   Book Card Enhancements
   ============================================ */
.book-card {
    border-radius: 12px;
    overflow: hidden;
}

.book-cover {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.book-title {
    font-weight: 600;
    color: #2d3748;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
}

.book-author {
    color: #718096;
    font-weight: 500;
}

.book-category {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    font-weight: 600;
}

/* ============================================
   Section Backgrounds
   ============================================ */
.section-alt {
    background: white;
}

/* ============================================
   Empty State Improvements
   ============================================ */
.empty-state {
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.empty-state i {
    color: #cbd5e0;
}

.empty-state h3 {
    color: #2d3748;
}

.empty-state p {
    color: #718096;
}

/* ============================================
   Pagination Improvements
   ============================================ */
.pagination {
    gap: 0.5rem;
}

.page-link {
    background: white;
    color: #667eea;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.page-link:hover {
    background: #667eea;
    color: white;
}

.page-link.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 8px rgba(102, 126, 234, 0.3);
}

/* ============================================
   Top Bar Improvements
   ============================================ */
.top-bar {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.logo {
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* ============================================
   Mobile Optimizations
   ============================================ */
@media (max-width: 767px) {

    /* Ensure content is visible above bottom nav */
    .section:last-of-type {
        padding-bottom: calc(2rem + var(--bottom-nav-height));
    }

    /* Better touch feedback */
    .book-card:active {
        transform: scale(0.98);
    }

    .btn:active {
        transform: scale(0.97);
    }
}

/* ============================================
   Loading States
   ============================================ */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ============================================
   Accessibility Improvements
   ============================================ */
.btn:focus,
.nav-item:focus,
.page-link:focus {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}

/* ============================================
   Print Optimizations
   ============================================ */
@media print {

    .hero-section-modern,
    .stats-section {
        display: none;
    }
}