/* rt-community.css — Community: reviews, comments, notifications, rating popup */

/* ============================================================
   13. ADMIN / UTILITY
   ============================================================ */

/* Admin bar compensation */
.admin-bar .rt-wrapper { margin-top: 0; }

/* Logout & Profile buttons */
.rt-logout-btn { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--rt-border); border-radius: 50%; color: var(--rt-text-light); text-decoration: none; transition: all 0.15s; flex-shrink: 0; }
.rt-logout-btn:hover { border-color: var(--rt-danger); color: var(--rt-danger); background: var(--rt-danger-soft); }

/* Discovery inline button */
.rt-discover-btn-inline { background: var(--rt-accent); color: var(--rt-accent-fg); border-color: var(--rt-accent); }
.rt-discover-btn-inline:hover { background: #2e3720; border-color: #2e3720; }

.rt-discover-row { width: 100%; display: none; }
.rt-discover-btn { background: var(--rt-accent); color: var(--rt-accent-fg); border: 1px solid var(--rt-accent); width: 100%; padding: 10px; font-size: 14px; font-weight: 600; border-radius: var(--rt-r2); cursor: pointer; transition: opacity 0.15s; font-family: var(--rt-font-body); }
.rt-discover-btn:hover { opacity: 0.9; }

/* Column header color band */
.rt-col-header { border-radius: 8px; padding: 10px 14px !important; margin-bottom: 16px !important; margin-left: -4px; }

/* Rating popup pace selector */
.rt-pace-selector { margin: 25px 0 20px 0; text-align: left; padding: 0; background: transparent; border-radius: 0; }
.rt-pace-selector label { display: block; margin-bottom: 12px; font-weight: 600; color: var(--rt-text); font-size: 16px; }
.rt-pace-selector select { width: 100%; padding: 14px 16px; border-radius: var(--rt-r2); border: 1px solid var(--rt-border); font-size: 16px; background: var(--rt-card-bg); cursor: pointer; transition: all 0.2s; font-family: inherit; appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.rt-pace-selector select:hover { border-color: var(--rt-primary); background-color: var(--rt-surface2); }
.rt-pace-selector select:focus { outline: none; border-color: var(--rt-primary); box-shadow: 0 0 0 3px var(--rt-primary-soft); }


/* ============================================================
   14. RESPONSIVE
   ============================================================ */

/* Board: 2 columns at 1200px */
@media (max-width: 1200px) {
    .rt-board { grid-template-columns: repeat(2, 1fr); }
}

/* Discovery grid */
@media (max-width: 1024px) { .rt-discovery-grid { grid-template-columns: repeat(3, 1fr); } }

/* 768px — main mobile breakpoint */
@media (max-width: 768px) {

    /* Board → single column */
    .rt-board { grid-template-columns: 1fr; overflow-x: hidden; touch-action: pan-y; }

    /* Header */
    .rt-header        { flex-direction: column; align-items: flex-start; }
    .rt-main-title    { font-size: 1.5em; }
    .rt-quick-actions { width: 100%; flex-wrap: wrap; gap: 8px; align-items: center; }

    /* Скриваме inline discover — rt-discover-row го показва на отделен ред */
    .rt-quick-actions > .rt-discover-btn-inline { display: none !important; }

    /* Бутоните — ред 1, растат равномерно */
    .rt-quick-actions > .rt-btn {
        flex:    1 1 120px;
        order:   1;
        display: flex; align-items: center; justify-content: center; text-align: center;
    }

    /* Разделител — форсира нов ред преди иконите */
    .rt-quick-actions::after {
        content: '';
        width:   100%;
        order:   1;
        height:  0;
    }

    /* Иконите — ред 2, вдясно */
    .rt-notif-bell,
    .rt-logout-btn {
        order:       2;
        flex-shrink: 0;
        flex-grow:   0;
    }
    .rt-notif-bell { margin-left: auto; }

    /* Modal */
    .rt-modal-content { padding: 16px; }
    #rt-book-detail-modal > .rt-modal-content { padding: 16px 14px 40px; }

    /* Column */
    .rt-column {
        position: relative; overflow: visible !important;
        min-height: unset !important;
        touch-action: pan-y pinch-zoom;
        -webkit-tap-highlight-color: transparent;
        transform: translateZ(0);
    }

    /* rt-list скрит при lazy loading — без min-height */
    .rt-list { min-height: 0 !important; padding-bottom: 8px; }

    /* Компактна карта на мобилно — flex layout */
    .rt-book-card {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
        padding: 10px;
        min-height: unset;
        border-left-width: 4px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* Корицата — фиксирана вляво */
    .rt-book-cover {
        flex-shrink: 0;
        width: 56px;
        height: 84px;
        aspect-ratio: unset;
        margin-bottom: 0;
    }

    /* Съдържание — расте вдясно, без gap */
    .rt-book-content {
        flex: 1;
        min-width: 0;
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .rt-book-header    { margin-bottom: 1px; }
    .rt-book-title     { font-size: 0.9em; line-height: 1.25; }
    .rt-book-author    { font-size: 0.8em; margin-bottom: 2px; color: var(--rt-text-light); }
    .rt-book-series    { font-size: 0.76em; margin-bottom: 2px; }
    .rt-book-meta      { font-size: 0.75em; margin-bottom: 2px; }
    .rt-book-date      { font-size: 0.75em; margin-top: 1px; }

    /* Sticky column header */
    .rt-col-header {
        position: sticky; top: 0; z-index: 10;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        margin-left: -15px !important; margin-right: -15px !important;
        margin-top: -15px !important; border-radius: 0 !important;
        padding-left: 18px !important; border-left-width: 5px !important;
    }

    .rt-book-actions{ margin-top: 6px; padding-top: 6px; flex-direction: column; gap: 6px; }
    .rt-status-dropdown { font-size: 12px; padding: 6px 28px 6px 8px; min-height: 36px; width: 100%; }
    .rt-edit-btn        { display: none; }
    .rt-community-actions{ margin-top: 6px; gap: 6px; }
    .rt-community-btn   { font-size: 11px; padding: 4px 8px; }

    /* Touch scroll */
    html, body { overflow-x: hidden; overflow-y: auto; -webkit-overflow-scrolling: touch; height: 100%; }
    .rt-list   { touch-action: pan-y; -webkit-tap-highlight-color: transparent; }

    /* Goal card */
    .rt-goal-card   { padding: 20px; }
    .rt-goal-header { flex-direction: column; align-items: flex-start; }
    .rt-btn-edit-goal { width: 100%; text-align: center; }
    .rt-goal-emoji  { font-size: 40px; }
    .rt-goal-title h4 { font-size: 1.2em; }
    .rt-goal-subtitle { font-size: 1em; }

    /* Service buttons */
    .rt-service-actions  { padding: 20px 15px; margin: 30px 10px 20px; }
    .rt-service-buttons  { flex-direction: column; }
    .rt-service-buttons .rt-btn { width: 100%; }

    /* Discovery */
    .rt-discover-row { display: block; margin-top: 8px; }
    .rt-discover-btn-inline { display: none; }

    /* Author/series grid */
    .rt-as-grid { grid-template-columns: 1fr; }
}

/* 600px */
@media (max-width: 600px) {
    .rt-discovery-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .rt-discovery-title { font-size: 18px; }
}

/* 560px — book detail мобилно */
@media (max-width: 560px) {
    .rt-bd-wrap {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .rt-bd-cover-col {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .rt-bd-cover { width: 130px; }
    .rt-bd-cover-placeholder { width: 130px; height: 190px; font-size: 40px; }
    .rt-bd-cover-actions {
        width: 180px;
        align-self: center;
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .rt-bd-title { font-size: 22px; }
    .rt-bd-sidebar { margin-top: 0; }
}

/* 480px */
@media (max-width: 480px) {
    .rt-wrapper     { padding: 0 5px; margin: 20px auto; }
    .rt-column      { padding: 15px; }
    .rt-book-card   { padding: 12px; }
    .rt-form-actions{ flex-direction: column; }
    .rt-form-actions .rt-btn { width: 100%; }
    .rt-goal-empty  { padding: 30px 20px; }
    .rt-goal-empty-icon { font-size: 48px; }
    .rt-goal-empty h4   { font-size: 1.3em; }
}

/* ============================================================
   AUTOCOMPLETE SUGGEST
   ============================================================ */

.rt-autocomplete-wrap {
    position: relative;
}

.rt-suggest-list {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 9999;
    background: var(--rt-card-bg);
    border: 1px solid var(--rt-border);
    border-top: none;
    border-radius: 0 0 var(--rt-r2) var(--rt-r2);
    list-style: none;
    margin: 0;
    padding: 4px 0;
    box-shadow: var(--rt-shadow-hover);
    max-height: 220px;
    overflow-y: auto;
}

.rt-suggest-list li {
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
    color: var(--rt-text);
    transition: background 0.1s;
}

.rt-suggest-list li:hover,
.rt-suggest-list li.rt-suggest-active {
    background: var(--rt-primary-soft);
    color: var(--rt-primary);
}
/* ============================================================
   COLUMN SHELL — CSS custom properties вместо inline styles
   ============================================================ */

/* Фон и горна граница — --col-bg и --col-header-bg се задават от PHP */
.rt-column {
    background: var(--col-bg);
    border-top: 3px solid var(--col-color);
}

/* Хедър тинт */
.rt-col-header {
    background:    var(--col-header-bg);
    border-left:   4px solid var(--col-color);
    border-radius: 8px 8px 0 0;
    margin:        -20px -20px 0 -20px;
    padding:       14px 20px;
    cursor:        pointer;
}

/* Заглавие на колоната */
.rt-col-title {
    color:  var(--col-color, var(--rt-text));
    margin: 0;
    font-family: var(--rt-font-display);
}

/* Хедър десен блок */
.rt-col-header-right {
    display:     flex;
    align-items: center;
    gap:         10px;
}

/* Chevron */
.rt-col-chevron {
    font-size:  11px;
    opacity:    0.6;
    transition: transform 0.25s ease;
}

/* Preview корица */
.rt-col-preview-img {
    width:              42px;
    height:             62px;
    object-fit:         cover;
    object-position:    top;
    border-radius:      4px;
    opacity:            0.8;
    flex-shrink:        0;
}

.rt-col-preview-more {
    font-size:   12px;
    color:       #aaa;
    margin-left: 4px;
}

.rt-col-preview-empty {
    font-size: 12px;
    color:     #bbb;
    padding:   8px 0;
}

/* rt-list — display се управлява от .rt-column.rt-expanded в базовите правила */

/* Load more wrap — скрит по default */
.rt-col-load-more-wrap { display: none; }

/* Loading индикатор — скрит по default */
.rt-col-loading {
    display:     none;
    text-align:  center;
    padding:     20px;
    color:       var(--rt-text-light);
}

.rt-review-footer .rt-review-like-btn,
.rt-review-footer .rt-like-readonly {
    margin-right: auto;
}

.rt-like-readonly.rt-comment-action-btn {
    cursor: default;
}

.rt-like-readonly.rt-comment-action-btn:hover,
.rt-like-readonly.rt-comment-action-btn:focus {
    background: none;
    color: var(--rt-text-light);
}

.rt-like-heart {
    font-size: 17px;
    line-height: 1;
}