/*
 * LiberClub — static/css/style.css
 * Основные стили находятся в templates/base.html (встроенный <style>).
 * Этот файл существует, чтобы Service Worker мог его закешировать без 404.
 */

/* ─── Дашборд супервизора ─────────────────────────────────── */
.admin-dashboard {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

.dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid #81D8D0;
}

.dashboard-header .header-icon {
    font-size: 48px;
    background: linear-gradient(135deg, #81D8D0 0%, #0A4C4A 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(10, 76, 74, 0.2);
    flex-shrink: 0;
}

.dashboard-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    color: #0A4C4A;
    margin: 0 0 4px 0;
}

.dashboard-subtitle {
    color: #6B6B6B;
    font-size: 14px;
    margin: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(135deg, #FFFFFF 0%, #F9F6F0 100%);
    border-radius: 24px;
    padding: 24px 16px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: default;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #81D8D0, #0A4C4A);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(10, 76, 74, 0.12);
}

.stat-icon {
    font-size: 36px;
    margin-bottom: 12px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: #0A4C4A;
    font-family: 'Playfair Display', serif;
}

.stat-label {
    font-size: 14px;
    color: #6B6B6B;
    margin-top: 8px;
}

.admin-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: linear-gradient(135deg, #81D8D0 0%, #6BC4BC 100%);
    color: #0A4C4A;
    padding: 14px 28px;
    border-radius: 48px;
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.admin-btn .btn-icon {
    font-size: 20px;
}

.admin-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(10, 76, 74, 0.2);
    color: #0A4C4A;
}

@media (max-width: 768px) {
    .dashboard-header {
        flex-direction: column;
        text-align: center;
    }

    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 12px;
    }

    .stat-card {
        padding: 16px 12px;
    }

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

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

    .admin-btn {
        justify-content: center;
    }
}

/* Дополнительные утилитарные классы */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.text-center { text-align: center; }
.mt-0  { margin-top: 0; }
.mb-0  { margin-bottom: 0; }
.mt-8  { margin-top: 8px; }
.mb-8  { margin-bottom: 8px; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }

/* ─── Страница импорта книг ──────────────────────────────── */
.import-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.import-section {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.import-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #0A4C4A;
    margin-bottom: 16px;
}

.import-section textarea,
.import-section input[type="file"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #E5E0D5;
    border-radius: 12px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    margin-bottom: 16px;
    background: #F9F6F0;
    box-sizing: border-box;
}

.import-section textarea {
    min-height: 150px;
    resize: vertical;
}

.import-section button {
    background: #81D8D0;
    border: none;
    border-radius: 40px;
    padding: 10px 24px;
    color: #0A4C4A;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
}

.import-section button:hover {
    background: #6BC4BC;
}

.import-section button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.import-result {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 12px;
    background: rgba(129, 216, 208, 0.1);
    color: #0A4C4A;
    font-size: 14px;
}

.instructions {
    background: #F9F6F0;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
}

.instructions h4 {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    color: #0A4C4A;
    margin-bottom: 12px;
}

.instructions p,
.instructions li {
    font-size: 14px;
    line-height: 1.6;
    color: #2C2C2C;
}

.instructions ol {
    padding-left: 20px;
    margin-bottom: 12px;
}

.instructions pre {
    background: #FFFFFF;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #E5E0D5;
    font-size: 12px;
    overflow-x: auto;
    margin: 8px 0 12px;
}

.instructions code {
    background: #FFFFFF;
    border: 1px solid #E5E0D5;
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 12px;
    color: #0A4C4A;
}

/* ─── Чат клуба ──────────────────────────────────────────── */
.club-chat {
    margin-top: 24px;
    background: #FFFFFF;
    border-radius: 16px;
    padding: 20px;
}

.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.chat-message {
    padding: 12px;
    border-bottom: 1px solid #E5E0D5;
}

.chat-message strong {
    color: #0A4C4A;
}

.chat-message .time {
    font-size: 11px;
    color: #6B6B6B;
    margin-left: 8px;
}

.reply-btn {
    background: none;
    border: none;
    color: #81D8D0;
    cursor: pointer;
    font-size: 12px;
    margin-top: 4px;
}

.chat-input {
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex-grow: 1;
    padding: 12px;
    border: 1px solid #E5E0D5;
    border-radius: 24px;
    font-family: 'Inter', sans-serif;
}

/* ─── Предложка книг ─────────────────────────────────────── */
.proposals-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.proposals-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0A4C4A;
}

.proposals-count {
    background: #81D8D0;
    color: #0A4C4A;
    border-radius: 20px;
    padding: 2px 10px;
    font-size: 14px;
    font-weight: 600;
}

.proposals-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
}

.proposals-list::-webkit-scrollbar { width: 4px; }
.proposals-list::-webkit-scrollbar-track { background: transparent; }
.proposals-list::-webkit-scrollbar-thumb { background: #C8EAE8; border-radius: 4px; }

.proposals-empty {
    color: #999;
    font-size: 14px;
    text-align: center;
    padding: 20px 0;
}

.proposal-card {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    background: #F9F6F0;
    align-items: center;
    transition: transform 0.2s;
}

.proposal-card:hover {
    transform: translateX(4px);
}

.proposal-cover img {
    width: 50px;
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.proposal-info {
    flex-grow: 1;
    min-width: 0;
}

.proposal-title {
    font-weight: 600;
    color: #0A4C4A;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.proposal-author {
    font-size: 13px;
    color: #6B6B6B;
    margin-top: 2px;
}

.proposal-meta {
    font-size: 11px;
    color: #81D8D0;
    margin-top: 4px;
}

.delete-proposal-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    flex-shrink: 0;
    padding: 4px;
}

.delete-proposal-btn:hover {
    opacity: 1;
}

/* ─── Кнопка «Отменить предложение» ──────────────────────── */
.cancel-proposal-btn {
    background: none;
    border: 1px solid rgba(192, 57, 43, 0.35);
    border-radius: 20px;
    padding: 4px 12px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: #c0392b;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
}

.cancel-proposal-btn:hover:not(:disabled) {
    background: rgba(192, 57, 43, 0.07);
    border-color: #c0392b;
}

.cancel-proposal-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

/* ─── Подсветка предложений от adminов/owner ─────────────── */
.admin-proposal {
    background: rgba(129, 216, 208, 0.15);
    border-left: 4px solid #81D8D0;
}

.admin-star {
    margin-right: 6px;
    font-size: 14px;
    vertical-align: middle;
}

.proposal-info p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #6B6B6B;
}

/* ─── Кнопка «Предложить в клуб» — единый стиль ──────────── */
button.propose-book-btn,
.propose-book-btn {
    background: #81D8D0 !important;
    border: none !important;
    border-radius: 40px !important;
    padding: 10px 20px !important;
    color: #0A4C4A !important;
    font-weight: 600 !important;
    font-size: 14px !important;
    font-family: 'Inter', sans-serif !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05) !important;
    text-align: center !important;
    white-space: nowrap !important;
}

button.propose-book-btn:hover,
.propose-book-btn:hover {
    background: #6BC4BC !important;
    transform: translateY(-2px) !important;
}

button.propose-book-btn:active,
.propose-book-btn:active {
    transform: translateY(0) !important;
}

button.propose-book-btn:disabled,
.propose-book-btn:disabled {
    opacity: 0.55 !important;
    cursor: default !important;
    transform: none !important;
}

/* ─── Выпадающее меню «Предложить» — единый стиль ────────── */
.propose-dropdown-content {
    position: absolute;
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    min-width: 200px;
    z-index: 100;
    overflow: hidden;
    margin-top: 4px;
    bottom: calc(100% + 6px);
    left: 0;
    right: 0;
}

.propose-dropdown-content a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    text-decoration: none;
    color: #2C2C2C;
    font-size: 14px;
    transition: background 0.2s;
}

.propose-dropdown-content a:hover {
    background: #F9F6F0;
}

.propose-dropdown-content .club-header {
    background: #F9F6F0;
    font-weight: 600;
    padding: 8px 16px;
    color: #0A4C4A;
    font-size: 13px;
    border-bottom: 1px solid #E5E0D5;
    display: flex;
    align-items: center;
}

.propose-dropdown-content .admin-actions {
    display: flex;
    gap: 8px;
    padding: 8px 16px;
    border-top: 1px solid #E5E0D5;
}

.propose-dropdown-content .admin-actions a {
    flex: 1;
    justify-content: center;
    padding: 8px;
    border-radius: 40px;
    background: #F9F6F0;
    font-size: 13px;
}

.propose-dropdown-content .admin-actions a:hover {
    background: #EDE8E0;
}

/* ─── Блок голосования (API-driven) ─────────────────────── */
.polls-header {
    margin-bottom: 16px;
}

.polls-header h3 {
    margin: 0;
    font-size: 18px;
    color: #0A4C4A;
}

.polls-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-poll-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-radius: 12px;
    background: #F9F6F0;
}

.api-poll-card .poll-cover img {
    width: 60px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
}

.api-poll-card .poll-info {
    flex-grow: 1;
}

.api-poll-card .poll-title {
    font-weight: 600;
    color: #0A4C4A;
}

.api-poll-card .poll-author {
    font-size: 13px;
    color: #6B6B6B;
    margin-bottom: 8px;
}

.vote-up-btn,
.vote-down-btn {
    background: none;
    border: 1px solid #E5E0D5;
    border-radius: 20px;
    padding: 6px 16px;
    margin-right: 8px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.vote-up-btn:hover,
.vote-down-btn:hover {
    background: #81D8D0;
    border-color: #81D8D0;
}

/* ─── Notifications bell ─────────────────────────────────── */
.notifications-area {
    position: relative;
    display: inline-block;
}

.notifications-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    position: relative;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.notifications-btn:hover {
    background: rgba(129, 216, 208, 0.13);
}

.notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    border-radius: 10px;
    padding: 2px 6px;
    min-width: 18px;
    text-align: center;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

/* ─── Мобильная версия выпадающего меню «Предложить» ─────── */
@media (max-width: 768px) {
    .propose-dropdown-content {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        border-radius: 20px 20px 0 0 !important;
        max-height: 60vh;
        overflow-y: auto;
        margin: 0 !important;
        padding-bottom: 20px;
        z-index: 200;
    }

    .propose-dropdown-content a,
    .propose-dropdown-content .admin-actions {
        padding: 14px 20px;
        font-size: 16px;
    }

    .propose-dropdown-content .admin-actions {
        flex-direction: column;
        gap: 10px;
    }

    .propose-dropdown-content .admin-actions a {
        text-align: center;
        justify-content: center;
    }

    /* Затемнение фона при открытом меню */
    .dropdown-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
}

