/**
 * Estilos para el panel de check-in
 * Optimizado para móvil y tablet
 */

/* Variables */
:root {
    --tvc-checkin-primary: #722F37;
    --tvc-checkin-success: #28a745;
    --tvc-checkin-warning: #ffc107;
    --tvc-checkin-danger: #dc3545;
    --tvc-checkin-info: #17a2b8;
    --tvc-checkin-light: #f8f9fa;
    --tvc-checkin-dark: #343a40;
    --tvc-checkin-white: #ffffff;
    --tvc-checkin-border: #dee2e6;
    --tvc-checkin-shadow: 0 2px 10px rgba(0,0,0,0.1);
    --tvc-checkin-radius: 8px;
}

/* Container principal */
.tvc-checkin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--tvc-checkin-light);
    min-height: 100vh;
}

/* Header con estadísticas */
.tvc-checkin-header {
    background: var(--tvc-checkin-white);
    padding: 25px;
    border-radius: var(--tvc-checkin-radius);
    box-shadow: var(--tvc-checkin-shadow);
    margin-bottom: 20px;
}

.tvc-checkin-header h2 {
    margin: 0 0 20px 0;
    color: var(--tvc-checkin-primary);
    font-size: 1.8rem;
    text-align: center;
}

.tvc-checkin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.tvc-stat-card {
    background: linear-gradient(135deg, var(--tvc-checkin-primary), #8B4A52);
    color: white;
    padding: 20px;
    border-radius: var(--tvc-checkin-radius);
    text-align: center;
    box-shadow: 0 4px 15px rgba(114, 47, 55, 0.3);
}

.tvc-stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.tvc-stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.tvc-last-update {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.tvc-last-update small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.8rem;
}

/* Selector de taller */
.tvc-checkin-selector {
    background: var(--tvc-checkin-white);
    padding: 20px;
    border-radius: var(--tvc-checkin-radius);
    box-shadow: var(--tvc-checkin-shadow);
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.tvc-checkin-selector label {
    font-weight: 600;
    color: var(--tvc-checkin-dark);
    margin-right: 10px;
}

.tvc-workshop-select {
    flex: 1;
    min-width: 250px;
    padding: 12px 15px;
    border: 2px solid var(--tvc-checkin-border);
    border-radius: var(--tvc-checkin-radius);
    font-size: 1rem;
    background: var(--tvc-checkin-white);
    color: var(--tvc-checkin-dark);
}

.tvc-workshop-select option {
    color: var(--tvc-checkin-dark);
    background: var(--tvc-checkin-white);
    padding: 8px;
}

.tvc-workshop-select option:hover {
    background: var(--tvc-checkin-light);
}

.tvc-workshop-select option:selected {
    background: var(--tvc-checkin-primary);
    color: white;
}

.tvc-workshop-select:focus {
    outline: none;
    border-color: var(--tvc-checkin-primary);
    color: var(--tvc-checkin-dark) !important;
}

/* Estilos específicos para diferentes navegadores */
.tvc-workshop-select {
    -webkit-appearance: menulist;
    -moz-appearance: menulist;
    appearance: menulist;
}

/* Forzar visibilidad del texto en todas las situaciones */
.tvc-workshop-select,
.tvc-workshop-select option,
select#tvc-workshop-select,
select#tvc-workshop-select option {
    color: #343a40 !important;
    background-color: #ffffff !important;
}

/* Estilos específicos para el estado hover y focus */
.tvc-workshop-select:hover {
    color: #343a40 !important;
    background-color: #f8f9fa !important;
}

.tvc-workshop-select option:checked {
    background-color: #722F37 !important;
    color: #ffffff !important;
}

/* Botones */
.tvc-btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--tvc-checkin-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tvc-btn-primary {
    background: var(--tvc-checkin-primary);
    color: white;
}

.tvc-btn-primary:hover {
    background: #5a252b;
    transform: translateY(-1px);
}

.tvc-btn-secondary {
    background: var(--tvc-checkin-border);
    color: var(--tvc-checkin-dark);
}

.tvc-btn-secondary:hover {
    background: #c6c8ca;
}

.tvc-btn-success {
    background: var(--tvc-checkin-success);
    color: white;
}

.tvc-btn-success:hover {
    background: #218838;
}

.tvc-btn-warning {
    background: var(--tvc-checkin-warning);
    color: var(--tvc-checkin-dark);
}

.tvc-btn-warning:hover {
    background: #e0a800;
}

.tvc-btn-danger {
    background: var(--tvc-checkin-danger);
    color: white;
}

.tvc-btn-danger:hover {
    background: #c82333;
}

.tvc-btn-clear {
    background: transparent;
    color: var(--tvc-checkin-danger);
    padding: 8px;
    min-width: 40px;
}

/* Panel del taller */
.tvc-workshop-panel {
    background: var(--tvc-checkin-white);
    border-radius: var(--tvc-checkin-radius);
    box-shadow: var(--tvc-checkin-shadow);
    overflow: hidden;
}

.tvc-workshop-info {
    padding: 25px;
    border-bottom: 1px solid var(--tvc-checkin-border);
}

.tvc-workshop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.tvc-workshop-header h3 {
    margin: 0;
    color: var(--tvc-checkin-primary);
    font-size: 1.5rem;
}

.tvc-workshop-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.tvc-detail-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.tvc-detail-item strong {
    color: var(--tvc-checkin-dark);
    font-size: 0.9rem;
}

.tvc-detail-item span {
    font-size: 1.1rem;
    color: var(--tvc-checkin-primary);
    font-weight: 600;
}

/* Status badges */
.tvc-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.tvc-status-badge.active {
    background: var(--tvc-checkin-success);
    color: white;
}

.tvc-status-badge.closed {
    background: var(--tvc-checkin-danger);
    color: white;
}

/* Buscador */
.tvc-search-container {
    padding: 20px;
    border-bottom: 1px solid var(--tvc-checkin-border);
    display: flex;
    gap: 10px;
}

.tvc-search-input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid var(--tvc-checkin-border);
    border-radius: var(--tvc-checkin-radius);
    font-size: 1rem;
}

.tvc-search-input:focus {
    outline: none;
    border-color: var(--tvc-checkin-primary);
}

/* Tabs */
.tvc-tabs {
    display: flex;
    border-bottom: 1px solid var(--tvc-checkin-border);
}

.tvc-tab-btn {
    flex: 1;
    padding: 15px 10px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: relative;
}

.tvc-tab-btn.active {
    background: var(--tvc-checkin-primary);
    color: white;
}

.tvc-tab-btn:not(.active):hover {
    background: var(--tvc-checkin-light);
}

.tvc-tab-icon {
    font-size: 1.2rem;
}

.tvc-tab-text {
    font-size: 0.9rem;
    font-weight: 600;
}

.tvc-tab-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

.tvc-tab-btn.active .tvc-tab-count {
    background: rgba(255, 255, 255, 0.3);
}

/* Lista de participantes */
.tvc-participants-container {
    padding: 20px;
    max-height: 600px;
    overflow-y: auto;
}

.tvc-participants-list {
    display: grid;
    gap: 15px;
}

.tvc-participant-card {
    background: var(--tvc-checkin-light);
    border-radius: var(--tvc-checkin-radius);
    padding: 20px;
    border-left: 4px solid var(--tvc-checkin-primary);
    transition: all 0.3s ease;
}

.tvc-participant-card:hover {
    box-shadow: var(--tvc-checkin-shadow);
    transform: translateY(-2px);
}

.tvc-participant-card.present {
    border-left-color: var(--tvc-checkin-success);
    background: #f8fff9;
}

.tvc-participant-card.absent {
    border-left-color: var(--tvc-checkin-danger);
    background: #fff8f8;
}

.tvc-participant-card.waiting {
    border-left-color: var(--tvc-checkin-warning);
    background: #fffef8;
}

.tvc-participant-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 10px;
}

.tvc-participant-info h4 {
    margin: 0 0 5px 0;
    color: var(--tvc-checkin-dark);
    font-size: 1.2rem;
}

.tvc-participant-code {
    font-size: 0.8rem;
    color: var(--tvc-checkin-primary);
    font-weight: 600;
    background: rgba(114, 47, 55, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
}

.tvc-participant-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
    margin-bottom: 15px;
}

.tvc-participant-detail {
    font-size: 0.9rem;
    color: var(--tvc-checkin-dark);
}

.tvc-participant-detail strong {
    display: block;
    color: var(--tvc-checkin-primary);
    margin-bottom: 2px;
}

.tvc-participant-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tvc-participant-actions .tvc-btn {
    font-size: 0.9rem;
    padding: 8px 15px;
}

/* Acciones rápidas */
.tvc-quick-actions {
    padding: 20px;
    border-top: 1px solid var(--tvc-checkin-border);
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

/* Loading */
.tvc-checkin-loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.tvc-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: tvc-spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes tvc-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tvc-checkin-loading p {
    color: white;
    font-size: 1.2rem;
    margin: 0;
}

/* Error states */
.tvc-checkin-error {
    background: var(--tvc-checkin-danger);
    color: white;
    padding: 20px;
    border-radius: var(--tvc-checkin-radius);
    text-align: center;
}

.tvc-no-participants {
    text-align: center;
    padding: 40px;
    color: var(--tvc-checkin-dark);
}

.tvc-no-participants h4 {
    margin: 0 0 10px 0;
    font-size: 1.3rem;
}

/* Asegurar fondos blancos en contenedores principales */
.tvc-checkin-header,
.tvc-checkin-selector,
.tvc-workshop-panel {
    background-color: #ffffff;
}

/* Responsive */
@media (max-width: 768px) {
    .tvc-checkin-container {
        padding: 15px;
    }
    
    .tvc-checkin-header h2 {
        font-size: 1.5rem;
    }
    
    .tvc-stat-number {
        font-size: 2rem;
    }
    
    .tvc-checkin-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tvc-workshop-select {
        min-width: auto;
    }
    
    .tvc-workshop-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .tvc-workshop-details {
        grid-template-columns: 1fr;
    }
    
    .tvc-tabs {
        flex-wrap: wrap;
    }
    
    .tvc-tab-btn {
        min-width: 120px;
    }
    
    .tvc-participant-header {
        flex-direction: column;
    }
    
    .tvc-participant-details {
        grid-template-columns: 1fr;
    }
    
    .tvc-participant-actions {
        justify-content: center;
    }
    
    .tvc-quick-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .tvc-checkin-stats {
        grid-template-columns: 1fr;
    }
    
    .tvc-tabs {
        flex-direction: column;
    }
    
    .tvc-tab-btn {
        flex-direction: row;
        justify-content: space-between;
        padding: 12px 15px;
    }
}
