/* === ОСНОВНИ СТИЛОВЕ === */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #e74c3c;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --text-color: #2c3e50;
    --text-light: #7f8c8d;
    --bg-color: #ffffff;
    --bg-secondary: #f8f9fa;
    --border-color: #e1e8ed;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* === НАВИГАЦИЯ === */
.navbar {
    background: var(--gradient);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: white;
    margin-bottom: 0.25rem;
}

.tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
}

.nav-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stat-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    color: white;
    font-weight: 500;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}

.stat-badge:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* === ГЕРОЙ СЕКЦИЯ === */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 6rem 2rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="100" height="100" patternUnits="userSpaceOnUse"><path d="M 100 0 L 0 0 0 100" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100%" height="100%" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

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

.hero-title {
    font-family: 'Playfair Display', serif;
    font-size: 3.5rem;
    color: white;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3rem;
    font-weight: 300;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

/* === ТЪРСАЧКА === */
.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    padding: 0.8rem 1.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.search-box:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);
}

.search-icon {
    color: var(--text-light);
    margin-right: 1rem;
}

#search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1.1rem;
    color: var(--text-color);
}

#search-input::placeholder {
    color: var(--text-light);
}

.search-clear {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--secondary-color);
}

.search-results {
    position: absolute;
    top: calc(100% + 1rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    display: none;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.search-result-item:hover {
    background: var(--bg-secondary);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* === АНИМАЦИИ НА ПЛАВАЩИ КНИГИ === */
.hero-animation {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.floating-book {
    position: absolute;
    width: 60px;
    height: 80px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    animation: float 6s ease-in-out infinite;
}

.floating-book:nth-child(1) {
    top: 20%;
    left: 10%;
    animation-delay: 0s;
}

.floating-book:nth-child(2) {
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.floating-book:nth-child(3) {
    bottom: 20%;
    left: 20%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-30px) rotate(5deg);
    }
}

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

/* === КОНТЕЙНЕР === */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* === СЕКЦИИ === */
.section {
    margin-bottom: 5rem;
}

.section-header {
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-icon {
    color: var(--accent-color);
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 300;
}

/* === GRID СИСТЕМА ЗА КНИГИ === */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.trending-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

/* === BOOK CARD === */
.book-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    animation: fadeIn 0.5s ease-out;
}

.book-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.book-cover {
    width: 100%;
    height: 350px;
    object-fit: cover;
    background: var(--gradient);
    position: relative;
}

.book-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--secondary-color);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.book-badge.new {
    background: var(--success-color);
}

.book-badge.adult {
    background: #e74c3c;
}

.book-info {
    padding: 1.5rem;
}

.book-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.book-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.book-stat {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

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

.book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.btn-read {
    background: var(--gradient);
    color: white;
    padding: 0.7rem 1.5rem;
    border: none;
    border-radius: 25px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-read:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

/* === FEATURED BOOK === */
.featured-book {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 3rem;
    background: white;
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.8s ease-out;
}

.featured-cover {
    width: 100%;
    height: 500px;
    object-fit: cover;
    border-radius: 15px;
    box-shadow: var(--shadow-lg);
}

.featured-details h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.featured-excerpt {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
    margin: 2rem 0;
}

.featured-stats {
    display: flex;
    gap: 2rem;
    margin: 2rem 0;
}

.featured-stat {
    text-align: center;
}

.featured-stat-value {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    display: block;
}

.featured-stat-label {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* === FILTER BUTTONS === */
.filter-buttons {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    color: var(--text-color);
}

.filter-btn:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.filter-btn.active {
    background: var(--gradient);
    color: white;
    border-color: transparent;
}

/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-light);
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--secondary-color);
    transform: rotate(90deg);
}

#contact-form {
    margin-top: 2rem;
}

#contact-form input,
#contact-form textarea {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Roboto', sans-serif;
    font-size: 1rem;
    transition: var(--transition);
}

#contact-form input:focus,
#contact-form textarea:focus {
    outline: none;
    border-color: var(--accent-color);
}

#contact-form button {
    width: 100%;
    padding: 1rem;
    background: var(--gradient);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

#contact-form button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* === FOOTER === */
.footer {
    background: var(--primary-color);
    color: white;
    padding: 3rem 2rem 1rem;
    margin-top: 5rem;
}

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

.footer-section h4 {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

/* === АНИМАЦИИ === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .featured-book {
        grid-template-columns: 1fr;
    }
    
    .featured-cover {
        height: 400px;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .books-grid,
    .trending-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .modal-content {
        width: 90%;
        padding: 2rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .books-grid,
    .trending-grid {
        grid-template-columns: 1fr;
    }
    
    .search-box {
        padding: 0.6rem 1rem;
    }
    
    #search-input {
        font-size: 1rem;
    }
}

/* === LOADING ANIMATION === */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === NOTIFICATION === */
.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    animation: slideInRight 0.3s ease-out;
}

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

.notification.success {
    border-left: 4px solid var(--success-color);
}

.notification.error {
    border-left: 4px solid var(--secondary-color);
}
