/* ==================== RESET Y VARIABLES ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #c03;
    --primary-dark: #002a5a;
    --primary-light: #1a4a8a;

    /* Colores premium */
    --premium-gold: #daa135;
    --premium-dark: #0b0b0b;
    --premium-bg: linear-gradient(135deg, #fef5e7 0%, #fff 100%);

    /* Colores de fondo */
    --bg-main: hsl(30, 20%, 98%);
    --bg-white: #ffffff;
    --bg-gray: hsl(30, 6%, 90%);

    /* Colores de texto */
    --text-dark: hsl(24, 10%, 10%);
    --text-gray: hsl(24, 6%, 45%);
    --text-white: #ffffff;

    /* Bordes */
    --border-light: hsl(225, 19%, 92%);
    --border-gray: hsl(30, 6%, 90%);

    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-premium: rgba(218, 161, 53, 0.25) 0px 2px 12px;

    /* Espaciado */
    --spacing-1: 0.25rem;
    --spacing-2: 0.5rem;
    --spacing-3: 0.75rem;
    --spacing-4: 1rem;
    --spacing-5: 1.25rem;
    --spacing-6: 1.5rem;
    --spacing-8: 2rem;
    --spacing-9: 2.25rem;
    --spacing-10: 2.5rem;

    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;
}

/* ==================== LAYOUT PRINCIPAL ==================== */
body {
    font-family: 'Inter', 'Roboto', sans-serif;
    background-color: var(--bg-main);
    overflow: hidden;
}

.app-container {
    height: 100vh;
    width: 100vw;
    background-color: var(--bg-main);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.main-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: var(--spacing-4);
    padding: var(--spacing-4);
    min-height: 0;
}

/* ==================== PANEL DE ESPERA (WAITING) ==================== */
.waiting-panel {
    grid-column: span 3;
    min-height: 0;
}

.waiting-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-gray);
    height: 100%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
}

.waiting-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--primary-color);
}

.waiting-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-2) var(--spacing-6);
    border-bottom: 1px solid var(--border-light);
    padding-top: var(--spacing-3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: var(--spacing-3);
}

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-gray);
}

.header-icon svg {
    width: 24px;
    height: 24px;
    color: var(--primary-color);
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dark);
}

@media (min-width: 1024px) {
    .header-title {
        font-size: 2.25rem;
    }
}

.waiting-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray);
    background-color: var(--bg-gray);
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--radius-full);
}

.waiting-content {
    flex: 1;
    min-height: 0;
    height: calc(100% - 80px);
}

.waiting-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    height: 100%;
    padding: var(--spacing-4);
    overflow-y: hidden;
}

/* ==================== PANEL DE LLAMADOS (CALLING) ==================== */
.calling-panel {
    grid-column: span 9;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-4);
    min-height: 0;
}

.calling-section {
    flex: 50;
    min-height: 0;
}

.calling-card {
    background-color: var(--primary-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    height: 100%;
    overflow: hidden;
}

.calling-content {
    height: 100%;
}

.calling-empty {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-8);
    background-color: var(--primary-color);
    border-radius: var(--radius-xl);
}

.calling-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--spacing-6);
}

.calling-empty-icon svg {
    width: 40px;
    height: 40px;
    color: var(--text-white);
}

.calling-empty-title {
    font-size: 1.875rem;
    color: var(--text-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: bold;
}

.calling-empty-subtitle {
    font-size: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: var(--spacing-2);
}

/* Estilos para llamado activo */
.calling-active {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--spacing-6);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: var(--text-white);
}

.calling-active::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom right, rgba(0, 0, 0, 0.2), transparent);
    pointer-events: none;
}

.calling-bounce {
    animation: bounce 0.5s ease-in-out 3;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.calling-label {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: var(--spacing-4);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .calling-label {
        font-size: 2.25rem;
    }
}

.calling-number {
    font-size: 8rem;
    line-height: 1;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: -0.025em;
    text-shadow: 0 10px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

.calling-module {
    margin-top: var(--spacing-6);
    padding: var(--spacing-3) var(--spacing-10);
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

.calling-module span {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 1024px) {
    .calling-module span {
        font-size: 2.25rem;
    }
}

/* Estilos premium para llamado */
.calling-premium {
    background-image: url('https://hmtubiemgqfuzcdxyacs.supabase.co/storage/v1/object/public/img/BACK-VERDE.png');
    background-color: rgb(22, 136, 102);
}

.calling-premium::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background-color: var(--premium-gold);
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-2);
    border-radius: var(--radius-full);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-1) var(--spacing-4);
    margin-bottom: var(--spacing-4);
    background-color: var(--premium-dark);
    border: 2px solid var(--premium-gold);
    box-shadow: var(--shadow-premium);
    position: relative;
    z-index: 1;
}

.premium-badge svg {
    width: 20px;
    height: 20px;
    color: var(--text-white);
}

.premium-badge span {
    font-size: 0.875rem;
    color: var(--text-white);
}

.calling-premium-label {
    color: var(--premium-gold);
}

.calling-premium-module {
    background-color: var(--premium-dark);
    border: 2px solid var(--premium-gold);
}

.calling-premium-module span {
    color: var(--text-white);
}

/* ==================== PANEL EN ATENCIÓN (INCALL) ==================== */
.incall-section {
    flex: 50;
    min-height: 0;
}

.incall-card {
    background-color: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-gray);
    height: 100%;
    position: relative;
    overflow: hidden;
}

.incall-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background-color: var(--primary-color);
}

.incall-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-2) var(--spacing-6);
    border-bottom: 1px solid var(--border-light);
    padding-top: var(--spacing-3);
}

.header-icon-green svg {
    color: hsl(160, 84%, 19%);
}

.incall-count {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-gray);
    background-color: var(--bg-gray);
    padding: var(--spacing-1) var(--spacing-3);
    border-radius: var(--radius-full);
}

.incall-content {
    height: calc(100% - 80px);
    padding: 0 var(--spacing-4) var(--spacing-4) 0;
    overflow-y: auto;
}

.incall-list {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: var(--spacing-3);
    padding: var(--spacing-2) 0;
    transition: transform 0.5s ease-in-out;
}

.incall-item {
    flex-shrink: 0;
    height: 88px;
}

.incall-item-inner {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--spacing-4);
    padding: var(--spacing-4) var(--spacing-5);
    border-radius: var(--radius-md);
    background-color: var(--bg-white);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-gray);
}

.incall-number {
    font-size: 2.25rem;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: -0.025em;
    color: var(--text-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 1024px) {
    .incall-number {
        font-size: 3rem;
    }
}

.incall-module {
    font-size: 1.875rem;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: -0.025em;
    padding: var(--spacing-1) var(--spacing-4);
    border-radius: var(--radius-full);
    white-space: nowrap;
    color: var(--text-dark);
}

@media (min-width: 1024px) {
    .incall-module {
        font-size: 3rem;
    }
}

.incall-spacer {
    width: 90px;
}

/* ==================== TURN ITEM EN ESPERA ==================== */
.turn-item {
    border-radius: var(--radius-md);
    padding: var(--spacing-5);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-md);
    transition: all 0.3s;
    border: 1px solid var(--bg-white);
    background-color: var(--bg-white);
}

.turn-item.premium {
    border-color: var(--premium-gold);
    background: var(--premium-bg);
}

.turn-number {
    font-size: 1.875rem;
    font-weight: bold;
    font-family: monospace;
    letter-spacing: -0.025em;
    color: var(--text-dark);
}

@media (min-width: 1024px) {
    .turn-number {
        font-size: 3.75rem;
    }
}

.premium-tag {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    border-radius: var(--radius-full);
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: var(--spacing-1) var(--spacing-2);
    background-color: var(--premium-dark);
    border: 2px solid var(--premium-gold);
    box-shadow: var(--shadow-premium);
}

.premium-tag svg {
    width: 12px;
    height: 12px;
    color: var(--text-white);
}

.premium-tag span {
    font-size: 0.75rem;
    color: var(--text-white);
}

/* ==================== STATUS INDICATOR ==================== */
.status-indicator {
    position: fixed;
    bottom: var(--spacing-3);
    right: var(--spacing-4);
    z-index: 50;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-1);
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--spacing-1) var(--spacing-2);
    border-radius: var(--radius-full);
    transition: all 0.3s;
    background-color: rgb(220, 252, 231);
    color: rgb(21, 128, 61);
}

.status-badge.connected {
    background-color: rgb(220, 252, 231);
    color: rgb(21, 128, 61);
}

.status-badge.disconnected {
    background-color: rgb(254, 226, 226);
    color: rgb(185, 28, 28);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
}

.status-dot.connected {
    background-color: rgb(34, 197, 94);
}

.status-dot.disconnected {
    background-color: rgb(239, 68, 68);
}

/* ==================== OVERLAY DE SONIDO ==================== */
.sound-overlay {
    height: 100vh;
    width: 100vw;
    background-color: rgb(219, 234, 254);
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.sound-overlay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-6);
}

.sound-button {
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 500;
    padding: var(--spacing-4) var(--spacing-2);
    width: 144px;
    height: 144px;
    border-radius: var(--radius-full);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-2);
    border: 4px solid rgb(239, 68, 68);
    box-shadow: var(--shadow-lg);
    background-color: transparent;
    cursor: pointer;
    transition: all 0.2s;
}

.sound-button:hover {
    background-color: rgb(234, 179, 8);
    transform: scale(1.05);
}

.sound-button svg {
    width: 96px;
    height: 96px;
    color: var(--primary-color);
}

.sound-overlay-text {
    font-size: 1.875rem;
    font-weight: 500;
}

/* ==================== UTILITIES ==================== */
.hidden {
    display: none;
}

.overflow-hidden {
    overflow: hidden;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-gray);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}





/* ==================== ESTILOS ADICIONALES PARA CONSISTENCIA ==================== */

/* Para el caso de turno especial (S o N) */
.calling-active.bg-primary {
    background-color: var(--primary-color);
}

.calling-active .calling-label {
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    margin-bottom: var(--spacing-4);
    font-weight: 600;
    position: relative;
    z-index: 1;
}

@media (min-width: 1024px) {
    .calling-active .calling-label {
        font-size: 2.25rem;
    }
}

.calling-active .calling-number {
    font-size: 8rem;
    line-height: 1;
    font-weight: 900;
    font-family: monospace;
    letter-spacing: -0.025em;
    text-shadow: 0 10px 15px rgba(0, 0, 0, 0.25);
    position: relative;
    z-index: 1;
}

.calling-active .calling-module {
    margin-top: var(--spacing-6);
    padding: var(--spacing-3) var(--spacing-10);
    border-radius: var(--radius-full);
    position: relative;
    z-index: 1;
}

.calling-active .calling-module span {
    font-size: 1.5rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 1024px) {
    .calling-active .calling-module span {
        font-size: 2.25rem;
    }
}

/* Premium badge más pequeño para lista de espera */
.premium-tag svg {
    width: 12px;
    height: 12px;
}

.premium-tag span {
    font-size: 0.75rem;
}

/* Turno especial en lista de espera */
.turn-item.special {
    border-color: var(--premium-gold);
    background: var(--premium-bg);
}

/* Estado vacío para listas */
.empty-state {
    text-align: center;
    padding: var(--spacing-8);
    color: var(--text-gray);
    font-size: 1.125rem;
}

/* Animación bounce mejorada */
@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    }
}

.calling-bounce {
    animation: bounce 0.5s ease-in-out 3;
}

/* Transiciones suaves */
.turn-item,
.incall-item-inner,
.calling-active {
    transition: all 0.3s ease-in-out;
}

/* Hover effects */
.turn-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.incall-item-inner:hover {
    transform: scale(1.02);
    background-color: #fafafa;
}








/* Contenedor del carrusel */
.incall-content {
    overflow: hidden;
    position: relative;
}

.incall-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.5s ease-in-out;
}

/* Mantén tus estilos existentes del .incall-item */
.incall-item {
    flex-shrink: 0;
    height: 88px;
}

/* Opcional: animación de rebote */
.incall-item-rebote {
    animation: reboteInfinito 0.8s ease-in-out infinite;
}

@keyframes reboteInfinito {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        background-color: #b3143c;
    }