/*
 * CYC Youth Media Plugin - Card Style CSS
 * Version: 2.4 - 4 Cards Layout
 */

/* RESET */
.youth-media-container * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* MAIN CONTAINER */
.youth-media-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* MEDIA CARDS WRAPPER - 4 CARDS */
.media-cards-wrapper {
    display: flex;
    justify-content: center;
    align-items: stretch;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: nowrap;
}

/* MEDIA CARD BASE */
.media-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #FFFFFF;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    max-width: 120px;
}

.media-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.media-card:active {
    transform: translateY(-2px);
}

/* CARD ACCENT BAR - HIDDEN */
.card-accent-bar {
    display: none;
}

/* CARD BODY */
.card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    flex: 1;
}

/* CARD ICON */
.card-icon {
    width: 36px;
    height: 36px;
    margin-bottom: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.live-tv-card .card-icon svg {
    color: #FF4F00;
}

.radio-card .card-icon svg {
    color: #FF8C5A;
}

.ai-card .card-icon svg {
    color: #60A5FA;
}

.studio-card .card-icon svg {
    color: #F59E0B;
}

.media-card:hover .card-icon {
    transform: scale(1.1);
}

.ai-card:hover .card-icon {
    transform: scale(1.1) rotate(15deg);
}

/* CARD TITLE */
.card-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    text-align: center;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

/* HIDE OLD STUDIO LINK */
.studio-link-wrapper {
    display: none;
}

/* POPUP OVERLAY */
.media-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.media-popup.active {
    display: flex;
}

/* POPUP BACKDROP */
.popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

/* POPUP DIALOG */
.popup-dialog {
    position: relative;
    background: #FFFFFF;
    border-radius: 16px;
    width: 100%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: popupSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* POPUP HEADER */
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px;
    border-bottom: 1px solid #E5E7EB;
}

.popup-title {
    font-size: 24px;
    font-weight: 700;
    color: #374151;
    margin: 0;
}

.popup-close {
    background: #F3F4F6;
    border: none;
    border-radius: 8px;
    width: 36px;
    height: 36px;
    font-size: 24px;
    line-height: 1;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.popup-close:hover {
    background: #FF4F00;
    color: #FFFFFF;
}

.popup-close:active {
    transform: scale(0.95);
}

/* POPUP BODY */
.popup-body {
    padding: 32px;
    background: #FFFFFF;
}

/* MEDIA PLAYERS */
.media-player {
    width: 100%;
    border-radius: 8px;
    background: #000000;
}

#live-tv-iframe {
    width: 100%;
    height: 500px;
    border-radius: 8px;
    border: none;
}

#audio-player {
    width: 100%;
    height: 54px;
}

/* RESPONSIVE - TABLET */
@media screen and (max-width: 1024px) {
    .youth-media-container {
        padding: 32px 16px;
    }
    .media-cards-wrapper {
        gap: 14px;
    }
    .media-card {
        max-width: 105px;
    }
    .card-body {
        padding: 18px 10px;
    }
    .card-icon {
        width: 32px;
        height: 32px;
        margin-bottom: 8px;
    }
    .card-title {
        font-size: 12px;
    }
}

/* RESPONSIVE - MOBILE */
@media screen and (max-width: 768px) {
    .youth-media-container {
        padding: 24px 12px;
    }
    .media-cards-wrapper {
        gap: 10px;
        margin-bottom: 24px;
    }
    .media-card {
        max-width: none;
        min-width: 0;
        flex: 1;
    }
    .card-body {
        padding: 14px 8px;
    }
    .card-icon {
        width: 28px;
        height: 28px;
        margin-bottom: 7px;
    }
    .card-title {
        font-size: 11px;
    }
    .popup-header {
        padding: 20px 24px;
    }
    .popup-title {
        font-size: 20px;
    }
    .popup-body {
        padding: 24px;
    }
    .popup-close {
        width: 32px;
        height: 32px;
        font-size: 20px;
    }
    #live-tv-iframe {
        height: 300px;
    }
}

/* RESPONSIVE - SMALL MOBILE */
@media screen and (max-width: 480px) {
    .youth-media-container {
        padding: 20px 10px;
    }
    .media-cards-wrapper {
        gap: 8px;
    }
    .card-body {
        padding: 12px 6px;
    }
    .card-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 6px;
    }
    .card-title {
        font-size: 10px;
    }
    #live-tv-iframe {
        height: 250px;
    }
}

/* ACCESSIBILITY */
.media-card:focus,
.popup-close:focus {
    outline: 2px solid #FF4F00;
    outline-offset: 2px;
}

.media-card:focus:not(:focus-visible),
.popup-close:focus:not(:focus-visible) {
    outline: none;
}

/* REDUCED MOTION */
@media (prefers-reduced-motion: reduce) {
    .media-card,
    .card-icon,
    .popup-dialog {
        transition: none;
        animation: none;
    }
}

/* PRINT STYLES */
@media print {
    .media-popup,
    .popup-backdrop,
    .popup-close {
        display: none !important;
    }
    .media-card {
        box-shadow: none;
        border: 1px solid #E5E7EB;
        page-break-inside: avoid;
    }
}
