/* ========================================================================
   Variables de DiseÃ±o
   ======================================================================== */

:root {
  /* Colores Principales */
  --primary-color: #667eea;
  --primary-dark: #5a67d8;
  --primary-light: #818cf8;
  --secondary-color: #764ba2;
  --accent-color: #f57c00;
  
  /* Colores de Estado */
  --success-color: #10b981;
  --success-bg: rgba(16, 185, 129, 0.1);
  --error-color: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.1);
  --warning-color: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.1);
  --info-color: #3b82f6;
  --info-bg: rgba(59, 130, 246, 0.1);
  
  /* Grises */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Glass Effect Colors */
  --glass-bg: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.2);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
  --glass-text: #ffffff;
  --glass-text-secondary: rgba(255, 255, 255, 0.8);
  
  /* Espaciado */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  
  /* Bordes */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
  
  /* Sombras */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  
  /* TipografÃ­a */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Fira Code', 'Courier New', monospace;
  
  /* Transiciones */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
}

/* ========================================================================
   Estilos Base
   ======================================================================== */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  color: var(--gray-900);
  background: #0f172a;
  background-image: 
    radial-gradient(at 20% 80%, rgba(99, 126, 234, 0.2) 0, transparent 50%),
    radial-gradient(at 80% 20%, rgba(118, 75, 162, 0.2) 0, transparent 50%),
    radial-gradient(at 40% 40%, rgba(59, 130, 246, 0.1) 0, transparent 50%);
  min-height: 100vh;
  padding: var(--spacing-lg);
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1.5;
  position: relative;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(255, 255, 255, 0.01) 2px,
      rgba(255, 255, 255, 0.01) 4px
    );
  pointer-events: none;
  z-index: 1;
}

/* ========================================================================
   Loader de PÃ¡gina
   ======================================================================== */

.page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity var(--transition-base);
}

.page-loader.hidden {
  opacity: 0;
  pointer-events: none;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* ========================================================================
   Container Principal
   ======================================================================== */

.container {
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-xl);
  box-shadow: 
    0 8px 32px 0 rgba(31, 38, 135, 0.37),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.1);
  max-width: 720px;
  width: 100%;
  padding: var(--spacing-2xl);
  animation: slideIn 0.5s ease-out;
  position: relative;
  z-index: 10;
  overflow: hidden;
}

.container::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, 
    transparent,
    rgba(255, 255, 255, 0.3) 20%,
    rgba(255, 255, 255, 0.3) 80%,
    transparent
  );
}

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

/* ========================================================================
   Header
   ======================================================================== */

.header {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: var(--spacing-lg);
}


.title {
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: var(--spacing-sm);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.subtitle {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* ========================================================================
   Formulario
   ======================================================================== */

.attendance-form {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
}

.form-section {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  box-shadow: 
    0 4px 15px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.section-subtitle {
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
}

.subsection-title {
  font-size: 1rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: var(--spacing-md);
}

/* ========================================================================
   Elementos de Formulario
   ======================================================================== */

.form-group {
  margin-bottom: var(--spacing-lg);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.form-label {
  display: block;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: var(--spacing-sm);
  font-size: 0.875rem;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.required {
  color: #fca5a5;
  margin-left: 2px;
}

.form-input,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: #ffffff;
  font-size: 1rem;
  transition: all var(--transition-fast);
  appearance: none;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M10.293 3.293L6 7.586 1.707 3.293A1 1 0 00.293 4.707l5 5a1 1 0 001.414 0l5-5a1 1 0 10-1.414-1.414z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-color: rgba(255, 255, 255, 0.1);
  padding-right: 2.5rem;
}

.form-select option {
  background: #1e293b;
  color: white;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: rgba(147, 197, 253, 0.5);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: 0 0 0 3px rgba(147, 197, 253, 0.1);
}

.form-input:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown) {
  border-color: rgba(252, 165, 165, 0.5);
}

.error-message {
  display: none;
  color: #fca5a5;
  font-size: 0.875rem;
  margin-top: var(--spacing-xs);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.error-message.active {
  display: block;
}

/* ========================================================================
   SecciÃ³n de Fotos
   ======================================================================== */

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--spacing-md);
  margin-bottom: var(--spacing-xl);
}

.photo-upload-container {
  position: relative;
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  
  /* Resetear estilos de botón */
  width: 100%;
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  text-align: center;
  line-height: inherit;
  color: inherit;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.photo-upload-container:hover {
  border-color: rgba(147, 197, 253, 0.5);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.photo-upload-container.has-photo {
  border-style: solid;
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(16, 185, 129, 0.05);
  padding: var(--spacing-sm);
}

.photo-placeholder {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.photo-upload-container.has-photo .photo-placeholder {
  display: none;
}

.camera-icon,
.ticket-icon {
  width: 48px;
  height: 48px;
  fill: rgba(255, 255, 255, 0.6);
}

.photo-label {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.9rem;
}

.photo-hint {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.photo-preview-container {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: var(--spacing-sm);
}

.photo-upload-container.has-photo .photo-preview-container {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-preview {
  width: 100%;
  max-height: 100%;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.photo-remove {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: rgba(239, 68, 68, 0.9);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 28px;
  height: 28px;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  z-index: 3;
  backdrop-filter: blur(5px);
}

.photo-remove:hover {
  background: rgba(239, 68, 68, 1);
  transform: scale(1.1);
}

.photo-timestamp {
  position: absolute;
  bottom: var(--spacing-sm);
  left: var(--spacing-sm);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-family: var(--font-mono);
  backdrop-filter: blur(5px);
}

.ticket-section {
  margin-top: var(--spacing-xl);
}

.photo-upload-ticket {
  max-width: 240px;
  margin: 0 auto;
}

/* ========================================================================
   SecciÃ³n de UbicaciÃ³n
   ======================================================================== */

.location-status {
  display: flex;
  align-items: center;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  background: rgba(59, 130, 246, 0.1);
  border: 2px solid rgba(59, 130, 246, 0.3);
  border-radius: var(--radius-md);
  backdrop-filter: blur(5px);
  position: relative;
}

.location-status.success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.location-status.error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
}

.location-icon {
  width: 24px;
  height: 24px;
  fill: rgba(147, 197, 253, 0.9);
  flex-shrink: 0;
}

.location-status.success .location-icon {
  fill: rgba(16, 185, 129, 0.9);
}

.location-status.error .location-icon {
  fill: rgba(239, 68, 68, 0.9);
}

.location-info {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  flex: 1;
}

.location-status-text {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
}

.location-coords {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  font-family: var(--font-mono);
}

.btn-retry-location {
  padding: var(--spacing-sm) var(--spacing-md);
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  transition: all var(--transition-base);
  backdrop-filter: blur(5px);
}

.btn-retry-location:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.6);
  transform: translateY(-1px);
}

.btn-retry-location svg {
  animation: none;
}

.btn-retry-location:active svg {
  animation: spin 0.5s ease-in-out;
}

/* ========================================================================
   Botones
   ======================================================================== */

.btn {
  position: relative;
  padding: var(--spacing-md) var(--spacing-xl);
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  width: 100%;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn.loading .btn-text {
  opacity: 0;
}

.btn-loader {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none;
}

.btn.loading .btn-loader {
  display: block;
}

/* ========================================================================
   Alertas
   ======================================================================== */

.alert {
  display: none;
  align-items: flex-start;
  gap: var(--spacing-md);
  padding: var(--spacing-md);
  border-radius: var(--radius-md);
  margin-top: var(--spacing-lg);
  animation: slideDown 0.3s ease-out;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.alert.active {
  display: flex;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.alert-success {
  background: rgba(16, 185, 129, 0.15);
  border: 2px solid rgba(16, 185, 129, 0.3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.15);
  border: 2px solid rgba(239, 68, 68, 0.3);
}

.alert-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.alert-success .alert-icon {
  fill: rgba(16, 185, 129, 0.9);
}

.alert-error .alert-icon {
  fill: rgba(239, 68, 68, 0.9);
}

.alert-content strong {
  display: block;
  margin-bottom: var(--spacing-xs);
  color: rgba(255, 255, 255, 0.95);
}

.alert-success .alert-content {
  color: rgba(134, 239, 172, 0.95);
}

.alert-error .alert-content {
  color: rgba(252, 165, 165, 0.95);
}

.alert-content p {
  font-size: 0.875rem;
  opacity: 0.9;
}

.logo {
  width: 160px;   /* Ajusta el ancho */
  height: auto;   /* Mantiene proporción */
}
