/* Estilos para el sistema de autenticación */

/* Modal de Autenticación */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
    margin: 0;
    box-sizing: border-box;
}

.auth-modal[style*="block"] {
    display: flex !important;
}

.auth-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    margin: 0 auto;
    position: relative;
}

.auth-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.auth-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.close-auth-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-auth-modal:hover {
    background: #f5f5f5;
    color: #333;
}

/* Formularios de autenticación */
.auth-forms {
    padding: 0 24px;
}

.auth-form {
    display: block;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.auth-btn {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 16px;
}

.auth-btn.primary {
    background: #007bff;
    color: white;
}

.auth-btn.primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.auth-btn.primary:active {
    transform: translateY(0);
}

.auth-error {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    margin-top: 12px;
    border: 1px solid #fcc;
}

/* Divider para Google Sign-In */
.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e5e9;
}

.auth-divider span {
    padding: 0 16px;
    color: #666;
    font-size: 14px;
    background: white;
}

/* Google Sign-In Button */
.auth-btn.google {
    background: #fff;
    color: #333;
    border: 2px solid #e1e5e9;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.auth-btn.google:hover {
    background: #f8f9fa;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.auth-btn.google i {
    font-size: 18px;
    color: #4285f4;
}

/* Toggle entre login y registro */
.auth-toggle {
    padding: 0 24px 24px;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    margin-top: 24px;
    padding-top: 24px;
}

.auth-toggle p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

#authToggleLink {
    color: #007bff;
    cursor: pointer;
    font-weight: 500;
    text-decoration: underline;
}

#authToggleLink:hover {
    color: #0056b3;
}

/* Modal de Perfil */
.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.profile-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

.profile-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.profile-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
}

.close-profile-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.close-profile-modal:hover {
    background: #f5f5f5;
    color: #333;
}

.profile-content {
    padding: 0 24px 24px;
    text-align: center;
}

.profile-avatar {
    margin-bottom: 20px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #007bff, #0056b3);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: white;
    font-size: 32px;
}

.profile-info {
    margin-bottom: 32px;
}

.profile-info h3 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.profile-info p {
    margin: 0;
    color: #666;
    font-size: 14px;
}

.profile-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.profile-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.profile-btn.secondary {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.profile-btn.secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.profile-btn.danger {
    background: #dc3545;
    color: white;
}

.profile-btn.danger:hover {
    background: #c82333;
    transform: translateY(-1px);
}

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

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

/* Modal de Frase Secreta */
.secret-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
    margin: 0;
    box-sizing: border-box;
}

.secret-modal[style*="block"] {
    display: flex !important;
}

.secret-modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
    margin: 0 auto;
    position: relative;
}

.secret-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 0;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 24px;
}

.secret-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #1e293b;
}

.close-secret-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #64748b;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.close-secret-modal:hover {
    background: #f1f5f9;
    color: #334155;
}

.secret-form {
    padding: 0 24px 24px;
}

.secret-form p {
    margin: 0 0 20px 0;
    color: #64748b;
    line-height: 1.5;
}

.secret-btn {
    width: 100%;
    background: #6366f1;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 16px;
}

.secret-btn:hover {
    background: #5855eb;
    transform: translateY(-1px);
}

.secret-error {
    color: #ef4444;
    font-size: 14px;
    margin-top: 12px;
    padding: 8px 12px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 6px;
    text-align: center;
}

.secret-modal-content.shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Responsive */
@media (max-width: 480px) {
    .auth-modal-content,
    .profile-modal-content,
    .secret-modal-content {
        margin: 10px;
        max-width: calc(100% - 20px);
    }
    
    .auth-modal-header,
    .profile-modal-header,
    .secret-modal-header {
        padding: 20px 20px 0;
    }
    
    .auth-forms,
    .profile-content {
        padding: 0 20px 20px;
    }
}

/* Estado de carga */
.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.loading-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
