/* Custom CSS for E-Books Library */

:root {
    --primary-color: #0d6efd;
    --primary-dark: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-radius: 0.5rem;
    --box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --box-shadow-lg: 0 1rem 3rem rgba(0, 0, 0, 0.175);
    --transition: all 0.3s ease-in-out;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}
/* ============================= */
/* LOGO - HEADER */
/* ============================= */
.logo-img {
    height: 52px;
    width: auto;
    object-fit: contain;
}
.navbar-logo {
    height: 70px; /* perfect professional size */
    width: auto;
    object-fit: contain;
}
.navbar-brand {
    padding-top: 0;
    padding-bottom: 0;
}

/* Utility Classes */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fs-7 {
    font-size: 0.75rem;
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 50%, #ec4899 100%);
    position: relative;
    overflow: hidden;
}

    .hero-section::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: url('/images/hero-pattern.svg') repeat;
        opacity: 0.1;
        z-index: 1;
    }

    .hero-section .container {
        position: relative;
        z-index: 2;
    }

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #8b5cf6 100%);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeInUp 0.8s ease-out;
}

.animate-fade-in-delay {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.animate-fade-in-delay-2 {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.animate-slide-in {
    animation: slideInRight 0.8s ease-out 0.3s both;
}

.animate-in {
    animation: fadeInUp 0.6s ease-out both;
}

/* Cards & Hover Effects */
.hover-lift {
    transition: var(--transition);
}

    .hover-lift:hover {
        transform: translateY(-8px);
        box-shadow: var(--box-shadow-lg);
    }

.card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
}

/* Book Card Styles */
.book-card {
    position: relative;
}

.book-cover-container {
    position: relative;
    height: 300px;
    background: var(--light-color);
}

.book-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.book-overlay {
    background: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: var(--transition);
    backdrop-filter: blur(2px);
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-card:hover .book-cover {
    transform: scale(1.05);
}

.book-actions {
    gap: 0.5rem;
}

    .book-actions .btn {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
    }

        .book-actions .btn:hover {
            transform: scale(1.1);
        }

/* Rating Stars */
.star-rating .fa-star {
    font-size: 0.875rem;
    margin-right: 1px;
}

    .star-rating .fa-star.text-warning {
        color: #ffc107 !important;
    }

/* Price Display */
.price-current {
    font-size: 1.25rem;
    color: var(--primary-color) !important;
}

.price-original {
    font-size: 0.875rem;
    text-decoration: line-through;
    color: var(--secondary-color) !important;
}

/* Category Cards */
.category-card {
    transition: var(--transition);
    cursor: pointer;
}

    .category-card:hover {
        transform: translateY(-5px);
        box-shadow: var(--box-shadow-lg);
    }

    .category-card .card-body {
        background: linear-gradient(45deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.7));
        backdrop-filter: blur(10px);
    }

.category-icon {
    transition: var(--transition);
}

.category-card:hover .category-icon {
    transform: scale(1.1);
}

.category-arrow {
    opacity: 0;
    transition: var(--transition);
}

.category-card:hover .category-arrow {
    opacity: 1;
    transform: translateX(5px);
}

/* Stats Section */
.stats-section .stat-item {
    padding: 2rem 1rem;
    transition: var(--transition);
}

    .stats-section .stat-item:hover {
        transform: translateY(-5px);
    }

.stat-icon {
    transition: var(--transition);
}

.stat-item:hover .stat-icon {
    transform: scale(1.1);
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    transition: var(--transition);
}

    .navbar-brand:hover {
        transform: scale(1.05);
    }

.navbar-nav .nav-link {
    transition: var(--transition);
    position: relative;
    font-weight: 500;
}

    .navbar-nav .nav-link:hover {
        transform: translateY(-2px);
    }

    .navbar-nav .nav-link.active::after {
        content: '';
        position: absolute;
        bottom: -5px;
        left: 50%;
        transform: translateX(-50%);
        width: 20px;
        height: 3px;
        background: var(--warning-color);
        border-radius: 2px;
    }

/* Search Input */
#searchInput {
    border-radius: 25px 0 0 25px;
    border-right: none;
}

.input-group .btn {
    border-radius: 0 25px 25px 0;
}

/* Cart Badge */
#cart-count {
    font-size: 0.65rem;
    min-width: 18px;
    height: 18px;
    line-height: 18px;
}

/* Dropdown Menus */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow-lg);
    border-radius: var(--border-radius);
}

.dropdown-item {
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

    .dropdown-item:hover {
        background: var(--primary-color);
        color: white;
        transform: translateX(5px);
    }

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

    .btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
        transition: var(--transition);
    }

    .btn:hover::before {
        left: 100%;
    }

.btn-primary {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

    .btn-primary:hover {
        background: var(--primary-dark);
        border-color: var(--primary-dark);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(13, 110, 253, 0.3);
    }

.rounded-pill {
    border-radius: 50rem !important;
}

/* Forms */
.form-control, .form-select {
    border-radius: var(--border-radius);
    border: 1px solid #e0e0e0;
    transition: var(--transition);
}

    .form-control:focus, .form-select:focus {
        border-color: var(--primary-color);
        box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
        transform: translateY(-1px);
    }

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background: rgba(25, 135, 84, 0.1);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: rgba(220, 53, 69, 0.1);
}

.alert-warning {
    border-left-color: var(--warning-color);
    background: rgba(255, 193, 7, 0.1);
}

/* Pagination */
.pagination .page-link {
    border: none;
    margin: 0 2px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.pagination .page-item.active .page-link {
    background: var(--primary-color);
    box-shadow: var(--box-shadow);
}

.pagination .page-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

/* Footer */
footer {
    background: var(--dark-color) !important;
}

    footer .social-links a {
        transition: var(--transition);
    }

        footer .social-links a:hover {
            color: var(--primary-color) !important;
            transform: scale(1.2);
        }

/* Newsletter */
.newsletter-form .input-group {
    max-width: 400px;
    margin-left: auto;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

    .loading::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 20px;
        height: 20px;
        border: 2px solid transparent;
        border-top: 2px solid var(--primary-color);
        border-radius: 50%;
        animation: spin 1s linear infinite;
    }

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Wishlist Button States */
.wishlist-btn.active {
    background: var(--danger-color) !important;
    border-color: var(--danger-color) !important;
    color: white !important;
}

/* Filters Sidebar */
.filters-sidebar .card {
    position: sticky;
    top: 100px;
}

.filter-group {
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

    .filter-group:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

.form-check {
    margin-bottom: 0.5rem;
}

.form-check-label {
    cursor: pointer;
    transition: var(--transition);
}

.form-check-input:checked + .form-check-label {
    color: var(--primary-color);
    font-weight: 500;
}

/* Book List View */
.list-view .book-card .card {
    flex-direction: row;
    max-height: 200px;
}

.list-view .book-cover-container {
    width: 150px;
    flex-shrink: 0;
}

.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* No Results */
.no-results {
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.no-results-icon {
    opacity: 0.5;
}

/* Cart Styles */
.cart-item {
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
}

    .cart-item:hover {
        box-shadow: var(--box-shadow);
    }

.quantity-controls .btn {
    width: 35px;
    height: 35px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.quantity-input {
    max-width: 80px;
    text-align: center;
}

/* Checkout Styles */
.order-summary {
    position: sticky;
    top: 100px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
}

    .summary-row:last-child {
        border-bottom: none;
        font-weight: bold;
        font-size: 1.1rem;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        text-align: center;
    }

        .hero-section h1 {
            font-size: 2rem;
        }

    .hero-buttons {
        margin-top: 2rem;
    }

    .book-cover-container {
        height: 250px;
    }

    .filters-sidebar {
        margin-bottom: 2rem;
    }

        .filters-sidebar .card {
            position: static;
        }

    .stats-section .row > div {
        margin-bottom: 2rem;
    }

    .navbar-nav {
        text-align: center;
    }

    .search-form {
        margin: 1rem 0;
    }
}

@media (max-width: 576px) {
    .book-actions-bottom .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }

    .price-current {
        font-size: 1.1rem;
    }

    .hero-buttons .btn {
        display: block;
        width: 100%;
        margin-bottom: 0.5rem;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .card {
        background-color: #2d3748;
        color: #e2e8f0;
    }

    .form-control, .form-select {
        background-color: #4a5568;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .book-cover-container {
        background: #4a5568;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .footer,
    .btn,
    .book-overlay,
    .pagination {
        display: none !important;
    }

    .book-card {
        break-inside: avoid;
        margin-bottom: 1rem;
    }
}

/* Accessibility */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Focus Styles */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================= */
/* PROFESSIONAL APP FOOTER       */
/* ============================= */

.app-footer {
    background: linear-gradient(135deg, #0d6efd, #6f42c1);
    color: #e9ecf1;
    font-size: 0.95rem;
}

.footer-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
}

.footer-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #ffffff;
}

.footer-text {
    color: #dce1f1;
    max-width: 90%;
}

.footer-small {
    font-size: 0.85rem;
    color: #cfd6ee;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

    .footer-links li {
        margin-bottom: 0.5rem;
    }

    .footer-links a {
        color: #dce1f1;
        text-decoration: none;
        transition: all 0.2s ease;
    }

        .footer-links a:hover {
            color: #ffffff;
            text-decoration: underline;
        }

.footer-divider {
    margin: 2rem 0 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-disclaimer {
    font-size: 0.8rem;
    text-align: center;
    color: #e0e4f5;
}
