/**
 * Frontend Core Styles: Video Suite, Search Bar, Video Cards, Badges, Toasts, Social
 */
:root {
    --rnd-primary: #a12484;
    --rnd-primary-hover: #861c6d;
    --rnd-bg-card: #ffffff;
    --rnd-border: #e2e8f0;
    --rnd-text: #1e293b;
    --rnd-text-muted: #64748b;
    --rnd-radius: 10px;
    --rnd-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

.rnd-suite-container {
    width: 100%;
    margin: 30px 0;
    box-sizing: border-box;
    font-family: inherit;
}

.rnd-suite-container *,
.rnd-suite-container *::before,
.rnd-suite-container *::after {
    box-sizing: border-box;
}

/* Search Bar Suite */
.rnd-search-suite-wrap {
    margin-bottom: 30px;
}

.rnd-search-header-row {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
    width: 100%;
}

.rnd-search-input-box {
    position: relative;
    flex: 1;
    min-width: 0;
    width: 100%;
}

.rnd-input-inner {
    display: flex;
    align-items: center;
    background: #fff;
    border: 2px solid var(--rnd-primary);
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--rnd-shadow);
    transition: box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.rnd-input-inner:focus-within {
    box-shadow: 0 0 0 4px rgba(161, 36, 132, 0.15);
}

.rnd-search-lens {
    padding-left: 16px;
    color: var(--rnd-primary);
    font-size: 15px;
    flex-shrink: 0;
}

.rnd-query-input {
    flex: 1;
    min-width: 0 !important;
    border: none !important;
    outline: none !important;
    padding: 10px 14px !important;
    font-size: 14.5px !important;
    background: transparent !important;
    color: var(--rnd-text) !important;
    box-shadow: none !important;
    text-overflow: ellipsis;
}

.rnd-btn-search-action {
    background: var(--rnd-primary);
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14.5px;
    transition: background 0.2s;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    line-height: 1.4;
}

.rnd-btn-search-action:hover {
    background: var(--rnd-primary-hover);
}

.rnd-btn-search-icon {
    display: none;
}

@media (max-width: 520px) {
    .rnd-search-lens {
        padding-left: 12px;
        font-size: 14px;
    }

    .rnd-query-input {
        padding: 8px 10px !important;
        font-size: 13.5px !important;
    }

    .rnd-btn-search-action {
        padding: 8px 16px;
        font-size: 13.5px;
    }
}

@media (max-width: 400px) {
    .rnd-search-lens {
        display: none;
    }

    .rnd-query-input {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }

    .rnd-btn-search-action {
        padding: 8px 14px;
    }

    .rnd-btn-search-text {
        display: inline-block;
    }
}

/* Autocomplete Dropdown */
.rnd-suggestions-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid var(--rnd-border);
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    max-height: 280px;
    overflow-y: auto;
}

.rnd-suggestion-item {
    padding: 10px 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--rnd-text);
    transition: background 0.15s;
}

.rnd-suggestion-item:hover {
    background: #f8fafc;
    color: var(--rnd-primary);
}

.rnd-suggestion-item i {
    color: var(--rnd-text-muted);
    font-size: 12px;
}

/* Search Controls (Filters & Auth) */
.rnd-search-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.rnd-btn-filter-toggle,
.rnd-btn-auth {
    padding: 10px 18px;
    border-radius: 20px;
    border: 1px solid var(--rnd-border);
    background: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--rnd-text);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.rnd-btn-filter-toggle:hover,
.rnd-btn-auth:hover {
    border-color: var(--rnd-primary);
    color: var(--rnd-primary);
}

.rnd-btn-signin {
    background: #fdf2f8 !important;
    color: #a12484 !important;
    border: 1.5px solid #f472b6 !important;
    font-weight: 600;
    transition: all 0.25s ease;
}

.rnd-btn-signin:hover {
    background: #fce7f3 !important;
    color: #861c6d !important;
    border-color: #a12484 !important;
    box-shadow: 0 4px 10px rgba(161, 36, 132, 0.15);
    transform: translateY(-1px);
}

.rnd-btn-signout {
    background: #ffffff !important;
    color: #ef4444 !important;
    border: 1.5px solid #fecaca !important;
    font-weight: 600;
    transition: all 0.25s ease;
}

.rnd-btn-signout:hover {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
    color: #b91c1c !important;
}

/* Collapsible Filter Drawer */
.rnd-filters-drawer {
    margin-top: 16px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid var(--rnd-border);
    border-radius: var(--rnd-radius);
}

.rnd-filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    align-items: center;
}

.rnd-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rnd-filter-group label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--rnd-text-muted);
}

.rnd-filter-group select {
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--rnd-border);
    font-size: 14px;
    background: #fff;
}

/* Toggle Switch */
.rnd-toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.rnd-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.rnd-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #cbd5e1;
    transition: .3s;
    border-radius: 24px;
}

.rnd-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked+.rnd-slider {
    background-color: var(--rnd-primary);
}

input:checked+.rnd-slider:before {
    transform: translateX(20px);
}

.rnd-ai-label-sub {
    font-size: 11px;
    color: var(--rnd-text-muted);
}

/* Video Card Component */
.rnd-video-card {
    background: var(--rnd-bg-card);
    border: 1px solid var(--rnd-border);
    border-radius: var(--rnd-radius);
    overflow: hidden;
    box-shadow: var(--rnd-shadow);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s;
}

.rnd-video-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -3px rgba(0, 0, 0, 0.12);
}

/* Thumbnail Wrap */
.rnd-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
    background: #0f172a;
    cursor: pointer;
    overflow: hidden;
}

.rnd-video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.rnd-video-card:hover .rnd-video-thumb {
    transform: scale(1.05);
}

.rnd-badge-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 4px;
    z-index: 2;
}

.rnd-play-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s;
    z-index: 1;
}

.rnd-video-card:hover .rnd-play-overlay {
    opacity: 1;
}

.rnd-play-icon {
    width: 46px;
    height: 46px;
    background: var(--rnd-primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    padding-left: 3px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* Video Body */
.rnd-video-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.rnd-video-title {
    margin: 0 0 10px 0;
    font-size: 15px;
    line-height: 1.4;
    font-weight: 700;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rnd-video-title a {
    color: var(--rnd-text);
    text-decoration: none !important;
    transition: color 0.15s;
}

.rnd-video-title a:hover,
.rnd-video-title a:focus,
.rnd-video-title a:active {
    color: var(--rnd-primary);
    text-decoration: none !important;
}

.rnd-video-meta {
    font-size: 12px;
    color: var(--rnd-text-muted);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.rnd-meta-divider {
    color: #cbd5e1;
}

.rnd-hashtag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 12px;
}

.rnd-hashtag {
    background: #f1f5f9;
    color: var(--rnd-primary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.rnd-video-snippet {
    font-size: 13px;
    color: var(--rnd-text-muted);
    line-height: 1.5;
    margin: 0 0 14px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Card Action Buttons */
.rnd-card-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px solid var(--rnd-border);
}

.rnd-rating-group {
    display: flex;
    gap: 4px;
}

.rnd-btn-rate {
    border: none;
    background: #f1f5f9;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: var(--rnd-text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.rnd-btn-rate:hover {
    background: #e2e8f0;
}

.rnd-btn-rate.active {
    background: var(--rnd-primary);
    color: #fff;
}

.rnd-extra-actions {
    display: flex;
    gap: 6px;
}

.rnd-btn-ai-summary {
    background: #fdf2f8;
    color: var(--rnd-primary);
    border: 1px solid #fbcfe8;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s;
}

.rnd-btn-ai-summary:hover {
    background: #fce7f3;
}

.rnd-btn-share {
    background: #f1f5f9;
    color: var(--rnd-text-muted);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.rnd-btn-share:hover {
    color: var(--rnd-primary);
    background: #e2e8f0;
}

/* Pagination Button */
.rnd-pagination-container {
    text-align: center;
    margin-top: 36px;
}

.rnd-btn-load-more {
    background: var(--rnd-primary) !important;
    color: #fff !important;
    padding: 12px 30px !important;
    border-radius: 30px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    border: none !important;
    cursor: pointer;
    box-shadow: var(--rnd-shadow);
    transition: all 0.2s;
}

.rnd-btn-load-more:hover {
    background: var(--rnd-primary-hover) !important;
    transform: translateY(-2px);
}

/* Toast Notifications */
.rnd-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #1e293b;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    z-index: 100000;
    animation: rndFadeInOut 3s ease forwards;
}

@keyframes rndFadeInOut {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    15% {
        opacity: 1;
        transform: translateY(0);
    }

    85% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* ==========================================================================
   Channel Card Presentation Styles (Solution C)
   ========================================================================== */
.rnd-card-channel {
    border-color: rgba(161, 36, 132, 0.15);
    background: #ffffff;
}

.rnd-thumb-channel {
    padding-top: 52%;
    background: linear-gradient(135deg, #fdf2f8 0%, #f1f5f9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rnd-avatar-thumb {
    width: 88px !important;
    height: 88px !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 50%;
    border: 3px solid #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: cover;
}

@media (max-width: 600px) {
    .rnd-avatar-thumb {
        width: 70px !important;
        height: 70px !important;
    }
}

.rnd-card-channel:hover .rnd-avatar-thumb {
    transform: translate(-50%, -50%) scale(1.06) !important;
}

.rnd-channel-overlay {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.rnd-card-channel:hover .rnd-channel-overlay {
    opacity: 1;
    transform: translateX(-50%) translateY(-2px);
}

.rnd-channel-pill {
    background: #ff0000;
    color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    box-shadow: 0 2px 8px rgba(255, 0, 0, 0.4);
}

.rnd-channel-badge-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #fdf2f8;
    color: var(--rnd-primary, #a12484);
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    border: 1px solid rgba(161, 36, 132, 0.2);
}

.rnd-btn-visit-channel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    background: linear-gradient(135deg, #ff0000 0%, #dc2626 100%);
    color: #ffffff !important;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-decoration: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: 0 3px 10px rgba(220, 38, 38, 0.28);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    line-height: 1.4;
}

.rnd-btn-visit-channel i {
    font-size: 13px;
}

.rnd-btn-visit-channel:hover,
.rnd-btn-visit-channel:focus,
.rnd-btn-visit-channel:active {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(220, 38, 38, 0.4);
    text-decoration: none !important;
}

/* ==========================================================================
   Live Search Loading & Notice States Centering
   ========================================================================== */
.rnd-search-loading,
.rnd-search-notice,
.rnd-search-error {
    grid-column: 1 / -1 !important;
    column-span: all !important;
    width: 100% !important;
    min-width: 100% !important;
    flex: 1 1 100% !important;
    margin: 0 auto !important;
    padding: 48px 20px !important;
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
}