/* Modern Relations Section */
.single-related {
    width: 97% !important;
    background: rgba(18, 22, 31, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    padding: 20px 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    box-sizing: border-box;
    direction: rtl;
    margin: 10px 0 24px;
    position: relative;
    overflow: hidden;
}

.single-related::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.35), transparent);
    pointer-events: none;
}

/* Header */
.single-related__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
}

.single-related__header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.single-related__header-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #60a5fa;
    font-size: 18px;
    flex-shrink: 0;
}

.single-related__header-title-group h2 {
    font-size: 16px;
    font-weight: 800;
    color: #f3f4f6;
    margin: 0;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    line-height: 1.3;
}

.single-related__header-title-group p {
    font-size: 12px;
    color: #9ca3af;
    margin: 3px 0 0;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    line-height: 1.4;
}

.single-related__header-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    white-space: nowrap;
}

.single-related__header-badge i {
    color: #60a5fa;
    font-size: 11px;
}

/* List & Cards */
.single-related__list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 360px));
    gap: 14px;
}

.single-related__card {
    --relation-color: #38bdf8;
    --relation-rgb: 56, 189, 248;
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

/* Color palettes per relation type */
.single-related__card--prequel {
    --relation-color: #f59e0b;
    --relation-rgb: 245, 158, 11;
}

.single-related__card--sequel {
    --relation-color: #10b981;
    --relation-rgb: 16, 185, 129;
}

.single-related__card--movie {
    --relation-color: #3b82f6;
    --relation-rgb: 59, 130, 246;
}

.single-related__card--side {
    --relation-color: #a855f7;
    --relation-rgb: 168, 85, 247;
}

.single-related__card--special {
    --relation-color: #f43f5e;
    --relation-rgb: 244, 63, 94;
}

.single-related__card--other {
    --relation-color: #06b6d4;
    --relation-rgb: 6, 182, 212;
}

.single-related__card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(var(--relation-rgb), 0.5);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 0 15px rgba(var(--relation-rgb), 0.15);
}

.single-related__card:focus-visible {
    outline: 2px solid var(--relation-color);
    outline-offset: 3px;
}

/* Poster */
.single-related__poster {
    width: 60px;
    height: 84px;
    flex-shrink: 0;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.25s ease;
}

.single-related__card:hover .single-related__poster {
    transform: scale(1.03);
}

.single-related__placeholder {
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.3);
    font-size: 22px;
}

/* Info */
.single-related__info {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.single-related__label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    width: fit-content;
    padding: 3px 9px;
    border-radius: 20px;
    background: rgba(var(--relation-rgb), 0.14);
    border: 1px solid rgba(var(--relation-rgb), 0.35);
    color: var(--relation-color);
    font-size: 11px;
    font-weight: 700;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    letter-spacing: -0.2px;
}

.single-related__label i {
    font-size: 10px;
}

.single-related__name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13.5px;
    font-weight: 700;
    color: #f3f4f6;
    text-align: start;
    font-family: 'IRANYekanX', 'Vazirmatn', sans-serif;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.single-related__card:hover .single-related__name {
    color: #ffffff;
}

/* Arrow */
.single-related__arrow-wrap {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #9ca3af;
    font-size: 12px;
    transition: all 0.25s ease;
}

.single-related__card:hover .single-related__arrow-wrap {
    background: var(--relation-color);
    border-color: var(--relation-color);
    color: #ffffff;
    transform: translateX(-4px);
    box-shadow: 0 2px 10px rgba(var(--relation-rgb), 0.4);
}

/* Day Mode */
.day .single-related {
    background: #ffffff !important;
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.day .single-related::before {
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.25), transparent);
}

.day .single-related__header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

.day .single-related__header-title-group h2 {
    color: #111827;
}

.day .single-related__header-title-group p {
    color: #6b7280;
}

.day .single-related__header-badge {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.08);
    color: #4b5563;
}

.day .single-related__card {
    background: #f8fafc;
    border-color: #e2e8f0;
}

.day .single-related__card:hover {
    background: #f1f5f9;
}

.day .single-related__name {
    color: #1e293b;
}

.day .single-related__poster {
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.day .single-related__placeholder {
    background: rgba(0, 0, 0, 0.04);
    color: #94a3b8;
}

.day .single-related__arrow-wrap {
    background: #e2e8f0;
    border-color: #cbd5e1;
    color: #64748b;
}

/* Responsive */
@media (max-width: 650px) {
    .single-related {
        padding: 16px;
        border-radius: 14px;
    }

    .single-related__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .single-related__header-badge {
        align-self: flex-start;
    }

    .single-related__list {
        grid-template-columns: 1fr;
    }
}
