/* ====================================
   🔔 ALERT CENTER (Glassmorphism)
   ==================================== */

:root {
  --alert-bg-1: #0b1220;
  --alert-bg-2: #130a2b;
  --glass: rgba(255, 255, 255, 0.08);
  --glass-strong: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --text: rgba(255, 255, 255, 0.92);
  --text-muted: rgba(255, 255, 255, 0.68);
  --neon: #8b5cf6;
  --neon-2: #22d3ee;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
}

/* Sección principal */
#alertsSection {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 20% 10%, rgba(139, 92, 246, 0.25), transparent 60%),
              radial-gradient(900px 500px at 80% 20%, rgba(34, 211, 238, 0.16), transparent 55%),
              linear-gradient(135deg, var(--alert-bg-1) 0%, var(--alert-bg-2) 100%);
  padding: 80px 0 50px;
  display: none;
}

#alertsSection.active {
  display: block;
}

.alerts-page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.alerts__header {
  margin-bottom: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.alerts__title-section {
  flex: 1;
  min-width: 250px;
}

.alerts__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.alerts__subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.alerts__actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.alerts__btn {
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alerts__btn--primary {
  background: linear-gradient(135deg, var(--neon) 0%, #6d28d9 100%);
  color: #fff;
}

.alerts__btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(139, 92, 246, 0.25);
}

.alerts__btn--secondary {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(10px);
}

.alerts__btn--secondary:hover {
  background: var(--glass-strong);
  border-color: rgba(139, 92, 246, 0.5);
}

/* Stats Cards */
.alerts__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.alerts__stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
}

.alerts__stat-card:hover {
  border-color: rgba(139, 92, 246, 0.55);
  transform: translateY(-2px);
}

.alerts__stat-icon {
  font-size: 2.5rem;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(139, 92, 246, 0.12);
  border-radius: 12px;
}

.alerts__stat-content {
  flex: 1;
}

.alerts__stat-label {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.alerts__stat-value {
  color: var(--text);
  font-size: 1.8rem;
  font-weight: 700;
}

/* Tabs */
.alerts__tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  overflow-x: auto;
}

.alerts__tab {
  padding: 12px 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.alerts__tab:hover {
  color: var(--text);
}

.alerts__tab.active {
  color: var(--neon-2);
}

.alerts__tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon) 0%, var(--neon-2) 100%);
}

/* Grid de alertas */
.alerts__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Alert Card */
.alert-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
  backdrop-filter: blur(12px);
}

.alert-card:hover {
  border-color: rgba(34, 211, 238, 0.5);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.alert-card__header {
  padding: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.10);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.alert-card__title {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.alert-card__location {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.alert-card__status {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.alert-card__status--active {
  background: rgba(16, 185, 129, 0.18);
  color: var(--success);
}

.alert-card__status--triggered {
  background: rgba(245, 158, 11, 0.18);
  color: var(--warning);
}

.alert-card__body {
  padding: 20px;
}

.alert-card__price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--alert-border);
}

.alert-card__price-label {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 4px;
}

.alert-card__price-value {
  color: var(--text);
  font-size: 1.3rem;
  font-weight: 700;
}

.alert-card__price-value--target {
  color: var(--neon-2);
}

.alert-card__meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.alert-card__meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.alert-card__meta-icon {
  opacity: 0.7;
}

.alert-card__actions {
  display: flex;
  gap: 8px;
}

.alert-card__btn {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alert-card__btn--view {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}

.alert-card__btn--view:hover {
  background: rgba(59, 130, 246, 0.25);
}

.alert-card__btn--delete {
  background: rgba(239, 68, 68, 0.15);
  color: var(--danger);
}

.alert-card__btn--delete:hover {
  background: rgba(239, 68, 68, 0.25);
}

/* Empty state */
.alerts__empty {
  text-align: center;
  padding: 80px 20px;
}

.alerts__empty-icon {
  font-size: 5rem;
  margin-bottom: 24px;
  opacity: 0.5;
}

.alerts__empty-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--alert-text);
  margin-bottom: 12px;
}

.alerts__empty-text {
  color: var(--alert-text-muted);
  font-size: 1.1rem;
  margin-bottom: 32px;
}

/* Modal de crear alerta */
.alert-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.alert-modal.active {
  opacity: 1;
  pointer-events: all;
}

.alert-modal__content {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform 0.3s ease;
}

.alert-modal.active .alert-modal__content {
  transform: scale(1);
}

.alert-modal__header {
  padding: 24px;
  border-bottom: 1px solid var(--alert-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.alert-modal__title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text);
}

.alert-modal__close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alert-modal__close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.alert-modal__body {
  padding: 24px;
}

.alert-modal__form-group {
  margin-bottom: 20px;
}

.alert-modal__label {
  display: block;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
}

.alert-modal__input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  color: var(--text);
  font-size: 1rem;
  transition: all 0.3s ease;
}

.alert-modal__input:focus {
  outline: none;
  border-color: rgba(34,211,238,0.6);
  background: rgba(255, 255, 255, 0.08);
}

.alert-modal__help-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 6px;
}

.alert-modal__actions {
  display: flex;
  gap: 12px;
}

.alert-modal__btn {
  flex: 1;
  padding: 14px;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.alert-modal__btn--primary {
  background: linear-gradient(135deg, var(--neon) 0%, #6d28d9 100%);
  color: #fff;
}

.alert-modal__btn--primary:hover {
  filter: brightness(1.05);
  transform: translateY(-2px);
}

.alert-modal__btn--secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.alert-modal__btn--secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* Notificación en navbar */
.alerts-counter {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, var(--neon-2) 0%, var(--neon) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
  .alerts__title {
    font-size: 2rem;
  }
  
  .alerts__grid {
    grid-template-columns: 1fr;
  }
  
  .alerts__stats {
    grid-template-columns: 1fr;
  }
}
