/* ==========================================================================
   Gallery - Per-book image gallery + feedback
   ========================================================================== */

.gallery-view {
    flex: 1;
    background: #1a1a2e;
    justify-content: center;
    align-items: stretch;
    min-height: 0;
}

.gallery-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    gap: 12px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.gallery-title {
    font-size: 20px;
    font-weight: 600;
    color: #e94560;
}

.gallery-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.gallery-action-btn {
    background: #0f3460;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.gallery-action-btn:hover, .gallery-action-btn:active {
    background: #1a4a7a;
}

.gallery-close-btn {
    background: none;
    border: none;
    color: #888;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
}

.gallery-close-btn:hover {
    color: #e94560;
}

.gallery-controls {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.gallery-tabs {
    display: flex;
    gap: 8px;
}

.gallery-tab {
    background: #0f3460;
    color: white;
    border: none;
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.gallery-tab.active {
    background: #e94560;
}

.gallery-spoiler {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.gallery-spoiler-btn {
    background: rgba(15, 52, 96, 0.6);
    color: white;
    border: 1px solid rgba(15, 52, 96, 0.9);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.gallery-spoiler-btn:hover, .gallery-spoiler-btn:active {
    background: rgba(26, 74, 122, 0.85);
}

.gallery-spoiler-btn[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
}

.gallery-spoiler-status {
    font-size: 12px;
    color: #aaa;
    max-width: 340px;
    text-align: right;
}

.gallery-grid {
    flex: 1;
    overflow: auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    padding: 4px 0;
    -webkit-overflow-scrolling: touch;
}

.gallery-empty {
    color: #666;
    padding: 24px;
}

.gallery-card {
    background: #16213e;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
}

.gallery-card:hover {
    outline: 2px solid rgba(233, 69, 96, 0.35);
}

.gallery-thumb {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: #0f0f1a;
}

.gallery-card-footer {
    padding: 10px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.gallery-card-label {
    font-size: 12px;
    color: #ddd;
}

.gallery-card-heart {
    font-size: 16px;
    color: #e94560;
    opacity: 0.9;
}

/* Generic modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
    padding: 16px;
}

.modal {
    background: #16213e;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    overflow: hidden;
}

.modal-header {
    padding: 18px 18px 10px 18px;
    border-bottom: 1px solid #0f3460;
}

.modal-header h2 {
    font-size: 18px;
    color: #e94560;
}

.modal-body {
    padding: 14px 18px;
    color: #ddd;
    font-size: 14px;
    line-height: 1.4;
}

.modal-footer {
    padding: 14px 18px 18px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.modal-btn {
    background: #0f3460;
    color: white;
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
}

.modal-btn.primary {
    background: #e94560;
}

.modal-btn:hover, .modal-btn:active {
    background: #1a4a7a;
}

.modal-btn.primary:hover, .modal-btn.primary:active {
    background: #ff6b6b;
}

/* Image modal */
.gallery-image-modal {
    background: #0f0f1a;
    border-radius: 16px;
    width: 100%;
    max-width: 900px;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.gallery-image-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
}

.gallery-image-modal-title {
    color: #ddd;
    font-size: 14px;
}

.gallery-image-modal-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f0f1a;
    overflow: auto;
}

.gallery-modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.gallery-image-modal-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(22, 33, 62, 0.95);
    border-top: 1px solid #0f3460;
}

.gallery-variant-label {
    font-size: 12px;
    color: #aaa;
}

.gallery-variant-select {
    background: #0f3460;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
}

.gallery-image-modal-controls .image-feedback {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.image-feedback-btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    padding: 10px 12px;
    font-size: 16px;
    min-height: 40px;
    min-width: 44px;
}

.image-feedback-btn.subtle {
    background: rgba(15, 52, 96, 0.35);
    color: rgba(255, 255, 255, 0.9);
}

.image-feedback-btn.subtle.active {
    background: rgba(15, 52, 96, 0.9);
}

.image-feedback-btn.heart {
    background: rgba(233, 69, 96, 0.25);
    color: rgba(233, 69, 96, 0.95);
}

.image-feedback-btn.heart.active {
    background: rgba(233, 69, 96, 0.9);
    color: white;
}

