* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #FFD700;
    --primary-color-hover: #FFA500;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    color: #000000;
    overflow: hidden;
    height: 100vh;
}

.container {
    position: relative;
    width: 100vw;
    height: 100vh;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed; /* Asegurar que el fondo cubra toda la pantalla */
}

/* Logo */
.logo-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: block; /* Siempre visible cuando esté en pantalla de cámara */
}

.logo {
    max-width: 400px; /* Logo más grande */
    max-height: 250px; /* Altura proporcional */
    width: auto;
    height: auto;
    transition: transform 0.3s ease;
    display: none; /* Oculto por defecto, se mostrará con JavaScript */
}

.logo:hover {
    transform: scale(1.1);
}

/* Logo flotante siempre visible */
.floating-logo {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    width: 400px;
    height: auto;
}

/* Indicador de escaneo optimizado */
.scan-indicator {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--primary-color);
    padding: 10px 15px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 10000;
    font-family: monospace;
    border: 2px solid var(--primary-color);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Mejoras para la cámara */
.camera-screen video {
    border: 3px solid var(--primary-color);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Indicador de estado de escaneo */
.scan-status {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: var(--primary-color);
    padding: 12px 24px;
    border-radius: 30px;
    font-size: 16px;
    z-index: 1000;
    border: 2px solid var(--primary-color);
    display: none;
}

.floating-logo-img {
    /*pointer-events: none;*/
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

/* Pantalla principal */
.main-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    text-align: center;
    background: #ffffff;
    color: #000000;
    position: relative;
    z-index: 1;
}

.upload-section h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
    color: #000000;
    /*animation: glow 2s ease-in-out infinite alternate;*/
}

.upload-section p {
    font-size: 1.5rem;
    margin-bottom: 40px;
    color: #333333;
}

.upload-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-hover));
    color: #000;
    border: none;
    padding: 20px 40px;
    font-size: 1.3rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.upload-btn:hover {
    transform: translateY(-3px);
}

.upload-btn:active {
    transform: translateY(-1px);
}

/* Pantalla de cámara */
.camera-screen {
    position: relative;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3); /* Más transparente para ver el fondo */
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Cuando se muestra la pantalla de cámara, aplicar el fondo personalizado */
.camera-screen.active {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.7) 0%, rgba(26, 26, 26, 0.7) 50%, rgba(0, 0, 0, 0.7) 100%);
}

/* Asegurar que el logo se muestre en la pantalla de cámara */
.camera-screen.active .logo-container {
    display: block;
}

.camera-screen.active .logo {
    display: block;
}

#video {
    width: 50vw; /* Mitad del ancho de la pantalla */
    height: 50vh; /* Mitad de la altura de la pantalla */
    object-fit: cover;
    border-radius: 15px;
    border: 3px solid var(--primary-color);
    transition: all 0.3s ease;
    position: relative; /* Para posicionar el selector de cámara */
}

#video:hover {
    border-color: var(--primary-color-hover);
    transform: scale(1.02);
}

/* Botón del selector de cámara */
.camera-selector-btn {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.camera-selector-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

/* Selector de cámara delante del video */
.camera-selector {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid var(--primary-color);
    padding: 15px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    border-radius: 15px;
    pointer-events: none;
    width: 300px;
    max-width: 90%;
}

.camera-selector.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.camera-selector h3 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.camera-selector select {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: #000;
    color: var(--primary-color);
    font-size: 1rem;
    cursor: pointer;
}

.camera-selector select:focus {
    outline: none;
    border-color: var(--primary-color-hover);
}

/* Botón para volver a la pantalla principal */
.back-to-main-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-main-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

/* Botones superiores unificados */
.config-btn,
.fullscreen-btn,
.guests-list-btn {
    position: absolute;
    top: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.config-btn {
    right: 20px;
}

.fullscreen-btn {
    right: 80px;
}

.guests-list-btn {
    right: 140px;
}

.config-btn:hover,
.fullscreen-btn:hover,
.guests-list-btn:hover {
    background: var(--primary-color);
    color: #000;
    transform: scale(1.1);
}

/* Vista de lista de invitados */
.guests-list-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.guests-list-content {
    background: #1a1a1a;
    border: 2px solid var(--primary-color);
    border-radius: 15px;
    padding: 30px;
    max-width: 90vw;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.guests-list-content h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 20px;
    font-size: 2rem;
}

.search-section {
    margin-bottom: 20px;
    text-align: center;
}

.search-section input {
    width: 100%;
    max-width: 400px;
    padding: 12px 20px;
    border: 2px solid var(--primary-color);
    border-radius: 25px;
    background: #2a2a2a;
    color: white;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-section input:focus {
    border-color: var(--primary-color-hover);
}

.search-results {
    margin-top: 10px;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    min-height: 20px;
}

.total-count {
    margin-top: 10px;
    text-align: center;
    color: var(--primary-color);
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0.8;
}

.guests-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: #2a2a2a;
    border-radius: 10px;
    overflow: hidden;
}

.guests-table th {
    background: var(--primary-color);
    color: #000;
    padding: 15px;
    text-align: left;
    font-weight: bold;
    font-size: 1.1rem;
}

.guests-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #444;
    color: white;
}

.guests-table tr:hover {
    background: #3a3a3a;
}

.close-guests-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--primary-color);
    color: #000;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2001;
    display: flex;
    align-items: center;
    justify-content: center;
    float: right;
}

.close-guests-btn:hover {
    background: var(--primary-color-hover);
    transform: scale(1.1);
}

/* Mensaje de bienvenida */
.welcome-message {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(135deg, #000000 0%, #1a1a1a 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.5s ease-in-out;
}

.welcome-content {
    text-align: center;
    animation: slideInUp 0.8s ease-out;
}

.welcome-content h1 {
    font-size: 2.5rem; /* Nombres más pequeños */
    margin-bottom: 20px;
    color: var(--primary-color);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    animation: bounce 2s infinite;
}

.welcome-content p {
    font-size: 5rem; /* Número de mesa mucho más grande */
    margin-bottom: 40px;
    color: var(--primary-color);
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.8);
    font-weight: bold;
}

.celebration-emojis {
    position: relative;
    height: 100px;
    overflow: hidden;
}

.emoji-particle {
    position: absolute;
    font-size: 2rem;
    animation: floatUp 3s ease-out forwards;
    opacity: 0;
}

@keyframes floatUp {
    0% {
        transform: translateY(50px) rotate(0deg);
        opacity: 0;
    }
    20% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) rotate(360deg);
        opacity: 0;
    }
}

/* Modal de error CSV */
.csv-error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 4000;
    animation: fadeIn 0.3s ease-in-out;
}

.csv-error-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid #ff4444;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    text-align: center;
}

.csv-error-content h2 {
    color: #ff4444;
    margin-bottom: 25px;
    font-size: 2rem;
}

.error-message {
    color: #ffffff;
    margin-bottom: 30px;
    font-size: 1.1rem;
    line-height: 1.6;
    text-align: left;
    background: rgba(255, 68, 68, 0.1);
    padding: 20px;
    border-radius: 10px;
    border-left: 4px solid #ff4444;
}

.error-message br {
    margin-bottom: 10px;
}

/* Modal de configuración */
.config-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 3000;
    animation: fadeIn 0.3s ease-in-out;
}

.config-content {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    padding: 40px;
    border-radius: 20px;
    border: 2px solid var(--primary-color);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.config-content h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--primary-color);
    font-size: 2rem;
}

.config-section {
    margin-bottom: 25px;
}

.config-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.config-section label {
    display: block;
    margin-bottom: 8px;
    color: var(--primary-color);
    font-weight: bold;
}

.config-section input,
.config-section select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--primary-color);
    border-radius: 8px;
    background: #000;
    color: var(--primary-color);
    font-size: 1rem;
}

.config-section input:focus,
.config-section select:focus {
    outline: none;
    border-color: var(--primary-color-hover);
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.remove-btn {
    background: linear-gradient(45deg, #ff4444, #cc0000);
    color: white;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
}

.remove-btn:hover {
    transform: translateY(-2px);
}

.close-btn {
    background: linear-gradient(45deg, var(--primary-color), var(--primary-color-hover));
    color: #000;
    border: none;
    padding: 15px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.close-btn:hover {
    transform: translateY(-2px);
}

/* Animaciones */
@keyframes glow {
    from {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.5);
    }
    to {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8), 0 0 30px rgba(255, 215, 0, 0.8);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideInDown {
    from {
        transform: translateX(-50%) translateY(-100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .upload-section h1 {
        font-size: 2.5rem;
    }
    
    .upload-section p {
        font-size: 1.2rem;
    }
    
    .welcome-content h1 {
        font-size: 2rem; /* Nombres más pequeños en móvil */
    }
    
    .welcome-content p {
        font-size: 3.5rem; /* Número de mesa más grande en móvil */
    }
    
    .celebration-emojis {
        font-size: 2rem;
    }
    
    .config-content,
    .guests-list-content {
        padding: 20px;
        margin: 20px;
    }
    
    #video {
        width: 80vw; /* En móviles ocupa más espacio */
        height: 60vh;
    }
    
    .camera-selector {
        padding: 15px;
        width: 90%;
        max-width: 300px;
        bottom: 10px;
    }
    
    .camera-selector-btn {
        bottom: 10px;
        left: 10px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    .camera-selector select {
        max-width: 100%;
    }
    
    .guests-table {
        font-size: 0.9rem;
    }
    
    .guests-table th,
    .guests-table td {
        padding: 8px;
    }
    
    .fullscreen-btn {
        right: 110px;
    }
    
    .back-to-main-btn {
        top: 10px;
        left: 10px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
    
    /* Logo responsive en móviles */
    .logo {
        max-width: 300px; /* Logo más pequeño en móviles */
        max-height: 180px;
    }
    
    .logo-container {
        top: 15px; /* Ajustar posición en móviles */
    }
}

/* Modal de error CSV */
