/**
 * RIYL Modal Styles
 * User management modal for "Recommended If You Like"
 */

/* Purple theme color */
.bg-purple {
    background-color: #6f42c1 !important;
}

.text-purple {
    color: #6f42c1 !important;
}

.btn-purple {
    background-color: #6f42c1;
    border-color: #6f42c1;
    color: white;
}

.btn-purple:hover {
    background-color: #5a32a3;
    border-color: #5a32a3;
    color: white;
}

.btn-outline-purple {
    color: #6f42c1;
    border-color: #6f42c1;
}

.btn-outline-purple:hover {
    background-color: #6f42c1;
    color: white;
}

/* Source title display - wrapper styling (component styles in riylSourceTitle.css) */
.riyl-source-title {
    /* Additional wrapper styling if needed */
}

/* Search section */
.riyl-search-section {
    position: relative;
}

.riyl-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid var(--mv-border-color);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
}

.riyl-search-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.riyl-search-item:last-child {
    border-bottom: none;
}

.riyl-search-item:hover {
    background: #f8f9fa;
}

.riyl-search-item.riyl-no-results {
    cursor: default;
    color: #6c757d;
    justify-content: center;
}

.riyl-search-poster {
    width: 35px;
    height: 52px;
    object-fit: cover;
    border-radius: 3px;
    background: #374151;
    flex-shrink: 0;
}

.riyl-search-info {
    flex: 1;
    min-width: 0;
}

.riyl-search-title {
    display: block;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riyl-search-year {
    font-size: 0.8rem;
    color: #6c757d;
}

.riyl-add-btn {
    flex-shrink: 0;
}

/* Recommendations list */
.riyl-recommendations-list {
    max-height: 350px;
    overflow-y: auto;
}

.riyl-recommendation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.riyl-recommendation-item:last-child {
    border-bottom: none;
}

.riyl-rec-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #374151;
    flex-shrink: 0;
}

.riyl-rec-info {
    flex: 1;
    min-width: 0;
}

.riyl-rec-title {
    display: block;
    font-weight: 500;
    color: #212529;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riyl-rec-title:hover {
    color: #6f42c1;
}

.riyl-rec-year {
    font-size: 0.8rem;
    color: #6c757d;
}

.riyl-rec-note {
    font-size: 0.8rem;
    color: #6c757d;
    font-style: italic;
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riyl-rec-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.riyl-rec-actions .btn {
    padding: 4px 6px;
}

/* Suggestions section */
.riyl-suggestions-section {
    border-top: 1px solid var(--mv-border-color);
    padding-top: 15px;
}

.riyl-suggestions-list {
    max-height: 250px;
    overflow-y: auto;
}

.riyl-suggestion-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
}

.riyl-suggestion-item:last-child {
    margin-bottom: 0;
}

.riyl-sug-poster {
    width: 40px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background: #374151;
    flex-shrink: 0;
}

.riyl-sug-info {
    flex: 1;
    min-width: 0;
}

.riyl-sug-title {
    display: block;
    font-weight: 500;
    color: #212529;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.riyl-sug-title:hover {
    color: #6f42c1;
}

.riyl-sug-year {
    font-size: 0.8rem;
    color: #6c757d;
    margin-right: 5px;
}

.riyl-sug-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.riyl-sug-actions .btn {
    padding: 6px 10px;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .riyl-rec-actions {
        flex-wrap: wrap;
        gap: 2px;
    }

    .riyl-rec-actions .btn {
        padding: 3px 5px;
        font-size: 0.75rem;
    }

    .riyl-rec-poster {
        width: 35px;
        height: 52px;
    }

    .riyl-sug-poster {
        width: 35px;
        height: 52px;
    }

    .riyl-sug-actions .btn {
        padding: 4px 8px;
    }
}

/* ========================================
   DARK MODE OVERRIDES
   ======================================== */

[data-bs-theme="dark"] .riyl-search-dropdown {
    background: var(--mv-bg-card);
    border-color: var(--mv-border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
[data-bs-theme="dark"] .riyl-search-item {
    border-bottom-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .riyl-search-item:hover {
    background: var(--mv-bg-surface);
}
[data-bs-theme="dark"] .riyl-search-item.riyl-no-results {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .riyl-search-year {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .riyl-recommendation-item {
    border-bottom-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .riyl-rec-title {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .riyl-rec-year {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .riyl-rec-note {
    color: var(--mv-text-muted);
}
[data-bs-theme="dark"] .riyl-suggestions-section {
    border-top-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .riyl-suggestion-item {
    background: var(--mv-bg-surface);
    border-bottom-color: var(--mv-border-color);
}
[data-bs-theme="dark"] .riyl-sug-title {
    color: var(--mv-text-primary);
}
[data-bs-theme="dark"] .riyl-sug-year {
    color: var(--mv-text-muted);
}
