/* glass.css — Dark Navy Glassmorphism with Amber Glow
 *
 * Unlayered CSS — loads after theme-bienleos.css.
 * Frosted dark glass cards, amber glow, subtle depth.
 */

/* === Background — Dark Navy Gradient === */
body {
  background: linear-gradient(135deg, #0B0C1E 0%, #12132B 30%, #0F1023 60%, #0A0B1A 100%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* === Glass Card — Dark, Frosted, Floating === */
.glass-card {
  background: rgba(23, 24, 49, 0.55);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
  box-shadow:
    0 1px 3px rgba(0, 0, 0, 0.2),
    0 8px 24px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
}

.glass-card:hover {
  border-color: rgba(245, 158, 11, 0.15);
  box-shadow:
    0 2px 6px rgba(245, 158, 11, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.15);
  transform: translateY(-3px);
}

/* === Dark KPI Card — Deeper Navy === */
.kpi-card-dark {
  background: linear-gradient(135deg, #0F1023 0%, #1A1B3A 100%);
  border-radius: 20px;
  border: 1px solid rgba(245, 158, 11, 0.08);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.3),
    0 12px 40px rgba(0, 0, 0, 0.2);
  color: #FFFFFF;
  position: relative;
  overflow: hidden;
}

.kpi-card-dark::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(245, 158, 11, 0.4), transparent);
}

/* === Amber Gradient Card === */
.card-amber {
  background: linear-gradient(135deg, #F59E0B 0%, #F97316 50%, #EA580C 100%);
  border-radius: 20px;
  border: none;
  box-shadow:
    0 4px 12px rgba(245, 158, 11, 0.2),
    0 12px 32px rgba(245, 158, 11, 0.15);
  color: #0F1023;
  position: relative;
  overflow: hidden;
}

.card-amber::after {
  content: '';
  position: absolute;
  top: -50%; right: -30%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15), transparent);
  border-radius: 50%;
}

/* === Orange Accent Card === */
.card-orange {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0.03) 100%);
  border: 1px solid rgba(249, 115, 22, 0.15);
  border-radius: 16px;
}

/* === Cyan Accent Card === */
.card-cyan {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(56, 189, 248, 0.02) 100%);
  border: 1px solid rgba(56, 189, 248, 0.12);
  border-radius: 16px;
}

/* === Glass Nav === */
.glass-nav {
  background: rgba(15, 16, 35, 0.7);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

/* === Glass Banner === */
.glass-banner {
  background: rgba(15, 16, 35, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.1);
}

/* === Glass Inputs === */
.glass-input {
  background: rgba(23, 24, 49, 0.6) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 12px !important;
  color: #E2E8F0 !important;
}

.glass-input::placeholder {
  color: rgba(148, 163, 184, 0.6) !important;
}

.glass-input:focus {
  border-color: rgba(245, 158, 11, 0.4) !important;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1) !important;
}

/* === Generic Glass === */
.glass {
  background: rgba(23, 24, 49, 0.55);
  backdrop-filter: blur(16px) saturate(130%);
  -webkit-backdrop-filter: blur(16px) saturate(130%);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* === Glass Glow — Amber === */
.glass-glow {
  box-shadow:
    0 0 0 1px rgba(245, 158, 11, 0.08),
    0 0 32px rgba(245, 158, 11, 0.06),
    0 8px 24px rgba(0, 0, 0, 0.2);
}

/* === htmx Loading === */
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator { display: inline-block; }
.htmx-request.htmx-indicator { display: inline-block; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(245, 158, 11, 0.15);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

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

/* === htmx Swap Animation === */
.htmx-added { opacity: 0; animation: fadeInUp 0.4s ease forwards; }
.htmx-settling { animation: fadeInUp 0.4s ease forwards; }

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

/* === Custom Scrollbar === */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.2); }
::-webkit-scrollbar-thumb { background: rgba(245, 158, 11, 0.2); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(245, 158, 11, 0.4); }

/* === Reduced Motion — WCAG 2.3.3 === */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .glass-card:hover {
    transform: none;
  }

  button:hover, .button:hover {
    transform: none;
  }

  .spinner {
    animation: none;
    border-top-color: var(--color-primary);
    border-right-color: rgba(245, 158, 11, 0.3);
    border-bottom-color: rgba(245, 158, 11, 0.3);
  }
}
