/* OticasPRO — Midnight Lens Theme
   Luxury optical showroom aesthetic: deep navy, warm amber accents, refined glass */

/* ============================================================
   BASE
   ============================================================ */
* { box-sizing: border-box; }

body {
  font-family: 'Outfit', sans-serif;
  background-color: #0a1419;
  color: #d0e0d8;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection {
  background: rgba(45,212,168,0.25);
  color: #fff;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.4; }
}

@keyframes slide-in-right {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

@keyframes glow-pulse {
  0%, 100% { box-shadow: 0 0 8px rgba(45,212,168,0.2); }
  50%       { box-shadow: 0 0 24px rgba(45,212,168,0.45), 0 0 48px rgba(45,212,168,0.15); }
}

@keyframes scan-line {
  0%   { top: -2px; opacity: 0; }
  10%  { opacity: 0.6; }
  90%  { opacity: 0.3; }
  100% { top: 100%; opacity: 0; }
}

@keyframes border-flow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes blink-dot {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.2; }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

.animate-pulse-slow   { animation: pulse-slow 2s ease-in-out infinite; }
.animate-glow         { animation: glow-pulse 3s ease-in-out infinite; }
.animate-fade-up      { animation: fade-up 0.4s cubic-bezier(0.22,1,0.36,1) both; }
.animate-fade-in      { animation: fade-in 0.3s ease-out both; }
.animate-slide-right  { animation: slide-in-right 0.3s cubic-bezier(0.22,1,0.36,1) both; }
.animate-blink        { animation: blink-dot 1.2s ease-in-out infinite; }
.animate-shimmer      { animation: shimmer 2s linear infinite; background-size: 200% 100%; }
.animate-float        { animation: float 3s ease-in-out infinite; }

/* Staggered fade-up for lists */
.stagger-1 { animation-delay: 0.05s; }
.stagger-2 { animation-delay: 0.1s; }
.stagger-3 { animation-delay: 0.15s; }
.stagger-4 { animation-delay: 0.2s; }
.stagger-5 { animation-delay: 0.25s; }

/* ============================================================
   NAV RAIL — Refined vertical navigation
   ============================================================ */
.nav-rail {
  background: linear-gradient(180deg, #0c1c22 0%, #0f1e24 50%, #0c1820 100%);
  border-right: 1px solid rgba(45,212,168,0.06);
  box-shadow: 2px 0 24px rgba(0,0,0,0.5);
}

.nav-item {
  position: relative;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  color: #4a6a8e;
}

.nav-item:hover {
  background: rgba(45,212,168,0.06);
  color: #8ab4d8;
  transform: scale(1.05);
}

.nav-item.active {
  background: rgba(45,212,168,0.1);
  color: #2dd4a8;
  box-shadow: 0 0 20px rgba(45,212,168,0.12);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 2.5px;
  background: linear-gradient(180deg, transparent, #2dd4a8, transparent);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 10px rgba(45,212,168,0.6), 0 0 20px rgba(45,212,168,0.3);
}

/* ============================================================
   GLASSMORPHISM — Refined glass panels
   ============================================================ */
.glass {
  background: rgba(10,18,32,0.88);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid rgba(45,212,168,0.06);
}

.glass-bright {
  background: rgba(13,21,38,0.92);
  backdrop-filter: blur(24px) saturate(1.3);
  -webkit-backdrop-filter: blur(24px) saturate(1.3);
  border: 1px solid rgba(45,212,168,0.12);
}

/* ============================================================
   GLOW / ACCENT EFFECTS
   ============================================================ */
.border-glow {
  border-color: rgba(45,212,168,0.4) !important;
  box-shadow: 0 0 16px rgba(45,212,168,0.15), inset 0 0 16px rgba(45,212,168,0.05) !important;
}

.text-glow {
  text-shadow: 0 0 20px rgba(45,212,168,0.5), 0 0 40px rgba(45,212,168,0.2);
}

.cyan-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2dd4a8;
  box-shadow: 0 0 8px rgba(45,212,168,0.8), 0 0 20px rgba(45,212,168,0.3);
}

.red-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff4757;
  box-shadow: 0 0 8px rgba(255,71,87,0.6);
}

.green-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00e676;
  box-shadow: 0 0 8px rgba(0,230,118,0.6);
}

/* ============================================================
   LOGO GLOW — Refined ambient light
   ============================================================ */
.logo-glow {
  position: relative;
  overflow: hidden;
}
.logo-glow::after {
  content: '';
  position: absolute;
  inset: -2px;
  background: radial-gradient(circle at 50% 50%, rgba(45,212,168,0.15) 0%, transparent 70%);
  animation: glow-pulse 4s ease-in-out infinite;
  border-radius: inherit;
}

/* ============================================================
   MESSAGE BUBBLES — Polished chat feel
   ============================================================ */
.msg-tail-in {
  position: relative;
}
.msg-tail-in::before {
  content: '';
  position: absolute;
  top: 0;
  left: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 0 9px 8px 0;
  border-color: transparent #0f1e24 transparent transparent;
}

.msg-tail-out {
  position: relative;
}
.msg-tail-out::before {
  content: '';
  position: absolute;
  top: 0;
  right: -8px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 9px 0 0;
  border-color: #0e2428 transparent transparent transparent;
}

.msg-shadow {
  box-shadow: 0 1px 6px rgba(0,0,0,0.35), 0 0 0 1px rgba(45,212,168,0.03);
}

/* ============================================================
   CHAT BACKGROUND — Subtle grid pattern
   ============================================================ */
.wa-chat-pattern {
  background-color: #0c1820;
  background-image:
    radial-gradient(circle at 25% 25%, rgba(45,212,168,0.015) 0%, transparent 50%),
    radial-gradient(circle at 75% 75%, rgba(99,102,241,0.01) 0%, transparent 50%),
    linear-gradient(rgba(45,212,168,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(45,212,168,0.02) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%, 48px 48px, 48px 48px;
}

/* Empty state background with subtle texture */
.wa-empty-bg {
  background-color: #0c1820;
  background-image:
    radial-gradient(circle at 30% 40%, rgba(45,212,168,0.03) 0%, transparent 50%),
    radial-gradient(circle at 70% 60%, rgba(99,102,241,0.025) 0%, transparent 50%);
}

/* ============================================================
   CUSTOM SCROLLBAR — Sleek & minimal
   ============================================================ */
.wa-scrollbar::-webkit-scrollbar        { width: 5px; }
.wa-scrollbar::-webkit-scrollbar-track  { background: transparent; }
.wa-scrollbar::-webkit-scrollbar-thumb  { background: rgba(45,212,168,0.1); border-radius: 10px; }
.wa-scrollbar::-webkit-scrollbar-thumb:hover { background: rgba(45,212,168,0.25); }

::-webkit-scrollbar        { width: 5px; height: 5px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: rgba(45,212,168,0.08); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: rgba(45,212,168,0.2); }

/* ============================================================
   CONTACT ROW — Smooth interaction
   ============================================================ */
.wa-contact-row {
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
  border-bottom: 1px solid rgba(26,63,58,0.35);
}

.wa-contact-row:hover {
  background: rgba(21,34,54,0.7);
  border-bottom-color: rgba(26,63,58,0.5);
}

.wa-contact-row.selected {
  background: rgba(45,212,168,0.06);
  border-bottom-color: rgba(45,212,168,0.1);
}

/* ============================================================
   INPUT FOCUS — Refined glow ring
   ============================================================ */
input:focus, textarea:focus, select:focus {
  outline: none;
}

input.chat-input:focus {
  border-color: rgba(45,212,168,0.35);
  box-shadow: 0 0 0 3px rgba(45,212,168,0.06), 0 0 12px rgba(45,212,168,0.08);
}

/* ============================================================
   BUTTON STYLES — Polished interactive states
   ============================================================ */
.btn-cyan {
  background: linear-gradient(135deg, rgba(45,212,168,0.1) 0%, rgba(0,180,220,0.08) 100%);
  border: 1px solid rgba(45,212,168,0.25);
  color: #2dd4a8;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  position: relative;
  overflow: hidden;
}

.btn-cyan::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(45,212,168,0.05) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-cyan:hover {
  background: linear-gradient(135deg, rgba(45,212,168,0.18) 0%, rgba(0,180,220,0.12) 100%);
  border-color: rgba(45,212,168,0.5);
  box-shadow: 0 4px 20px rgba(45,212,168,0.2), 0 0 0 1px rgba(45,212,168,0.1);
  transform: translateY(-1px);
}

.btn-cyan:hover::before {
  opacity: 1;
}

.btn-cyan:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(45,212,168,0.15);
}

.btn-cyan:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ============================================================
   CARDS / PANELS — Elevated surfaces
   ============================================================ */
.tech-card {
  background: linear-gradient(135deg, #0f1e24 0%, #0c1820 100%);
  border: 1px solid rgba(26,63,58,0.6);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.22,1,0.36,1);
}

.tech-card:hover {
  border-color: rgba(45,212,168,0.15);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3), 0 0 0 1px rgba(45,212,168,0.06);
  transform: translateY(-2px);
}

/* ============================================================
   TICKET / ORDER PIPELINE (Kanban)
   ============================================================ */
.pipeline-col {
  background: rgba(10,18,32,0.5);
  border: 1px solid rgba(26,63,58,0.4);
  border-radius: 12px;
}

.ticket-card {
  background: linear-gradient(135deg, #0f1e24 0%, #112822 100%);
  border: 1px solid rgba(26,63,58,0.5);
  border-radius: 10px;
  transition: all 0.25s cubic-bezier(0.22,1,0.36,1);
  cursor: pointer;
}

.ticket-card:hover {
  border-color: rgba(45,212,168,0.2);
  box-shadow: 0 4px 20px rgba(0,0,0,0.3), 0 0 0 1px rgba(45,212,168,0.06);
  transform: translateY(-2px);
}

/* ============================================================
   BADGE / TAG PILLS — Refined labels
   ============================================================ */
.badge-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ============================================================
   SIDEBAR HEADER — Subtle gradient
   ============================================================ */
.sidebar-header {
  background: linear-gradient(135deg, #0f2420 0%, #122a24 100%);
  border-bottom: 1px solid rgba(45,212,168,0.06);
}

/* ============================================================
   STATUS BAR
   ============================================================ */
.connected-bar    { background: linear-gradient(90deg, #0f2420, #0e2a28); }
.disconnected-bar { background: linear-gradient(90deg, #1a0a0a, #2d0f0f); }

/* ============================================================
   SELECT / DROPDOWN — Dark refined
   ============================================================ */
select {
  background: #0c1820;
  color: #d0dae8;
  border: 1px solid rgba(26,63,58,0.6);
  border-radius: 8px;
  transition: border-color 0.2s ease;
}

select:hover {
  border-color: rgba(26,63,58,0.9);
}

select option {
  background: #0f1e24;
  color: #d0dae8;
}

/* ============================================================
   LOADING — Refined spinner
   ============================================================ */
.loading-screen {
  position: fixed;
  inset: 0;
  background: #0a1419;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-ring {
  width: 40px;
  height: 40px;
  border: 2px solid rgba(45,212,168,0.1);
  border-top-color: #2dd4a8;
  border-radius: 50%;
  animation: spin 0.7s cubic-bezier(0.5,0,0.5,1) infinite;
}

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

/* ============================================================
   TOOLTIP — Refined appearance
   ============================================================ */
[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) scale(0.95);
  background: linear-gradient(135deg, #142a2e, #0f1e24);
  color: #d0dae8;
  font-family: 'Outfit', sans-serif;
  font-size: 11px;
  font-weight: 400;
  white-space: nowrap;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(26,63,58,0.6);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  pointer-events: none;
  opacity: 0;
  transition: all 0.2s cubic-bezier(0.22,1,0.36,1);
  z-index: 100;
}

[data-tooltip]:hover::after {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

/* ============================================================
   FORM ELEMENTS — Unified styling
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="search"],
textarea {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="time"]:focus,
input[type="search"]:focus,
textarea:focus {
  border-color: rgba(45,212,168,0.3) !important;
  box-shadow: 0 0 0 3px rgba(45,212,168,0.05), 0 0 8px rgba(45,212,168,0.08);
}

/* ============================================================
   SMOOTH PAGE TRANSITIONS
   ============================================================ */
.page-enter {
  animation: fade-up 0.4s cubic-bezier(0.22,1,0.36,1) both;
}

/* ============================================================
   KANBAN COLUMN HEADER — Accent bar
   ============================================================ */
.kanban-col-header {
  position: relative;
  overflow: hidden;
}

.kanban-col-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor, transparent);
  opacity: 0.15;
}

/* ============================================================
   AMBIENT NOISE TEXTURE (subtle grain)
   ============================================================ */
.grain::before {
  content: '';
  position: fixed;
  inset: 0;
  opacity: 0.015;
  pointer-events: none;
  z-index: 9998;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}
