/* Zenless Zone Zero Inspired Styles */
:root {
    --primary-color: #00d4ff;
    --secondary-color: #ff6b35;
    --accent-color: #ffd700;
    --dark-bg: #0a0a0f;
    --darker-bg: #050508;
    --card-bg: rgba(15, 15, 25, 0.9);
    --text-primary: #ffffff;
    --text-secondary: #b8b8b8;
    --text-muted: #666666;
    --border-color: rgba(255, 255, 255, 0.1);
    --success-color: #00ff88;
    --error-color: #ff4757;
    --warning-color: #ffa502;
    
    --gradient-primary: linear-gradient(135deg, #00d4ff 0%, #0099cc 100%);
    --gradient-secondary: linear-gradient(135deg, #ff6b35 0%, #cc5529 100%);
    --gradient-dark: linear-gradient(135deg, #0a0a0f 0%, #050508 100%);
    --gradient-card: linear-gradient(135deg, rgba(15, 15, 25, 0.95) 0%, rgba(10, 10, 15, 0.9) 100%);
    
    --shadow-primary: 0 8px 32px rgba(0, 212, 255, 0.3);
    --shadow-secondary: 0 8px 32px rgba(255, 107, 53, 0.3);
    --shadow-card: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-input: 0 4px 16px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* Background */
.background-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
}

/* Background Image - Reemplaza las reglas de background-video */
.background-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
    position: absolute;
    top: 0;
    left: 0;
}

/* Opcional: Si quieres mantener la regla del video pero comentada */
/*
.background-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}
*/

.background-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--gradient-dark);
    z-index: -1;
}

/* Main Container */
.main-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

/* Header */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 40px;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px; /* Espacio entre elementos */
}

/* Ajustar el selector de idioma para el nuevo contexto */
.logo-container .language-selector {
    margin-left: 20px; /* Espacio adicional después del título */
}

.logo-container .language-current {
    min-width: 70px;
    padding: 8px 12px;
    font-size: 13px;
}

.logo-container .flag-icon {
    font-size: 16px;
}

.logo-container .lang-code {
    font-size: 11px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-container {
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }
    
    .logo-container .language-selector {
        margin-left: 0;
        order: 3; /* Colocar después del logo y título */
    }
}

.game-logo {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    box-shadow: var(--shadow-primary);
}

.game-title {
    font-size: 24px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    padding: 12px 24px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: left 0.3s ease;
    z-index: -1;
}

.nav-link:hover::before,
.nav-link.active::before {
    left: 0;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    transform: translateY(-2px);
}

/* Content Area */
.content-area {
    flex: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px 40px 40px 40px;
    gap: 60px;
    padding-top: 20px;
}

/* Form Container */
.form-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    min-height: 500px;
    z-index: 10; /* Asegurar que esté por encima del side-panel */
}

.auth-form {
    background: var(--gradient-card);
    border-radius: 20px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-50px);
    transition: all 0.5s ease;
    position: absolute;
    width: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10; /* Asegurar que esté por encima */
}

.auth-form.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    position: absolute;
    pointer-events: auto;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.form-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
}

/* Form Inputs */
.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 16px 16px 16px 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
    background: rgba(255, 255, 255, 0.08);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.password-toggle {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.3s ease;
    z-index: 2;
}

.password-toggle:hover {
    color: var(--primary-color);
}

.input-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* Checkbox - Mejorado para móviles */
.checkbox-group {
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 8px; /* Área táctil más grande */
    margin: -8px; /* Compensar el padding */
    border-radius: 8px;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 20; /* Asegurar que esté por encima de otros elementos */
}

.checkbox-label:hover {
    background-color: rgba(0, 212, 255, 0.05);
}

.checkbox-label:active {
    background-color: rgba(0, 212, 255, 0.1);
}

.checkbox-input {
    display: none;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0; /* Evitar que se comprima */
}

.checkbox-input:checked + .checkbox-custom {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
}

.checkbox-input:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Submit Button - Mejorado para móviles */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: var(--shadow-primary);
    position: relative;
    overflow: hidden;
    z-index: 20; /* Asegurar que esté por encima */
    min-height: 48px; /* Altura mínima para touch */
    touch-action: manipulation; /* Optimizar para touch */
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 212, 255, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.register-btn {
    background: var(--gradient-secondary);
    box-shadow: var(--shadow-secondary);
}

.register-btn:hover {
    box-shadow: 0 12px 40px rgba(255, 107, 53, 0.4);
}

/* Side Panel */
.side-panel {
    width: 100%;
    max-width: 350px;
    display: flex;
    flex-direction: column;
}

.panel-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.feature-card {
    background: var(--gradient-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--border-color);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: var(--primary-color);
}

.feature-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: white;
    box-shadow: var(--shadow-primary);
}

.feature-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.feature-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
}

/* Notifications */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notification {
    background: var(--gradient-card);
    border-radius: 12px;
    padding: 16px 20px;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(20px);
    min-width: 300px;
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--error-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

@keyframes slideIn {
    to {
        transform: translateX(0);
    }
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.notification-message {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    text-align: center;
}

.spinner-ring {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 212, 255, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .content-area {
        flex-direction: column;
        gap: 40px;
    }
    
    .side-panel {
        max-width: 100%;
    }
    
    .panel-content {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .feature-card {
        min-width: 250px;
    }
}

@media (max-width: 768px) {
    .game-header {
        padding: 15px 20px;
        flex-direction: column;
        gap: 20px;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .auth-form {
        padding: 30px 20px;
    }
    
    .panel-content {
        flex-direction: column;
    }
    
    .feature-card {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 24px;
    }
    
    .auth-form {
        padding: 24px 16px;
    }
    
    .notification {
        min-width: 280px;
        margin: 0 10px;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-form.active {
    animation: fadeInUp 0.5s ease;
}

.feature-card {
    animation: fadeInUp 0.5s ease;
    animation-delay: calc(var(--delay, 0) * 0.1s);
}

/* Discord Card Styles */
.discord-card {
    cursor: pointer;
    transition: all 0.3s ease;
}

.discord-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 20px 60px rgba(114, 137, 218, 0.3);
    border-color: #7289da;
}

.discord-card .feature-icon {
    background: linear-gradient(135deg, #7289da 0%, #5865f2 100%);
    box-shadow: 0 8px 32px rgba(114, 137, 218, 0.4);
}

.discord-card:hover .feature-icon {
    transform: scale(1.1);
    box-shadow: 0 12px 40px rgba(114, 137, 218, 0.5);
}

.discord-card:active {
    transform: translateY(-2px) scale(1.01);
}

/* Language Selector - Zenless Zone Zero Style */
.language-selector {
    position: relative;
    z-index: 99999; /* Aumentado significativamente */
}

.language-dropdown {
    position: relative;
}

.language-current {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 80px;
    box-shadow: var(--shadow-input);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    z-index: 99999;
}

.language-current::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.5s ease;
}

.language-current:hover::before,
.language-current.active::before {
    left: 100%;
}

.language-current:hover,
.language-current.active {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1), var(--shadow-primary);
    transform: translateY(-2px);
}

.flag-icon {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0; /* Evita que la bandera se comprima */
}

.lang-code {
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    flex-shrink: 0; /* Evita que el código se comprima */
}

.dropdown-icon {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.3s ease, color 0.3s ease;
    margin-left: auto;
    flex-shrink: 0; /* Evita que el icono se comprima */
}

.language-current.active .dropdown-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.language-options {
    position: fixed; /* Cambiado de absolute a fixed */
    top: auto; /* Se calculará con JavaScript */
    left: auto; /* Se calculará con JavaScript */
    min-width: 180px;
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    backdrop-filter: blur(20px);
    box-shadow: var(--shadow-card);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px) scale(0.95);
    transition: all 0.3s ease;
    z-index: 999999; /* Valor extremadamente alto */
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.language-options.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.language-option {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
    white-space: nowrap; /* Evita que el texto se rompa */
    min-height: 48px; /* Altura mínima para cada opción */
}

.language-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 212, 255, 0.1), transparent);
    transition: left 0.3s ease;
}

.language-option:hover::before {
    left: 100%;
}

.language-option:hover {
    background: rgba(0, 212, 255, 0.1);
    color: var(--primary-color);
}

.language-option.active {
    background: rgba(0, 212, 255, 0.15);
    color: var(--primary-color);
}

.language-option.active::after {
    content: '✓';
    position: absolute;
    right: 16px;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 12px;
}

.lang-name {
    flex: 1;
    text-align: left;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis; /* Puntos suspensivos si el texto es muy largo */
}

.language-option .lang-code {
    font-size: 10px;
    opacity: 0.7;
    background: none;
    -webkit-text-fill-color: currentColor;
    color: var(--text-muted);
    flex-shrink: 0;
}

.language-option:hover .lang-code,
.language-option.active .lang-code {
    color: var(--primary-color);
    opacity: 1;
}

/* Animaciones adicionales */
@keyframes flagWave {
    0%, 100% { transform: rotate(0deg) scale(1); }
    25% { transform: rotate(-2deg) scale(1.05); }
    75% { transform: rotate(2deg) scale(1.05); }
}

.language-current:hover .flag-icon {
    animation: flagWave 0.6s ease-in-out;
}

/* Efectos de partículas en hover */
.language-current:hover {
    position: relative;
}

.language-current:hover::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 212, 255, 0.1) 0%, transparent 70%);
    transform: translate(-50%, -50%);
    border-radius: 12px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .game-header {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    
    .language-selector {
        order: 2;
    }
    
    .header-nav {
        order: 3;
    }
    
    .language-current {
        min-width: 70px;
        padding: 10px 12px;
    }
    
    .language-options {
        min-width: 160px;
    }
    
    .flag-icon {
        font-size: 16px;
    }
    
    .lang-code {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .language-current {
        min-width: 60px;
        padding: 8px 10px;
    }
    
    .language-options {
        min-width: 140px;
    }
    
    .flag-icon {
        font-size: 14px;
    }
    
    .lang-code {
        font-size: 10px;
    }
    
    .language-option {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }
    
    .lang-name {
        font-size: 13px;
    }
}

/* Tema oscuro mejorado */
@media (prefers-color-scheme: dark) {
    .language-current,
    .language-options {
        background: var(--gradient-card);
        border-color: rgba(0, 212, 255, 0.2);
    }
    
    .language-option:hover {
        background: rgba(0, 212, 255, 0.15);
    }
}
