/* 
 * FDF Manager - Estilos de Autenticación Social
 * Archivo: assets/css/fdf-auth-styles.css
 */

/* ==================== LAYOUT PRINCIPAL ==================== */

#pantalla-login {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

#login-contenedor {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 480px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

#login-contenedor::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c);
  background-size: 400% 400%;
  animation: gradientShift 3s ease infinite;
}

@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* ==================== HEADER ==================== */

.login-header h2 {
  color: #2c3e50;
  margin-bottom: 10px;
  font-size: 1.9em;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.login-header p {
  color: #7f8c8d;
  margin-bottom: 35px;
  line-height: 1.6;
  font-size: 0.95em;
}

.login-header img {
  max-width: 280px;
  margin-bottom: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/* ==================== MÉTODOS DE LOGIN ==================== */

.login-method {
  margin-bottom: 30px;
}

.login-method h3 {
  color: #34495e;
  margin-bottom: 18px;
  font-size: 1.2em;
  font-weight: 600;
}

/* ==================== FORMULARIO EMAIL ==================== */

.email-login-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.email-login-form input {
  padding: 14px 18px;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  font-size: 16px;
  transition: all 0.3s ease;
  background: #fafbfc;
  outline: none;
}

.email-login-form input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  transform: translateY(-1px);
}

.email-login-form input:hover {
  border-color: #d1d7db;
}

.email-login-form input::placeholder {
  color: #95a5a6;
  font-weight: 400;
}

/* ==================== BOTONES ==================== */

.btn-login {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 16px 28px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-login::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;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 25px rgba(102, 126, 234, 0.3);
}

.btn-login:active {
  transform: translateY(0);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

/* ==================== SEPARADOR ==================== */

.login-separator {
  margin: 30px 0;
  position: relative;
  text-align: center;
}

.login-separator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #e8ecef, transparent);
}

.login-separator span {
  background: white;
  padding: 0 20px;
  color: #95a5a6;
  font-weight: 500;
  position: relative;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ==================== BOTONES SOCIALES ==================== */

.social-login-options {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 30px;
}

.btn-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 20px;
  border: 2px solid #e8ecef;
  border-radius: 12px;
  background: white;
  color: #2c3e50;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn-social::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 100%;
  background: rgba(102, 126, 234, 0.05);
  transition: width 0.3s ease;
  z-index: 0;
}

.btn-social:hover::before {
  width: 100%;
}

.btn-social:hover {
  border-color: #667eea;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
}

.btn-social span, .btn-social .social-icon {
  position: relative;
  z-index: 1;
}

/* Colores específicos para cada red social */
.btn-social.facebook:hover {
  border-color: #3b5998;
  color: #3b5998;
}

.btn-social.facebook::before {
  background: rgba(59, 89, 152, 0.05);
}

.btn-social.twitter:hover {
  border-color: #1da1f2;
  color: #1da1f2;
}

.btn-social.twitter::before {
  background: rgba(29, 161, 242, 0.05);
}

.btn-social.instagram:hover {
  border-color: #e4405f;
  color: #e4405f;
}

.btn-social.instagram::before {
  background: rgba(228, 64, 95, 0.05);
}

.social-icon {
  font-size: 20px;
  filter: bluescale(20%);
  transition: filter 0.3s ease;
}

.btn-social:hover .social-icon {
  filter: bluescale(0%);
}

/* ==================== GOOGLE SIGN-IN ESPECÍFICO ==================== */

.g_id_signin {
  display: flex !important;
  justify-content: center;
  width: 100% !important;
  margin-bottom: 14px !important;
}

.g_id_signin > div {
  width: 100% !important;
  border-radius: 12px !important;
  transition: all 0.3s ease !important;
}

.g_id_signin:hover > div {
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.1) !important;
}

/* ==================== MODO INVITADO ==================== */

.guest-option {
  padding-top: 25px;
  border-top: 1px solid #e8ecef;
  position: relative;
}

.guest-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 1px;
  background: #667eea;
}

.btn-guest {
  background: transparent;
  color: #7f8c8d;
  border: 2px solid #e8ecef;
  padding: 12px 24px;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 10px;
  font-weight: 500;
}

.btn-guest:hover {
  background: #f8f9fa;
  border-color: #667eea;
  color: #667eea;
  transform: translateY(-1px);
}

.guest-option small {
  display: block;
  color: #95a5a6;
  font-style: italic;
  font-size: 12px;
  margin-top: 5px;
}

/* ==================== LOADING SPINNER ==================== */

#login-loading {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  backdrop-filter: blur(10px);
}

.spinner {
  border: 3px solid #f3f4f6;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

#login-loading p {
  color: #667eea;
  font-weight: 500;
  margin: 0;
  font-size: 14px;
}

/* ==================== INFORMACIÓN DEL USUARIO ==================== */

#user-info-display {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 1px solid #dee2e6;
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 25px;
  animation: slideDown 0.5s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#user-info-display .d-flex {
  display: flex;
  align-items: center;
  gap: 12px;
}

#user-avatar {
  width: 45px;
  height: 45px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 18px;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

#user-avatar::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
  100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

#user-display-name {
  font-weight: 600;
  color: #2c3e50;
  font-size: 16px;
}

#user-display-email {
  font-size: 14px;
  color: #7f8c8d;
  margin: 2px 0;
}

#user-social-info {
  font-size: 12px;
  color: #95a5a6;
  font-style: italic;
}

#logout-btn {
  margin-left: auto;
  padding: 6px 12px;
  background: linear-gradient(135deg, #e74c3c, #c0392b);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
}

#logout-btn:hover {
  background: linear-gradient(135deg, #c0392b, #a93226);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

/* ==================== NOTIFICACIONES ==================== */

.auth-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: white;
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
  border-left: 4px solid #28a745;
  z-index: 10000;
  transform: translateX(400px);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 300px;
}

.auth-notification.show {
  transform: translateX(0);
}

.auth-notification.error {
  border-left-color: #dc3545;
}

.auth-notification.warning {
  border-left-color: #ffc107;
}

.auth-notification .notification-title {
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 4px;
  font-size: 14px;
}

.auth-notification .notification-message {
  color: #7f8c8d;
  font-size: 13px;
  line-height: 1.4;
}

/* ==================== RESPONSIVE DESIGN ==================== */

@media (max-width: 768px) {
  #pantalla-login {
    padding: 15px;
  }
  
  #login-contenedor {
    padding: 30px 25px;
    max-width: 100%;
    margin: 0;
  }
  
  .login-header h2 {
    font-size: 1.6em;
  }
  
  .login-header img {
    max-width: 250px;
  }
  
  .btn-social {
    font-size: 14px;
    padding: 12px 16px;
  }
  
  .social-icon {
    font-size: 18px;
  }
  
  .email-login-form input {
    padding: 12px 16px;
    font-size: 16px; /* Evitar zoom en iOS */
  }
  
  .btn-login {
    padding: 14px 24px;
    font-size: 15px;
  }
  
  #user-avatar {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  #login-contenedor {
    padding: 25px 20px;
    border-radius: 15px;
  }
  
  .login-header h2 {
    font-size: 1.4em;
  }
  
  .login-header img {
    max-width: 200px;
  }
  
  .btn-social {
    font-size: 13px;
    padding: 10px 14px;
    gap: 10px;
  }
  
  .social-icon {
    font-size: 16px;
  }
  
  .auth-notification {
    right: 10px;
    left: 10px;
    max-width: none;
    transform: translateY(100px);
  }
  
  .auth-notification.show {
    transform: translateY(0);
  }
}

/* ==================== MODO OSCURO (OPCIONAL) ==================== */

@media (prefers-color-scheme: dark) {
  #pantalla-login {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  }
  
  #login-contenedor {
    background: #1a1a1a;
    color: #ecf0f1;
  }
  
  .login-header h2 {
    color: #ecf0f1;
  }
  
  .login-header p {
    color: #bdc3c7;
  }
  
  .email-login-form input {
    background: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
  }
  
  .email-login-form input:focus {
    background: #34495e;
    border-color: #667eea;
  }
  
  .email-login-form input::placeholder {
    color: #95a5a6;
  }
  
  .btn-social {
    background: #2c3e50;
    border-color: #34495e;
    color: #ecf0f1;
  }
  
  .btn-social:hover {
    background: #34495e;
  }
  
  .login-separator span {
    background: #1a1a1a;
    color: #7f8c8d;
  }
  
  .auth-notification {
    background: #2c3e50;
  }
  
  .auth-notification .notification-title {
    color: #ecf0f1;
  }
  
  .auth-notification .notification-message {
    color: #bdc3c7;
  }
}

/* ==================== ANIMACIONES ADICIONALES ==================== */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-method {
  animation: fadeInUp 0.6s ease-out;
  animation-fill-mode: both;
}

.login-method:nth-child(1) { animation-delay: 0.1s; }
.login-method:nth-child(2) { animation-delay: 0.2s; }
.login-method:nth-child(3) { animation-delay: 0.3s; }

/* ==================== ACCESIBILIDAD ==================== */

.btn-social:focus,
.btn-login:focus,
.btn-guest:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.email-login-form input:focus {
  outline: none; /* Ya tiene el box-shadow personalizado */
}

/* Reducir animaciones para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}