/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ЦИТАТ ===== */

:root {
    --bg-page: #FDF8F0;
    --bg-card: #FFFFFF;
    --text-primary: #2C1810;
    --text-secondary: #5D3A2A;
    --text-muted: #8B6F5C;
    --accent: #9B6B43;
    --border-color: #E8DCCC;
    --border-radius-lg: 16px;
}

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

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Шапка как на главной */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar-left a {
    text-decoration: none;
    color: inherit;
}

.top-bar-left h1 {
    font-size: 1.8em;
    margin: 0;
    color: var(--text-primary);
    font-weight: 400;
    letter-spacing: 1px;
    font-family: 'Playfair Display', serif;
}

.book-subtitle {
    font-size: 0.9em;
    color: var(--text-secondary);
    font-weight: 300;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.auth-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    transition: all 0.2s;
}

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

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px;
    flex: 1;
}

/* Заголовок страницы */
.page-title {
    font-family: 'Playfair Display', serif;
    font-size: 2.5em;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 10px;
    text-align: center;
}

.page-description {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 40px;
    font-size: 1.1em;
}

/* Поиск */
.search-section {
    margin-bottom: 30px;
}

.search-wrapper {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.search-wrapper input {
    width: 100%;
    padding: 0 100px 0 20px;
    font-size: 1.2em;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 40px;
    color: var(--text-primary);
    height: 60px;
    line-height: 60px;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(155, 107, 67, 0.1);
}

/* Кнопка поиска (лупа) */
#submitBtn {
    position: absolute;
    right: 15px;
   top: 50% !important;  /* Увеличьте это значение, чтобы опустить */
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent);
    padding: 0;
    z-index: 10;
    transition: all 0.2s;
}

#submitBtn:hover {
    color: #B89A7A;
    transform: translateY(-50%) scale(1.1);
}

/* Кнопка очистки (крестик) */
#clearBtn {
    position: absolute;
    right: 60px;
    top: 50% !important;  /* Увеличьте это значение, чтобы опустить */
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--accent);
    padding: 0;
    z-index: 10;
    transition: all 0.2s;
}

#clearBtn:hover {
    color: #B55A5A;
    transform: translateY(-50%) scale(1.1);
}

/* SVG внутри кнопок */
#submitBtn svg, #clearBtn svg {
    width: 22px;
    height: 22px;
    stroke: currentColor;
    stroke-width: 2;
}

/* Фильтры */
.filters {
    display: flex;
    gap: 15px;
    margin: 30px 0;
    flex-wrap: wrap;
    justify-content: center;
}

.filter-select {
    padding: 12px 25px;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background: white;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    color: var(--text-primary);
    cursor: pointer;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--accent);
}

/* Кнопка обновления */
.refresh-btn {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 0.9em;
    font-weight: 500;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.refresh-btn:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-1px);
}

/* КАРТОЧКА ЦИТАТЫ */
.quote-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    padding: 25px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease;
}

.quote-card:hover {
    box-shadow: 0 8px 20px rgba(139, 90, 43, 0.15);
    transform: translateY(-2px);
    border-color: var(--accent);
}

/* Заголовок карточки: название слева, автор справа */
.quote-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 1.1em;
}

.book-link {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
    position: relative;
}

.book-link:hover {
    color: #B89A7A;
    text-decoration: underline;
}

.quote-author {
    color: var(--text-secondary);
    font-size: 0.95em;
}

/* Цитата в рамке */
.quote-bubble {
    background: var(--bg-page);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 12px;
    font-size: 1.1em;
    line-height: 1.5;
    color: var(--text-primary);
    font-style: italic;
}

/* Контекст */
.quote-context {
    color: var(--text-secondary);
    font-size: 0.95em;
    line-height: 1.5;
    margin-bottom: 15px;
    padding: 0;
    background: none;
    border: none;
}

/* ===== КНОПКИ ДЕЙСТВИЙ (ВСЕ В ОДНОМ СТИЛЕ) ===== */
.quote-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}

.quote-actions-left {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.quote-actions-right {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

/* ОСНОВНОЙ СТИЛЬ ДЛЯ ВСЕХ ИКОНОК (три кнопки + глаз + палец) */
.action-icon,
.stat-item {
    color: var(--accent) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 20px;
    background: transparent;
    border: none;
    font-size: 0.95em;
    text-decoration: none;
    position: relative;
}

/* Эффект при наведении для всех */
.action-icon:hover,
.stat-item:hover {
    opacity: 1;
    background: rgba(155, 107, 67, 0.1);
}

/* Специально для лайка в активном состоянии */
.stat-item.like.liked {
    color: #ff6b6b !important;
}

.stat-item.like.liked:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Для просмотров - не кликабельно, но стиль тот же */
.stat-item.views {
    cursor: default;
}

.stat-item.views:hover {
    background: transparent;
    opacity: 0.7;
}

/* SVG иконки */
.action-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
}

/* Эмодзи-иконки (глаз и палец) */
.stat-icon {
    font-size: 1.2em;
    line-height: 1;
    display: inline-flex;
    align-items: center;
}

/* Счётчики */
.stat-count {
    font-weight: 500;
}

/* ===== ТУЛТИПЫ ===== */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #FFF9F0;
    color: #4A3A2A;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    white-space: nowrap;
    margin-bottom: 6px;
    border: 1px solid #E8DCCC;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

[data-tooltip]:hover::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #FFF9F0;
    margin-bottom: -2px;
    z-index: 1001;
    pointer-events: none;
}

/* Счетчики статистики (вверху страницы) */
.quote-stats {
    text-align: center;
    margin: 10px 0 25px 0;
    font-size: 1.1em;
    color: var(--text-secondary);
    font-weight: 300;
    letter-spacing: 0.5px;
}

.quote-stats strong {
    color: var(--accent);
    font-weight: 500;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 50px 0 20px;
    flex-wrap: wrap;
}

.page-btn {
    padding: 12px 18px;
    border: 1px solid var(--border-color);
    background: white;
    cursor: pointer;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95em;
    transition: all 0.2s;
    min-width: 45px;
}

.page-btn:hover {
    background: var(--border-color);
}

.page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
}

.page-dots {
    padding: 12px 5px;
    color: var(--text-muted);
}

/* Индикатор загрузки */
.loading {
    text-align: center;
    padding: 50px;
    color: var(--text-muted);
    font-style: italic;
    font-size: 1.2em;
}

/* Сообщение об ошибке */
.error-message {
    text-align: center;
    padding: 50px;
    color: #B55A5A;
    background: rgba(181, 90, 90, 0.05);
    border-radius: var(--border-radius-lg);
    font-size: 1.2em;
}

/* Выпадающее меню */
.menu-container {
    position: relative;
    display: inline-block;
}

.menu-button {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 1em;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
}

.menu-button:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.menu-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    min-width: 200px;
    z-index: 1000;
    margin-top: 5px;
    display: none;
}

.menu-dropdown.show {
    display: block;
}

.menu-item {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    transition: background 0.2s;
}

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

.menu-item:hover {
    background: var(--bg-page);
    color: var(--accent);
}

.menu-item.active {
    background: var(--accent);
    color: white;
}

/* Ссылка На главную */
.home-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95em;
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--border-color);
    transition: all 0.2s;
    background: transparent;
}

.home-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ===== АДАПТАЦИЯ ДЛЯ МОБИЛОК ===== */
@media (max-width: 768px) {
    .top-bar {
        padding: 10px 15px;
    }

    .top-bar-left h1 {
        font-size: 1.2em;
    }

    .container {
        padding: 15px;
    }

    .page-title {
        font-size: 1.8em;
    }

    .filters {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
    }

    .quote-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .quote-bubble {
        padding: 12px 15px;
        font-size: 1em;
    }
    
    .quote-actions {
        flex-direction: row;
        justify-content: space-between;
        gap: 5px;
    }
    
    .quote-actions-left {
        gap: 12px;
        flex: 1;
    }
    
    .quote-actions-right {
        margin-left: 0;
        gap: 12px;
        justify-content: flex-end;
    }
    
    .action-icon,
    .stat-item {
        padding: 2px 4px;
        font-size: 0.85em;
    }
    
    .action-icon svg,
    .stat-icon {
        width: 18px;
        height: 18px;
    }
    
    .stat-icon {
        font-size: 1.1em;
    }
    
    .quote-stats {
        font-size: 0.95em;
        margin: 8px 0 20px 0;
    }
    
    .search-wrapper input {
        padding: 0 90px 0 15px;
        font-size: 1em;
        height: 50px;
        line-height: 50px;
    }
    
    #submitBtn, #clearBtn {
        width: 36px;
        height: 36px;
    }
    
    #submitBtn svg, #clearBtn svg {
        width: 20px;
        height: 20px;
    }
    
    #clearBtn {
        right: 52px;
    }
}

@media (max-width: 400px) {
    .quote-actions-left {
        gap: 8px;
    }
    
    .quote-actions-right {
        gap: 8px;
    }
    
    .action-icon svg,
    .stat-icon {
        width: 16px;
        height: 16px;
    }
}

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