/* ==============================================
   Radio Card — Live Radio metadata card
   Liquid Glass + Premium design
   ============================================== */

/* --- Variables --- */
.radio-card {
    --rc-glass-bg: var(--t-glass-bg, rgba(255, 255, 255, 0.04));
    --rc-glass-border: var(--t-glass-border, rgba(255, 255, 255, 0.08));
    --rc-glass-blur: 16px;
    --rc-text-primary: var(--t-text-strong, #f3f4f6);
    --rc-text-secondary: var(--t-text-muted, rgba(255, 255, 255, 0.55));
    --rc-text-muted: var(--t-text-muted, rgba(255, 255, 255, 0.3));
    --rc-label-color: rgba(249, 115, 22, 0.75);
    --rc-accent: #F97316;
    --rc-radius: 18px;
    --rc-divider: var(--t-glass-border, rgba(255, 255, 255, 0.04));

    padding: 1.25rem;
    margin: 2rem 0 0.75rem;
    border-radius: var(--rc-radius);
    background: var(--rc-glass-bg);
    backdrop-filter: blur(var(--rc-glass-blur)) saturate(150%);
    -webkit-backdrop-filter: blur(var(--rc-glass-blur)) saturate(150%);
    border: 1px solid var(--rc-glass-border);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

/* Banner variant — remove top padding when banner present */
.radio-card--has-banner {
    padding-top: 0;
}

/* --- Banner image --- */
.radio-card__banner {
    position: relative;
    width: calc(100% + 2.5rem);
    margin: 0 -1.25rem 1rem;
    height: 160px;
    overflow: hidden;
    border-radius: var(--rc-radius) var(--rc-radius) 0 0;
}

.radio-card__banner img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.5);
    filter: brightness(0.75) contrast(1.1) saturate(1.15);
    transition: transform 0.4s ease, filter 0.4s ease;
}

.radio-card:hover .radio-card__banner img {
    transform: scale(1.6);
    filter: brightness(0.85) contrast(1.05) saturate(1.2);
}

/* Gradient overlay на банере */
.radio-card__banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            transparent 30%,
            var(--rc-glass-bg) 100%);
    pointer-events: none;
}

/* Hover lift */
.radio-card:hover {
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

/* --- Gradient border overlay (liquid glass) --- */
.radio-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--rc-radius);
    padding: 1px;
    background: linear-gradient(135deg,
            rgba(249, 115, 22, 0.15),
            rgba(255, 255, 255, 0.02) 40%,
            rgba(249, 115, 22, 0.08));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: exclude;
    pointer-events: none;
}

/* --- Header --- */
.radio-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--rc-divider);
}

.radio-card__badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--rc-label-color);
}

.radio-card__badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rc-accent);
    box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
    animation: rc-pulse 2s ease-in-out infinite;
}

@keyframes rc-pulse {

    0%,
    100% {
        opacity: 1;
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.5);
    }

    50% {
        opacity: 0.5;
        box-shadow: 0 0 16px rgba(249, 115, 22, 0.8);
    }
}

/* --- Top row: name+host left, broadcast right --- */
.radio-card__top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.radio-card__top-left {
    flex: 1;
    min-width: 0;
}

.radio-card__name {
    font-size: clamp(1.05rem, 0.95rem + 0.5vw, 1.3rem);
    font-weight: 700;
    color: var(--rc-text-primary);
    line-height: 1.2;
    letter-spacing: -0.015em;
    margin-bottom: 0.4rem;
}

/* --- Host row --- */
.radio-card__host {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.radio-card__host-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--rc-accent);
    flex-shrink: 0;
}

.radio-card__host-icon svg {
    width: 18px;
    height: 18px;
}

.radio-card__host-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.radio-card__host-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--rc-text-primary);
    line-height: 1.3;
}

/* --- Voice dropdown (inline badge → dropdown) --- */
.radio-card__voice-wrap {
    display: inline-flex;
    margin-left: 0.5rem;
    vertical-align: middle;
}

.rc-dropdown--voice {
    position: relative;
}

.rc-dropdown__trigger--voice {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.5rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--rc-accent);
    background: rgba(249, 115, 22, 0.08);
    border: 1px solid rgba(249, 115, 22, 0.15);
    border-radius: 9999px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
    min-width: unset;
    width: auto;
}

.rc-dropdown__trigger--voice:hover {
    background: rgba(249, 115, 22, 0.15);
    border-color: rgba(249, 115, 22, 0.3);
}

.rc-dropdown--voice.rc-dropdown--open .rc-dropdown__trigger--voice {
    background: rgba(249, 115, 22, 0.2);
    border-color: var(--rc-accent);
}

.rc-dropdown__panel--voice {
    min-width: 260px;
}

/* --- Broadcast button (inline) --- */
.radio-card__broadcast-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: 9999px;
    background: linear-gradient(135deg, #F97316, #EA580C);
    color: #fff !important;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 12px rgba(249, 115, 22, 0.3);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
    flex-shrink: 0;
}

.radio-card__broadcast-btn span,
.radio-card__broadcast-btn svg {
    color: #fff !important;
    fill: #fff !important;
    stroke: #fff !important;
}

.radio-card__broadcast-btn:hover {
    background: linear-gradient(135deg, #FB923C, #F97316);
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(249, 115, 22, 0.4);
}

.radio-card__broadcast-btn:active {
    transform: scale(0.97);
}

.radio-card__broadcast-btn svg {
    width: 16px;
    height: 16px;
}

/* --- Edit button (inline icon in host row) --- */
.radio-card__edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1px solid var(--rc-glass-border);
    border-radius: 6px;
    background: transparent;
    color: var(--rc-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-left: 0.25rem;
    padding: 0;
}

.radio-card__edit-btn svg {
    width: 12px;
    height: 12px;
}

.radio-card__edit-btn:hover {
    color: var(--rc-accent);
    border-color: rgba(249, 115, 22, 0.3);
    background: rgba(249, 115, 22, 0.08);
}

.radio-card__edit-btn:active {
    transform: scale(0.9);
}

/* --- Config row (prompt + personas dropdowns side by side) --- */
.radio-card__config-row {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0 0.5rem;
    margin-top: 0.25rem;
    border-top: 1px solid var(--rc-divider);
}

.radio-card__config-col {
    flex: 1;
    min-width: 0;
}

/* --- Dropdown wrapper --- */
.rc-dropdown {
    position: relative;
}

.rc-dropdown__label {
    display: block;
    margin-bottom: 0.25rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.55rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--rc-text-muted);
}

/* --- Trigger button --- */
.rc-dropdown__trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0.4rem 0.625rem;
    background: var(--t-glass-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--t-glass-border, rgba(255, 255, 255, 0.08));
    border-radius: 8px;
    color: var(--rc-text-primary);
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.7rem;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rc-dropdown__trigger::after {
    content: '';
    flex-shrink: 0;
    margin-left: auto;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--rc-text-muted);
    transition: transform 0.2s;
}

.rc-dropdown--open .rc-dropdown__trigger::after {
    transform: rotate(180deg);
}

.rc-dropdown__trigger:hover {
    border-color: rgba(249, 115, 22, 0.25);
}

.rc-dropdown__trigger:focus {
    outline: none;
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.rc-dropdown__trigger--placeholder {
    color: var(--rc-text-muted);
    font-style: italic;
    font-weight: 400;
}

/* --- Dropdown panel --- */
.rc-dropdown__panel {
    /* Vlastní proměnné — panel může být portálován mimo .radio-card */
    --rc-text-primary: var(--t-text-strong, #f3f4f6);
    --rc-text-muted: var(--t-text-muted, rgba(255, 255, 255, 0.3));
    --rc-accent: #F97316;

    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 60;
    background: var(--t-glass-bg, rgba(15, 15, 25, 0.92));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--t-glass-border, rgba(255, 255, 255, 0.1));
    border-radius: 10px;
    padding: 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px) scale(0.98);
    transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
    max-height: 280px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--t-text-muted, rgba(255, 255, 255, 0.15)) transparent;
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.2),
        0 0 0 1px var(--t-glass-border, rgba(255, 255, 255, 0.04)) inset;
}

.rc-dropdown--open .rc-dropdown__panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* --- Dropdown item --- */
.rc-dropdown__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 7px;
    cursor: pointer;
    transition: background-color 0.12s;
    user-select: none;
}

.rc-dropdown__item:hover {
    background: rgba(249, 115, 22, 0.1);
}

/* --- Custom checkbox --- */
.rc-dropdown__checkbox {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border: 1.5px solid var(--rc-text-muted);
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

.rc-dropdown__checkbox:checked {
    background: var(--rc-accent);
    border-color: var(--rc-accent);
}

.rc-dropdown__checkbox:checked::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 4.5px;
    width: 5px;
    height: 8px;
    border: solid white;
    border-width: 0 1.5px 1.5px 0;
    transform: rotate(45deg);
}

/* --- Custom radio button --- */
.rc-dropdown__radio {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border: 1.5px solid var(--rc-text-muted);
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: border-color 0.15s, background-color 0.15s;
}

.rc-dropdown__radio:checked {
    border-color: var(--rc-accent);
}

.rc-dropdown__radio:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rc-accent);
}

/* --- Text content --- */
.rc-dropdown__text-wrap {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.rc-dropdown__name {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--rc-text-primary);
    line-height: 1.3;
}

.rc-dropdown__desc {
    font-size: 0.575rem;
    color: var(--rc-text-muted);
    line-height: 1.3;
}

/* --- Empty state --- */
.rc-dropdown__empty {
    padding: 8px 10px;
    font-size: 0.65rem;
    color: var(--rc-text-muted);
    font-style: italic;
}

/* --- Collapsible details --- */
.radio-card__details {
    margin-top: 0.25rem;
    border-top: 1px solid var(--rc-divider);
}

.radio-card__details-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--rc-text-muted);
    cursor: pointer;
    list-style: none;
    user-select: none;
    transition: color 0.2s ease;
}

.radio-card__details-toggle::-webkit-details-marker {
    display: none;
}

.radio-card__details-toggle::before {
    content: '▸';
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.radio-card__details[open] .radio-card__details-toggle::before {
    transform: rotate(90deg);
}

.radio-card__details-toggle:hover {
    color: var(--rc-text-secondary);
}

/* --- Info grid (inside details) --- */
.radio-card__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem 1.25rem;
    padding-bottom: 0.5rem;
}

.radio-card__field {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.radio-card__field--full {
    grid-column: 1 / -1;
}

.radio-card__field-label {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.575rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--rc-text-muted);
}

.radio-card__field-value {
    font-size: 0.8125rem;
    color: var(--rc-text-secondary);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    cursor: pointer;
    border-radius: 6px;
    padding: 0.25rem 0.35rem;
    margin: -0.25rem -0.35rem;
    border: 1px solid transparent;
    transition: border-color 0.2s, background 0.2s;
}

.radio-card__field-value:hover {
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

/* --- Editing state --- */
.radio-card__field-value--editing {
    display: block;
    -webkit-line-clamp: unset;
    overflow: visible;
    border-color: rgba(249, 115, 22, 0.4);
    background: rgba(249, 115, 22, 0.05);
}

.radio-card__field-textarea {
    width: 100%;
    min-height: 3rem;
    max-height: 12rem;
    padding: 0.35rem 0.4rem;
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--rc-text-primary, #f3f4f6);
    background: rgba(15, 15, 25, 0.6);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 6px;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
}

.radio-card__field-textarea:focus {
    border-color: var(--rc-accent, #F97316);
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.15);
}

/* ==============================================
   Responsive — Mobile
   ============================================== */
@media (max-width: 640px) {
    .radio-card {
        padding: 1rem;
        margin: 1.25rem 0 0.5rem;
        --rc-glass-blur: 12px;
    }

    /* --- Disable ALL hover effects on mobile --- */
    .radio-card:hover {
        transform: none;
        box-shadow:
            0 8px 32px rgba(0, 0, 0, 0.25),
            inset 0 1px 0 rgba(255, 255, 255, 0.06);
    }

    .radio-card:hover .radio-card__banner img {
        transform: scale(1.5);
        filter: brightness(0.75) contrast(1.1) saturate(1.15);
    }

    .radio-card__broadcast-btn:hover {
        background: linear-gradient(135deg, #F97316, #EA580C);
        transform: none;
        box-shadow: 0 3px 12px rgba(249, 115, 22, 0.3);
    }

    .radio-card__details-toggle:hover {
        color: var(--rc-text-muted);
    }

    .radio-card--has-banner {
        padding-top: 0;
    }

    .radio-card__top-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .radio-card__broadcast-btn {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1rem;
    }

    .radio-card__grid {
        grid-template-columns: 1fr;
        gap: 0.625rem;
    }

    .radio-card__banner {
        width: calc(100% + 2rem);
        margin: 0 -1rem 0.75rem;
        height: 130px;
    }

    .radio-card__name {
        font-size: 1rem;
    }

    .radio-card__field-value {
        font-size: 0.75rem;
    }
}


/* ==============================================
   Reduced motion
   ============================================== */
@media (prefers-reduced-motion: reduce) {
    .radio-card {
        transition: none;
    }

    .radio-card:hover {
        transform: none;
    }

    .radio-card__badge-dot {
        animation: none;
    }

    .radio-card__broadcast-btn {
        transition: none;
    }
}