/* Library Page Styles */

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

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: "PT Sans Narrow", sans-serif;
}

/* Navigation Bar */
.navbar {
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-brand {
    font-size: 24px;
    font-weight: bold;
    color: #6366f1;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-link {
    text-decoration: none;
    color: #4b5563;
    font-size: 18px;
    padding: 8px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    background: #f3f4f6;
    color: #6366f1;
}

.nav-link.active {
    background: #6366f1;
    color: white;
}

/* App Container */
#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Library Header */
.library-header {
    padding: 20px;
    animation: fadeInDown 0.6s ease;
    position: relative;
}

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

.header-main {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
}

.library-stats {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 12px;
    gap: 10px;
}

.stat-number {
    font-size: 32px;
    font-weight: bold;
    color: white;
}

.stat-label {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.9);
}

/* Hamburger Button */
.hamburger-btn {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.hamburger-icon {
    font-size: 24px;
    color: white;
}

/* Hamburger Menu */
.hamburger-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 80px 20px 20px 20px;
    animation: fadeIn 0.3s ease;
}

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

.menu-content {
    background: white;
    border-radius: 15px;
    padding: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    min-width: 200px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.menu-item {
    width: 100%;
    padding: 15px 20px;
    border: none;
    background: transparent;
    text-align: left;
    font-size: 16px;
    font-family: "PT Sans Narrow", sans-serif;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 10px;
    color: #374151;
}

.menu-item:hover {
    background: #f3f4f6;
}

.menu-item.delete-item {
    color: #ef4444;
}

.menu-item.delete-item:hover {
    background: #fee2e2;
}

/* Controls Section */
.controls-section {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 25px;
    margin: 30px 0;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.search-container {
    margin-bottom: 20px;
}

.search-input {
    width: 100%;
    padding: 15px 20px;
    font-size: 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: "PT Sans Narrow", sans-serif;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.actions-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.filter-sort-group {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.sort-select {
    padding: 10px 15px;
    font-size: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-family: "PT Sans Narrow", sans-serif;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: #6366f1;
}

.view-toggle {
    display: flex;
    gap: 5px;
    background: #f3f4f6;
    padding: 5px;
    border-radius: 10px;
}

.view-btn {
    padding: 8px 15px;
    font-size: 20px;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background: #e5e7eb;
}

.view-btn.active {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-family: "PT Sans Narrow", sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    font-size: 18px;
}

.export-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.import-btn {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.import-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.delete-all-btn {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.delete-all-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: white;
    animation: fadeIn 0.6s ease;
}

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

.empty-icon {
    font-size: 120px;
    margin-bottom: 20px;
}

.empty-state h2 {
    font-size: 36px;
    margin-bottom: 15px;
}

.empty-state p {
    font-size: 20px;
    opacity: 0.9;
    margin-bottom: 30px;
}

.empty-cta {
    display: inline-block;
    padding: 15px 40px;
    background: white;
    color: #6366f1;
    text-decoration: none;
    border-radius: 12px;
    font-size: 20px;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.empty-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Books Container */
.books-container {
    margin-top: 30px;
    animation: fadeIn 0.6s ease;
}

.books-container.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.books-container.list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Book Card */
.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.book-card.grid {
    display: flex;
    flex-direction: column;
}

.book-card.list {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.book-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.book-card.grid .book-image {
    height: 240px;
}

.book-card.list .book-image {
    width: 120px;
    height: 160px;
    flex-shrink: 0;
}

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

.book-info {
    padding: 12px;
    flex-grow: 1;
}

.book-title {
    font-size: 16px;
    font-weight: bold;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-author {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-date {
    font-size: 11px;
    color: #9ca3af;
}

.delete-book-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10;
}

.book-card:hover .delete-book-btn {
    opacity: 1;
}

.delete-book-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

/* Popup */
.popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.3s ease;
}

.popup-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close-popup {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f3f4f6;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-popup:hover {
    background: #e5e7eb;
    transform: rotate(90deg);
}

.popup-image {
    width: 200px;
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 0 auto 20px;
    display: block;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.popup-title {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 10px;
    text-align: center;
}

.popup-author {
    font-size: 20px;
    color: #6b7280;
    font-style: italic;
    text-align: center;
    margin-bottom: 20px;
}

.popup-details {
    background: #f9fafb;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.popup-details p {
    margin: 10px 0;
    font-size: 16px;
    color: #374151;
}

.popup-description {
    margin-bottom: 20px;
    text-align: left;
}

.popup-description h3 {
    font-size: 20px;
    color: #1f2937;
    margin-bottom: 12px;
    font-weight: bold;
}

.popup-description p {
    font-size: 15px;
    color: #4b5563;
    line-height: 1.6;
    text-align: justify;
}

.popup-delete-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-family: "PT Sans Narrow", sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.popup-delete-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Confirmation Dialog */
.confirm-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease;
}

.confirm-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.confirm-content h3 {
    font-size: 28px;
    color: #1f2937;
    margin-bottom: 15px;
}

.confirm-content p {
    font-size: 18px;
    color: #6b7280;
    margin-bottom: 30px;
    line-height: 1.6;
}

.confirm-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.confirm-yes, .confirm-no {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-family: "PT Sans Narrow", sans-serif;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.confirm-yes {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.confirm-yes:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.confirm-no {
    background: #f3f4f6;
    color: #374151;
}

.confirm-no:hover {
    background: #e5e7eb;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .navbar {
        padding: 12px 15px;
    }

    .nav-brand {
        font-size: 20px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-link {
        font-size: 14px;
        padding: 6px 10px;
    }

    .library-title {
        font-size: 36px;
    }

    .stat-item {
        padding: 15px 25px;
    }

    .stat-number {
        font-size: 28px;
    }

    .actions-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-sort-group,
    .action-buttons {
        width: 100%;
        justify-content: center;
    }

    .action-btn {
        flex: 1;
        min-width: 120px;
    }

    .books-container.grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .book-card.list {
        flex-direction: column;
    }

    .book-card.list .book-image {
        width: 100%;
        height: 250px;
    }

    .book-title {
        font-size: 18px;
    }

    .popup-content {
        padding: 30px 20px;
    }

    .popup-title {
        font-size: 24px;
    }

    .popup-author {
        font-size: 18px;
    }
}

@media (max-width: 480px) {
    .library-title {
        font-size: 28px;
    }

    .empty-icon {
        font-size: 80px;
    }

    .empty-state h2 {
        font-size: 28px;
    }

    .empty-state p {
        font-size: 16px;
    }

    .books-container.grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .btn-text {
        display: inline;
    }
}
