/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    overflow: hidden;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1F2937 0%, #374151 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
    animation: fadeIn 1s ease-in-out;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #6B46C1;
    border-top: 4px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* App Container */
.app-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1F2937;
}

/* Header */
.app-header {
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-bottom: 2px solid #6B46C1;
    z-index: 100;
}

.header-content {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.app-header h1 {
    font-size: 1.5rem;
    color: #F3F4F6;
    font-weight: 600;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.role-badge {
    background: #6B46C1;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 280px;
    background: linear-gradient(150deg, #1F2937, #374151);
    z-index: 1100;
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    padding: 2rem;
    border-right: 2px solid #6B46C1;
}

.side-menu.open {
    transform: translateX(0);
}

.close-menu-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 2.5rem;
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.close-menu-btn:hover {
    color: #FBBF24;
}

.menu-content {
    margin-top: 4rem;
}

/* Camera Container */
.camera-container {
    position: relative;
    flex: 1;
    overflow: hidden;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1); /* Mirror effect */
}

.detection-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    transform: scaleX(-1); /* Mirror effect */
}

/* AR Overlay */
.ar-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.ar-info {
    position: absolute;
    background: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid #6B46C1;
    color: white;
    font-size: 0.9rem;
    max-width: 300px;
    animation: slideIn 0.5s ease-out;
}

.face-info {
    top: 20px;
    left: 20px;
}

.hand-info {
    top: 20px;
    right: 20px;
}

.strengths-weaknesses-info {
    bottom: 20px; /* Posicionarlo en la parte inferior derecha */
    right: 20px;
    max-width: 350px; /* Darle más ancho para las listas */
    border-color: #FBBF24; /* Un color diferente para distinguirlo */
    background: rgba(31, 41, 55, 0.7); /* Fondo más transparente */
    backdrop-filter: blur(8px); /* Desenfoque ligeramente más sutil */
}

/*
   NUEVA ANIMACIÓN DE APARICIÓN MÁGICA
   - Comienza invisible y ligeramente pequeño (scale(0.9)).
   - Termina completamente visible y a su tamaño normal (scale(1)).
*/
@keyframes magical-appear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.magical-appear {
    animation: magical-appear 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.strengths-weaknesses-info h3 {
    color: #FBBF24;
}

.strengths-weaknesses-info.slide-out-right {
    animation: slideOutRight 0.5s forwards ease-in-out;
}

@keyframes slideOutRight {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(200%); opacity: 0; }
}

.strengths-weaknesses-info .tag-list {
    margin-top: 0.5rem;
}

.strengths-weaknesses-info .tag {
    background: #FBBF24; /* Amarillo para fortalezas/debilidades */
    color: #1F2937;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ar-info h3 {
    margin-bottom: 0.5rem;
    color: #F3F4F6;
    font-size: 1rem;
}

.ar-info p {
    margin: 0.25rem 0;
    color: #D1D5DB;
}

.ar-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

/* Game Interface */
.game-interface {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(31, 41, 55, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem;
    border-top: 2px solid #6B46C1;
    z-index: 50;
}

.interface-panel {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-primary {
    background: linear-gradient(135deg, #6B46C1, #8B5CF6);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #553C9A, #7C3AED);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 70, 193, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, #374151, #4B5563);
    color: white;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #2D3748, #3F4856);
    transform: translateY(-2px);
}

.btn-profile {
    background: linear-gradient(135deg, #059669, #10B981);
    color: white;
    width: 100%; /* Para que ocupe todo el ancho del menú */
}

.btn-profile:hover {
    background: linear-gradient(135deg, #047857, #059669);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    width: 100%;
    margin-top: 1rem; /* Añadir espacio sobre el botón */
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c53030, #9b2c2c);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

/* Ocultar temporalmente el botón de AR */
#toggle-ar {
    display: none;
}


/* Game Stats */
.game-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.stat-item {
    flex: 1;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: #D1D5DB;
    margin-bottom: 0.25rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6B46C1, #8B5CF6);
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: linear-gradient(135deg, #1F2937, #374151);
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border: 2px solid #6B46C1;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-50px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    background: linear-gradient(135deg, #6B46C1, #8B5CF6);
    padding: 1.5rem;
    border-radius: 14px 14px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
}

.close {
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #FBBF24;
}

/* Registration Form */
.registration-form {
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 12px;
    border: 1px solid #4B5563;
}

.form-section h3 {
    color: #F3F4F6;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #6B46C1;
    padding-bottom: 0.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    color: #D1D5DB;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #4B5563;
    border-radius: 8px;
    background: rgba(31, 41, 55, 0.8);
    color: white;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #6B46C1;
    box-shadow: 0 0 0 3px rgba(107, 70, 193, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.profile-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 2rem;
}

/* Profile Content */
.profile-content {
    padding: 2rem;
}

.profile-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: rgba(55, 65, 81, 0.5);
    border-radius: 12px;
    border: 1px solid #4B5563;
}

.profile-section h3 {
    color: #F3F4F6;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    border-bottom: 2px solid #6B46C1;
    padding-bottom: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, #6B46C1, #8B5CF6);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .interface-panel {
        justify-content: center;
    }
    
    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .ar-info {
        position: relative;
        margin: 1rem;
        max-width: none;
    }
}

@media (max-width: 480px) {
    .app-header h1 {
        font-size: 1.2rem;
    }
    
    .registration-form {
        padding: 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
}

/* Animaciones especiales para AR */
.ar-pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}

.ar-glow {
    box-shadow: 0 0 20px rgba(107, 70, 193, 0.6);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 0 20px rgba(107, 70, 193, 0.6); }
    to { box-shadow: 0 0 30px rgba(107, 70, 193, 0.8); }
}

/* Welcome Video Modal Styles */
.video-modal {
    background-color: rgba(0, 0, 0, 0.95); /* Fondo más oscuro */
    backdrop-filter: none; /* Sin desenfoque para que el video sea el foco */
}

.video-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    max-width: none;
    max-height: none;
    background: none;
    border: none;
}

.welcome-video {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.skip-video-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 1001;
}
