/* ===============================================
   BROADCASTING LIVE - CSS STYLES
   Single-page mobile broadcasting system
=============================================== */

/* Broadcasting Page Base */
.broadcasting-page {
    height: 100vh;
    width: 100vw;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent;
    display: flex;
    flex-direction: column;
    position: relative;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    z-index: 10;
}

/* Background Layer */
.broadcasting-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.broadcasting-background[data-background-type="image"] {
    background-color: #000;
}

.broadcasting-background[data-background-type="video"] {
    background-color: #000;
}

.broadcasting-background[data-background-type="color"] {
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
}

/* Background Image */
.bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(2px) brightness(0.8);
    transition: opacity 0.3s ease;
}

/* Background Video */
.bg-video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    transform: translate(-50%, -50%);
    object-fit: cover;
    filter: blur(6px) brightness(0.6);
    transition: opacity 0.3s ease;
}

/* Background Effects */
.bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.bg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.1);
}

.bg-vignette {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.1) 100%);
    pointer-events: none;
}

/* Fullscreen Body for Visitor Mode */
body {
    margin: 0;
    padding: 0;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
    background: transparent;
}

/* Remove WordPress body classes and styles for broadcasting page */
body.page-template-page-broadcasting-php {
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    width: 100vw !important;
    overflow: hidden !important;
    background: transparent !important;
}

/* Ensure no scrollbars */
html, body {
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
}

/* Viewer Frame Styles */
.viewer-frame {
    width: 100%;
    background: transparent;
    border: none;
    overflow: hidden;
    position: relative;
}

/* Fullscreen Mode (Visitor) */
.viewer-frame.fullscreen {
    height: 100vh;
    transform: none !important;
    transform-origin: none !important;
    border: none !important;
    box-shadow: none !important;
}

/* Editor Mode Layout Container */
.broadcasting-page.editor-mode {
    position: relative;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.broadcasting-page.editor-mode .viewer-frame.preview-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 0;
    /* La trasformazione scaleY comprime visivamente la preview */
}

.broadcasting-page.editor-mode .editor-controls {
    position: fixed;
    bottom: 0;
    left: 0;
    height: 33.33vh;
    z-index: 1;
}

/* Preview Mode (Editor) */
.viewer-frame.preview-mode {
    height: 100vh;
    border-bottom: 3px solid rgba(255,102,0,0.3);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    overflow: hidden;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 0;
    /* Comprime la preview al 66.66% dell'altezza mantenendo la proporzione */
    transform: scaleY(0.66);
    transform-origin: top left;
}

/* Iframe Container Layout */
.iframe-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: transparent;
}

.iframe-item {
    position: absolute;
    /*border: 1px solid #333;*/
    background: transparent;
    overflow: hidden;
    transition: all 0.3s ease;
    box-sizing: border-box;
}
/*
.iframe-item:hover {
    border-color: rgba(255,102,0,0.5);
    z-index: 999;
}
*/
.iframe-item iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    background: #000;
}

/*
.iframe-item[data-source="live-score"] {
    border-left: 4px solid #FE7200;
}

.iframe-item[data-source="graphics"] {
    border-left: 4px solid #242164;
}

.iframe-item[data-source="social"] {
    border-left: 4px solid #ff66cc;
}

.iframe-item[data-source="highlights"] {
    border-left: 4px solid #00d2ff;
}
*/
/* Editor Controls */
.editor-controls {
    height: 33.33vh;
    background: linear-gradient(180deg, rgba(0,0,0,0.1), rgba(0,0,0,0.9));
    border-top: 3px solid #FE7200;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden; /* Impedisci overflow verticale */
    position: relative; /* Per posizionare indicatori e frecce */
}

/* Mobile: Allow scrolling for carousel content */
@media (max-width: 768px) {
    .editor-controls {
        overflow-y: auto; /* Abilita scroll verticale su mobile */
        padding: 15px;
    }
    
    .controls-carousel {
        max-height: calc(100% - 40px); /* Lascia spazio per indicatori */
        overflow: hidden;
    }
}

/* Controls Carousel Container */
.controls-carousel {
    width: 100%;
    max-width: 800px;
    position: relative;
    overflow: hidden;
    height: 100%; /* Altezza fissa per contenere le slide */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
}

/* Controls Slide */
.controls-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    transition: opacity 0.4s ease-in-out;
    opacity: 0;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%; /* Altezza totale del contenitore padre */
    min-height: 100%; /* Assicura che occupi almeno tutta l'altezza disponibile */
}

.controls-slide.active {
    display: flex;
    opacity: 1;
    z-index: 10;
    height: 100%; /* Altezza totale del contenitore padre */
    min-height: 100%; /* Assicura che occupi almeno tutta l'altezza disponibile */
}

/* Controls Grid */
.controls-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    width: 100%;
    margin-bottom: 20px;
}

/* Navigation Indicators */
.controls-indicators {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 8px;
    z-index: 20;
}

.indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.indicator.active {
    background: #FE7200;
    border-color: rgba(255,102,0,0.6);
    transform: scale(1.3);
    box-shadow: 0 0 8px rgba(255,102,0,0.5);
}

.indicator:hover {
    background: rgba(255,102,0,0.6);
    transform: scale(1.2);
}

/* Navigation Arrows */
.nav-arrow {
    position: absolute;
    top: 10px;
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    color: #FE7200;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    font-size: 1.5em;
}

.nav-arrow:hover {
    background: rgba(255,102,0,0.2);
    border-color: rgba(255,102,0,0.6);
    transform: scale(1.1);
}

.nav-arrow.prev {
    left: 10px;
}

.nav-arrow.next {
    right: 10px;
}

/* Responsive for carousel */
@media (max-width: 768px) {
    .controls-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .nav-arrow {
        width: 35px;
        height: 35px;
        font-size: 1.2em;
    }
    
    .nav-arrow.prev {
        left: 5px;
    }
    
    .nav-arrow.next {
        right: 5px;
    }
}

/* Hide controls in visitor mode */
.broadcasting-page.visitor-mode .editor-controls {
    display: none !important;
}

/* Ensure controls are only visible in editor mode */
.broadcasting-page.editor-mode .editor-controls {
    display: flex !important;
}


/* Control Placeholder */
.control-placeholder {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    border-radius: 12px;
    padding: 20px 10px;
    text-align: center;
    color: rgba(255,255,255,0.8);
    font-weight: 600;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.control-placeholder:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,102,0,0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,102,0,0.2);
}

.control-icon {
    font-size: 2em;
    margin-bottom: 8px;
    display: block;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.control-placeholder:hover .control-icon {
    opacity: 1;
    transform: scale(1.1);
}

.control-label {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Score Dashboard */
.score-dashboard {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

/* Score Slide with Accordion */
.score-slide {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    border-radius: 12px;
    text-align: center;
    color: rgba(255,255,255,0.9);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 15px;
    width: 95%;
    height: 100%;
}

/* Accordion Container */
.accordion-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5vh;
    overflow: hidden;
}

/* Accordion Card */
.accordion-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,102,0,0.2);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.accordion-card:hover {
    border-color: rgba(255,102,0,0.4);
    background: rgba(255,255,255,0.08);
}

/* Active Accordion Card */
.accordion-card.active {
    flex: 1;
}

/* Accordion Header */
.accordion-header {
    width: 100%;
    background: transparent;
    border: none;
    padding: 0.2vh 12px; /* Altezza proporzionale al viewport */
    text-align: left;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    color: rgba(255,255,255,0.9);
    font-weight: 600;
    font-size: 3.5vw; /* Font size responsive */
    min-height: 1vh; /* Altezza minima proporzionale */
    flex: 0 0 auto;
}

.accordion-header:hover {
    background: rgba(255,102,0,0.1);
}

.accordion-header[aria-expanded="true"] {
    background: rgba(255,102,0,0.2);
    border-bottom: 1px solid rgba(255,102,0,0.4);
}

/* Accordion Icons and Text */
.accordion-icon {
    font-size: 1.2em;
    width: 24px;
    text-align: center;
}

.accordion-title {
    flex: 1;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.accordion-description {
    font-size: 0.75em;
    color: rgba(255,255,255,0.6);
    font-style: italic;
}

.accordion-arrow {
    font-size: 0.8em;
    transition: transform 0.3s ease;
}

.accordion-header[aria-expanded="true"] .accordion-arrow {
    transform: rotate(180deg);
}

/* Accordion Content */
.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    background: rgba(0,0,0,0.1);
    display: none;
    height: 0;
}

.accordion-content.active {
    display: flex;
    flex-direction: column;
    max-height: none; /* Rimuove il limite massimo */
    height: auto;
    flex: 1; /* Content fills remaining space in card */
    min-height: 0; /* Assicura che occupi almeno tutta l'altezza disponibile */
    padding: 0.5vh; /* Padding proporzionale al viewport */
    animation: slideDown 0.3s ease;
    overflow: auto; /* Permette lo scroll se il contenuto è troppo grande */
}

/* Hide title and description when any card is open */
.score-slide.has-open-cards #score-title,
.score-slide.has-open-cards #score-description {
    display: none;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats Dashboard */
.stats-dashboard {
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.stat-item {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,102,0,0.2);
    border-radius: 6px;
    padding: 10px;
    text-align: center;
}

.stat-label {
    font-size: 0.7em;
    color: rgba(255,255,255,0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 5px;
    display: block;
}

.stat-value {
    font-size: 1.2em;
    font-weight: 800;
    color: #FE7200;
}

.stats-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.stat-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,102,0,0.3);
    color: #FE7200;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.stat-btn:hover {
    background: rgba(255,102,0,0.2);
    border-color: rgba(255,102,0,0.6);
    color: #fff;
}

/* Card Content Fallback */
.card-content {
    padding: 15px;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9em;
}

.score-title {
    font-size: 1.4em;
    font-weight: 800;
    color: #FE7200;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 15px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    text-align: center;
}

.score-controls {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* Score Groups */
.score-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    justify-content: center;
}

/* Score content wrapper */
.score-content {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    justify-content: center;
}

/* Team name displayed above each score/set combo */
.team-name {
    font-size: 0.9em;
    color: #fff;
    text-align: center;
    margin-bottom: 4px;
    font-weight: 600;
}

/* Sets Containers */
.score-sets-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: clip;
}

.score-sets-btn {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.8em;
    color: #FE7200;
    box-shadow: 0 4px 15px rgba(255,102,0,0.2);
    position: relative;
    overflow: clip;
}

.score-sets-btn:hover {
    background: rgba(255,102,0,0.3);
    border-color: rgba(255,102,0,0.8);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255,102,0,0.4);
}

.score-sets-btn:active {
    transform: scale(0.95);
}

.score-sets-value {
    font-size: 1.1em;
    font-weight: 800;
    color: #FE7200;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.score-sets-label {
    font-size: 0.45em;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 1px 30px;
}

.score-btn {
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,102,0,0.3);
    border-radius: 50%;
    width: 7vh;
    height: 7vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.5em;
    color: #FE7200;
    box-shadow: 0 4px 15px rgba(255,102,0,0.2);
    position: relative;
    overflow: clip;
}

.score-btn:hover {
    background: rgba(255,102,0,0.3);
    border-color: rgba(255,102,0,0.8);
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(255,102,0,0.4);
}

.score-btn:active {
    transform: scale(0.95);
}

/* Service Indicator */
.score-btn.has-service {
    border-color: #ffffff;
    box-shadow: inset 0 0 6px rgba(255, 255, 255, 1), 0 0 60px rgba(255, 255, 255, 0.3);
    transform: scale(1);
}

/* Score Value and Label */
.score-value {
    font-size: 1.4em;
    font-weight: 800;
    color: #FE7200;
    margin-bottom: 10px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.score-label {
    font-size: 0.65em;
    font-weight: 800;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 1px;
    position: absolute;
    bottom: 0px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    padding: 1px 30px;
}

.score-btn-minus {
    background: rgba(255,255,255,0.2);
    color: #FE7200;
}

.score-btn-minus:hover {
    background: rgba(255,102,0,0.3);
}

.score-btn-plus {
    background: rgba(255,255,255,0.2);
    color: #FE7200;
}

.score-btn-plus:hover {
    background: rgba(255,102,0,0.3);
}

.score-btn-undo {
    background: rgba(255,255,255,0.2);
    color: #fe72006e;
    width: 40px;
    height: 40px;
    font-size: 1em;
}

.score-btn-undo:hover {
    background: rgba(102,102,102,0.3);
    color: #fff;
    border-color: rgba(102,102,102,0.8);
}

.score-title {
    font-size: 1.2em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #FE7200;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.score-description {
    font-size: 0.8em;
    color: rgba(255,255,255,0.7);
    font-weight: 400;
    letter-spacing: 1px;
}

.control-placeholder:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,102,0,0.6);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(255,102,0,0.2);
}

.control-icon {
    font-size: 2em;
    margin-bottom: 8px;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.control-placeholder:hover .control-icon {
    opacity: 1;
    transform: scale(1.1);
}

.control-label {
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

/* Publish Button Placeholder */
.publish-placeholder {
    background: linear-gradient(135deg, rgba(255,102,0,0.2), rgba(204,82,0,0.2));
    border: 3px solid #FE7200;
    border-radius: 15px;
    padding: 15px 20px;
    text-align: center;
    color: #FE7200;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    width: 80%;
    max-width: 300px;
    box-shadow: 0 4px 15px rgba(255,102,0,0.2);
    transition: all 0.3s ease;
    cursor: pointer;
    margin-top: 10px;
}

.publish-placeholder:hover {
    background: linear-gradient(135deg, rgba(255,102,0,0.3), rgba(204,82,0,0.3));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,102,0,0.4);
    border-color: #fff;
    color: #fff;
}

.publish-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
}

.publish-placeholder:hover {
    background: linear-gradient(135deg, rgba(255,102,0,0.3), rgba(204,82,0,0.3));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255,102,0,0.4);
    border-color: #fff;
    color: #fff;
}

.publish-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
    display: block;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .broadcasting-page {
        height: 100vh;
        width: 100vw;
    }
    
    .viewer-frame.preview-mode {
        height: 100vh;
    }
    
    .editor-controls {
        height: 33.33vh;
        padding: 10px;
        bottom: -66%;
    }
    
    .control-placeholder {
        min-height: 70px;
        padding: 15px 8px;
    }
    
    .control-icon {
        font-size: 1.8em;
    }
    
    .publish-placeholder {
        width: 90%;
        max-width: 280px;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .control-placeholder {
        min-height: 60px;
        padding: 12px 8px;
    }
    
    .control-icon {
        font-size: 1.6em;
    }
    
    .publish-placeholder {
        width: 95%;
        max-width: 250px;
        padding: 12px 16px;
    }
    
    .publish-icon {
        font-size: 1.3em;
    }
}

/* Landscape Orientation Support */
@media (orientation: landscape) {
    .broadcasting-page {
        flex-direction: row;
    }
    
    .viewer-frame.preview-mode {
        height: 100vh;
        width: 100vw;
        border-right: 3px solid rgba(255,102,0,0.3);
        border-bottom: none;
        /* In landscape, comprime orizzontalmente */
        transform: scaleX(0.66);
        transform-origin: top left;
    }
    
    .editor-controls {
        height: 100vh;
        width: 33.33vw;
        border-top: none;
        border-left: 3px solid #FE7200;
    }
    
    .iframe-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr 1fr 1fr;
    }
    
    .publish-placeholder {
        width: 100%;
        max-width: none;
    }
}

/* Tablet Portrait */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    .viewer-frame.preview-mode {
        height: 100vh;
    }
    
    .editor-controls {
        height: 30vh;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .viewer-frame.preview-mode {
        height: 100vh;
        width: 100vw;
        transform: scaleX(0.70);
        transform-origin: top left;
    }
    
    .editor-controls {
        height: 100vh;
        width: 30vw;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .viewer-frame.preview-mode {
        height: 100vh;
        width: 70vw;
    }
    
    .editor-controls {
        height: 100vh;
        width: 30vw;
    }
}

/* Tablet Landscape */
@media (min-width: 769px) and (max-width: 1024px) and (orientation: landscape) {
    .viewer-frame.preview-mode {
        height: 100vh;
        width: 70vw;
    }
    
    .editor-controls {
        height: 100vh;
        width: 30vw;
    }
}

/* Desktop (for testing) */
@media (min-width: 1025px) {
    .broadcasting-page {
        flex-direction: row;
    }
    
    .viewer-frame.preview-mode {
        height: 100vh;
        width: 100vw;
        border-right: 3px solid rgba(255,102,0,0.3);
        border-bottom: none;
        transform: scaleX(0.70);
        transform-origin: top left;
    }
    
    .editor-controls {
        height: 100vh;
        width: 30vw;
        border-top: none;
        border-left: 3px solid #FE7200;
    }
    
    .iframe-grid {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr 1fr 1fr 1fr;
    }
    
    .publish-placeholder {
        width: 100%;
        max-width: none;
    }
}

/* Accessibility */
.broadcasting-page:focus-within {
    outline: none;
}

.control-placeholder:focus,
.publish-placeholder:focus {
    outline: 3px solid rgba(255,102,0,0.5);
    outline-offset: 2px;
}

/* Loading States */
.iframe-item.loading {
    background: linear-gradient(90deg, #333 25%, #666 50%, #333 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Status Indicators */
.viewer-frame::after {
    content: attr(data-status);
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    opacity: 0.7;
}

.viewer-frame[data-status="live"]::after {
    background: linear-gradient(135deg, #FE7200, #cc4a00);
    color: white;
    box-shadow: 0 2px 8px rgba(255,102,0,0.4);
}

.viewer-frame[data-status="offline"]::after {
    background: linear-gradient(135deg, #666, #444);
    color: #ccc;
}

/* Debug Mode (optional) - DISABLED */
/* .broadcasting-page.debug .iframe-item {
    border: 2px dashed rgba(255,255,255,0.3);
}

.broadcasting-page.debug .iframe-item::after {
    content: attr(data-source);
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 2px 6px;
    font-size: 0.7em;
    border-radius: 4px;
    font-weight: 600;
} */

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .control-placeholder {
        border: 3px solid #fff;
        background: #000;
        color: #fff;
    }
    
    .publish-placeholder {
        border: 3px solid #fff;
        background: #000;
        color: #fff;
    }
    
    .viewer-frame.preview-mode {
        border-bottom: 4px solid #fff;
    }
    
    .editor-controls {
        border-top: 4px solid #fff;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .broadcasting-page,
    .viewer-frame,
    .iframe-item,
    .control-placeholder,
    .publish-placeholder {
        transition: none !important;
        animation: none !important;
    }
}

/* Print Styles */
@media print {
    .broadcasting-page {
        display: none;
    }
}

/* Score Config Dashboard */
.score-config-dashboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,102,0,0.2);
    border-radius: 6px;
}

/* Config Columns Layout */
.config-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
}

.config-column {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: rgba(0,0,0,0.2);
    padding: 6px;
    border-radius: 4px;
    border: 1px solid rgba(255,102,0,0.1);
}

.config-column-title {
    font-size: 0.7em;
    color: rgba(255,255,255,0.9);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
    text-align: center;
    padding: 2px 0;
    border-bottom: 1px solid rgba(255,102,0,0.2);
    margin-bottom: 2px;
}

.config-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(0,0,0,0.2);
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,102,0,0.1);
}

.config-row label {
    font-size: 0.7em;
    color: rgba(255,255,255,0.8);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
    margin-bottom: 2px;
}

.config-select {
    background: rgba(255,255,255,0.1);
    border: 2px solid rgba(255,102,0,0.3);
    color: #FE7200;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    box-sizing: border-box;
    height: 24px;
}

.config-select:hover {
    background: rgba(255,102,0,0.2);
    border-color: rgba(255,102,0,0.6);
    color: #fff;
}

.config-select:focus {
    outline: none;
    border-color: #FE7200;
    box-shadow: 0 0 6px rgba(255,102,0,0.4);
    background: rgba(255,102,0,0.3);
}

.config-select option {
    background: #000;
    color: #FE7200;
}

/* Field Mapping Overlay */
.field-mapping-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.75);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}
.field-mapping-overlay .overlay-inner {
    background: #111;
    padding: 20px 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 300px;
    width: 100%;
}
.field-mapping-overlay .mapping-list {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.field-mapping-overlay .mapping-item {
    background: #fe7200;
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
}
.field-mapping-overlay .mapping-close {
    background: transparent;
    border: 1px solid #fff;
    color: #fff;
    padding: 5px 10px;
    border-radius: 4px;
    cursor: pointer;
}
