/* Ciberecus Systems - Library Styles */

/* Library Hero Section */
.library-hero {
    position: relative;
    min-height: 60vh;
    padding-top: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0a0a0f 0%, #1a1a2e 50%, #16213e 100%);
    overflow: hidden;
}

.library-hero .hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.library-hero .cyber-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 255, 255, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
}

.library-hero .floating-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="1" fill="%2300ffff" opacity="0.5"><animate attributeName="opacity" values="0.5;1;0.5" dur="3s" repeatCount="indefinite"/></circle><circle cx="80" cy="40" r="1" fill="%23ff1493" opacity="0.3"><animate attributeName="opacity" values="0.3;0.8;0.3" dur="4s" repeatCount="indefinite"/></circle><circle cx="60" cy="80" r="1" fill="%2300ff41" opacity="0.4"><animate attributeName="opacity" values="0.4;0.9;0.4" dur="2s" repeatCount="indefinite"/></circle></svg>') repeat;
    background-size: 200px 200px;
    animation: particleFloat 15s linear infinite;
}

.library-hero .hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.library-hero .hero-title {
    font-family: 'Orbitron', monospace;
    font-size: 3.5rem;
    font-weight: 900;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
}

.library-hero .glitch {
    position: relative;
    color: #00ffff;
    text-shadow: 
        0 0 10px #00ffff,
        0 0 20px #00ffff,
        0 0 40px #00ffff;
}

.library-hero .glitch::before,
.library-hero .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.library-hero .glitch::before {
    animation: glitch-1 0.5s infinite;
    color: #ff1493;
    z-index: -1;
}

.library-hero .glitch::after {
    animation: glitch-2 0.5s infinite;
    color: #00ff41;
    z-index: -2;
}

.library-hero .hero-subtitle {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-weight: 300;
}

.library-hero .hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 2rem;
}

.library-hero .stat-item {
    text-align: center;
}

.library-hero .stat-number {
    display: block;
    font-family: 'Orbitron', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: #00ffff;
    text-shadow: 0 0 10px #00ffff;
}

.library-hero .stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.5rem;
}

/* Filters Section */
.filters-section {
    padding: 2rem 0;
    background: rgba(10, 10, 15, 0.8);
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
}

.filters-container {
    max-width: 1000px;
    margin: 0 auto;
}

.filters-form {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
    max-width: 400px;
}

.search-input {
    width: 100%;
    padding: 12px 50px 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.search-input::placeholder {
    color: var(--text-secondary);
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #00ffff, #0099cc);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-50%) scale(1.1);
    box-shadow: 0 0 15px #00ffff;
}

.category-select {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 25px;
    color: var(--text-primary);
    font-size: 1rem;
    min-width: 200px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-select:focus {
    outline: none;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
}

.category-select option {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.filter-btn {
    padding: 12px 25px;
    background: linear-gradient(135deg, #ff1493, #cc1177);
    border: none;
    border-radius: 25px;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(255, 20, 147, 0.4);
}

.clear-filters {
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.clear-filters:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Books Section */
.books-section {
    padding: 4rem 0;
    background: var(--bg-primary);
}

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

.book-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
    border: 1px solid rgba(0, 255, 255, 0.2);
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.3),
        0 0 30px rgba(0, 255, 255, 0.2);
    border-color: #00ffff;
}

.book-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00ffff, #ff1493, #00ff41);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover::before {
    opacity: 1;
}

.book-image {
    position: relative;
    height: 250px;
    overflow: hidden;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
}

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

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

.book-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    color: #00ffff;
    font-size: 3rem;
}

.book-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.book-card:hover .book-overlay {
    opacity: 1;
}

.book-content {
    padding: 1.5rem;
}

.book-category {
    display: inline-block;
    background: linear-gradient(135deg, #00ffff, #0099cc);
    color: #000;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.book-title {
    font-family: 'Orbitron', monospace;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-author {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.book-description {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
}

.book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.book-price .price {
    font-family: 'Orbitron', monospace;
    font-size: 1.5rem;
    font-weight: 700;
    color: #00ff41;
    text-shadow: 0 0 10px #00ff41;
}

.book-price .free {
    font-family: 'Orbitron', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: #ff1493;
    text-shadow: 0 0 10px #ff1493;
}

.book-actions {
    display: flex;
    gap: 8px;
}

.book-actions .btn {
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    min-width: auto;
}

/* No Results */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    max-width: 500px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 4rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1.8rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* Pagination */
.pagination-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.pagination {
    display: flex;
    gap: 8px;
    align-items: center;
}

.pagination-btn {
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 8px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.pagination-btn:hover {
    background: rgba(0, 255, 255, 0.1);
    border-color: #00ffff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 255, 255, 0.2);
}

.pagination-btn.active {
    background: linear-gradient(135deg, #00ffff, #0099cc);
    color: #000;
    border-color: #00ffff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.4);
}

.pagination-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: linear-gradient(145deg, rgba(10, 10, 15, 0.95), rgba(26, 26, 46, 0.95));
    border: 2px solid rgba(0, 255, 255, 0.3);
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow: hidden;
    backdrop-filter: blur(20px);
    animation: slideInUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(0, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, rgba(0, 255, 255, 0.1), rgba(255, 20, 147, 0.1));
}

.modal-header h2 {
    font-family: 'Orbitron', monospace;
    color: var(--text-primary);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.modal-close:hover {
    color: #ff1493;
    background: rgba(255, 20, 147, 0.1);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-loading {
    text-align: center;
    padding: 2rem;
}

.modal-loading p {
    color: var(--text-secondary);
    margin-top: 1rem;
}

.modal-book-content {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-book-image {
    width: 100%;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.modal-book-info h3 {
    font-family: 'Orbitron', monospace;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.modal-book-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid #00ffff;
}

.meta-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.meta-value {
    font-weight: 600;
    color: var(--text-primary);
}

.modal-book-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-book-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Animations */
@keyframes gridMove {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

@keyframes particleFloat {
    0% { transform: translateY(0px); }
    100% { transform: translateY(-20px); }
}

@keyframes glitch-1 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 2px); }
    40% { transform: translate(-2px, -2px); }
    60% { transform: translate(2px, 2px); }
    80% { transform: translate(2px, -2px); }
}

@keyframes glitch-2 {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(2px, 2px); }
    40% { transform: translate(2px, -2px); }
    60% { transform: translate(-2px, 2px); }
    80% { transform: translate(-2px, -2px); }
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .library-hero .hero-title {
        font-size: 2.5rem;
    }
    
    .library-hero .hero-stats {
        gap: 2rem;
    }
    
    .library-hero .stat-number {
        font-size: 2rem;
    }
    
    .filters-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
        max-width: none;
    }
    
    .category-select {
        min-width: auto;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-book-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-book-meta {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .library-hero .hero-title {
        font-size: 2rem;
    }
    
    .library-hero .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .books-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}