/* ProxyBox Custom Styles — Deep Quality Pass */

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* =============== ANIMATIONS =============== */
@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.05); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(40px, 30px) scale(1.02); }
}
@keyframes orbPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.7; }
}
.orb { animation: orbFloat 20s ease-in-out infinite, orbPulse 4s ease-in-out infinite; }
.orb-2 { animation: orbFloat 25s ease-in-out infinite reverse, orbPulse 5s ease-in-out infinite; }
.orb-3 { animation: orbFloat 18s ease-in-out infinite 2s, orbPulse 6s ease-in-out infinite; }

/* Scroll reveal */
.reveal {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, #0EA5E9 0%, #38BDF8 50%, #7DD3FC 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}

/* =============== CARDS & BORDERS =============== */
.gradient-border {
  position: relative; background: rgb(15, 23, 42); border-radius: 1rem;
}
.gradient-border::before {
  content: ''; position: absolute; inset: -1px; border-radius: 1rem; padding: 1px;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.3), rgba(14, 165, 233, 0));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude; pointer-events: none;
  transition: background 0.4s ease;
}
.gradient-border:hover::before {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.6), rgba(56, 189, 248, 0.3));
}

.glow { box-shadow: 0 0 40px -10px rgba(14, 165, 233, 0.3); transition: box-shadow 0.4s ease; }
.glow:hover { box-shadow: 0 0 60px -10px rgba(14, 165, 233, 0.5); }

/* Status border-left for device cards */
.device-card { border-left: 3px solid transparent; transition: all 0.2s ease; }
.device-card-online { border-left-color: #22c55e; }
.device-card-offline { border-left-color: #6b7280; }
.device-card-pending { border-left-color: #eab308; }

/* =============== PULSING DOT =============== */
@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.5); }
}
.pulse-dot { animation: pulse-dot 2s ease-in-out infinite; }

/* =============== DEVICE BOX (landing) =============== */
.device-box {
  width: 280px; height: 180px; border-radius: 20px;
  background: linear-gradient(145deg, #0f172a, #1e293b);
  border: 1px solid rgba(14, 165, 233, 0.3);
  box-shadow: 0 0 80px -20px rgba(14, 165, 233, 0.4), 0 0 120px -40px rgba(14, 165, 233, 0.2),
              inset 0 1px 0 rgba(255, 255, 255, 0.05);
  position: relative; overflow: hidden;
}
.device-box::after {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent, rgba(14, 165, 233, 0.1), transparent 30%);
  animation: deviceSpin 8s linear infinite;
}
@keyframes deviceSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

/* =============== NAV & LAYOUT =============== */
.nav-blur { backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease; }
.faq-answer.open { max-height: 500px; }

.step-connector {
  position: absolute; top: 36px; left: calc(50% + 60px); width: calc(100% - 120px); height: 2px;
  background: linear-gradient(90deg, rgba(14, 165, 233, 0.5), rgba(14, 165, 233, 0.1));
}

/* =============== SIDEBAR =============== */
.sidebar-item.active {
  background: rgba(14, 165, 233, 0.1); color: #0EA5E9; border-right: 2px solid #0EA5E9;
}

/* =============== SKELETONS =============== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, rgb(30, 41, 59) 25%, rgb(51, 65, 85) 50%, rgb(30, 41, 59) 75%);
  background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: 0.5rem;
}
.skeleton-text { height: 0.875rem; width: 60%; }
.skeleton-circle { border-radius: 50%; }

/* =============== MODAL =============== */
.modal-overlay {
  background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}

/* =============== SCROLLBAR =============== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: rgb(15, 23, 42); }
::-webkit-scrollbar-thumb { background: rgb(51, 65, 85); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgb(71, 85, 105); }

/* =============== MOBILE SIDEBAR =============== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%); transition: transform 0.3s ease;
    position: fixed; z-index: 50; top: 0; left: 0; bottom: 0; width: 260px;
  }
  .sidebar.open { transform: translateX(0); }
}

/* =============== BADGES =============== */
.badge-online { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.badge-offline { background: rgba(107, 114, 128, 0.15); color: #9ca3af; }
.badge-pending { background: rgba(234, 179, 8, 0.1); color: #eab308; }
.badge-premium { background: rgba(14, 165, 233, 0.1); color: #0EA5E9; }

.popular-badge {
  background: linear-gradient(135deg, #0EA5E9, #38BDF8);
  padding: 4px 16px; border-radius: 9999px; font-size: 0.75rem;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
}

/* =============== COPY BUTTON =============== */
.copy-btn.copied { color: #22c55e !important; }

/* =============== TOAST NOTIFICATIONS =============== */
#toast-container {
  position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
  display: flex; flex-direction: column-reverse; gap: 0.5rem; pointer-events: none;
}
.toast {
  animation: toastIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto; max-width: 360px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(10px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateY(0) scale(1); }
  to { opacity: 0; transform: translateY(-10px) scale(0.95); }
}

/* =============== STAT NUMBERS =============== */
.stat-number { font-variant-numeric: tabular-nums; }

/* =============== SPINNER =============== */
.spinner {
  border: 2px solid rgba(14, 165, 233, 0.2); border-top-color: #0EA5E9;
  border-radius: 50%; width: 20px; height: 20px; animation: spin 0.6s linear infinite;
}
.spinner-sm { width: 14px; height: 14px; border-width: 1.5px; }
.spinner-lg { width: 32px; height: 32px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =============== TABLE =============== */
.table-row { transition: background 0.15s ease; }
.table-row:hover { background: rgba(14, 165, 233, 0.05); }

/* =============== BAR CHART =============== */
.bar-chart-bar { transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1); }

/* =============== VIEW TRANSITIONS =============== */
.view-section { animation: viewFadeIn 0.25s ease-out; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============== CIRCULAR PROGRESS RING =============== */
.progress-ring { transform: rotate(-90deg); }
.progress-ring__circle-bg {
  fill: none; stroke: rgba(51, 65, 85, 0.5); stroke-linecap: round;
}
.progress-ring__circle {
  fill: none; stroke-linecap: round;
  transition: stroke-dashoffset 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============== TAB COMPONENT =============== */
.tab-nav {
  display: flex; gap: 0; border-bottom: 1px solid rgba(51, 65, 85, 0.5);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
}
.tab-btn {
  padding: 0.625rem 1rem; font-size: 0.8125rem; font-weight: 500;
  color: #6b7280; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: all 0.2s ease; cursor: pointer;
  background: none; border-top: none; border-left: none; border-right: none;
}
.tab-btn:hover { color: #d1d5db; }
.tab-btn.active { color: #0EA5E9; border-bottom-color: #0EA5E9; }

.tab-content { display: none; animation: viewFadeIn 0.2s ease-out; }
.tab-content.active { display: block; }

/* =============== CODE BLOCKS =============== */
.code-block {
  background: rgb(10, 15, 25); border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem; padding: 1rem 1.25rem; overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Consolas', monospace;
  font-size: 0.8125rem; line-height: 1.6; color: #e2e8f0;
  position: relative;
}
.code-block .code-copy {
  position: absolute; top: 0.5rem; right: 0.5rem;
  background: rgba(51, 65, 85, 0.5); border: 1px solid rgba(71, 85, 105, 0.5);
  border-radius: 0.5rem; padding: 0.25rem 0.5rem; font-size: 0.6875rem;
  color: #9ca3af; cursor: pointer; transition: all 0.2s ease;
}
.code-block .code-copy:hover { background: rgba(71, 85, 105, 0.7); color: #e2e8f0; }
.code-keyword { color: #c084fc; }
.code-string { color: #34d399; }
.code-comment { color: #6b7280; font-style: italic; }
.code-var { color: #60a5fa; }

/* Connection string highlight box */
.connection-string {
  background: rgba(14, 165, 233, 0.08); border: 1px solid rgba(14, 165, 233, 0.2);
  border-radius: 0.75rem; padding: 1rem 1.25rem;
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
  font-size: 0.875rem; color: #7dd3fc; word-break: break-all;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}

/* =============== SPARKLINE =============== */
.sparkline {
  display: inline-block; vertical-align: middle;
}
.sparkline polyline {
  fill: none; stroke: #0EA5E9; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.sparkline .sparkline-area {
  fill: url(#sparkGrad); opacity: 0.3;
}

/* =============== SIGNAL STRENGTH BARS =============== */
.signal-bars {
  display: inline-flex; align-items: flex-end; gap: 1px; height: 14px;
}
.signal-bars .bar {
  width: 3px; border-radius: 1px; transition: background 0.3s ease;
}
.signal-bars .bar.active { background: currentColor; }
.signal-bars .bar.inactive { background: rgba(107, 114, 128, 0.3); }

/* =============== TEMPERATURE COLOR =============== */
.temp-cool { color: #22c55e; }
.temp-warm { color: #eab308; }
.temp-hot { color: #ef4444; }

/* =============== PROGRESS BAR =============== */
.progress-bar-container {
  background: rgba(51, 65, 85, 0.3); border-radius: 9999px; height: 6px; overflow: hidden;
}
.progress-bar-fill {
  height: 100%; border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =============== QR CODE DISPLAY =============== */
.qr-container {
  background: white; border-radius: 1rem; padding: 1rem;
  display: inline-block;
}
.qr-container svg { display: block; }

/* =============== BREADCRUMBS =============== */
.breadcrumbs {
  display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1.5rem;
  font-size: 0.8125rem;
}
.breadcrumbs a { color: #6b7280; transition: color 0.2s; text-decoration: none; }
.breadcrumbs a:hover { color: #d1d5db; }
.breadcrumbs .separator { color: #374151; }
.breadcrumbs .current { color: #e2e8f0; font-weight: 500; }

/* =============== DROPDOWN MENU =============== */
.dropdown-menu {
  position: absolute; right: 0; top: 100%; margin-top: 0.25rem;
  background: rgb(15, 23, 42); border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 0.75rem; padding: 0.25rem; min-width: 180px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4); z-index: 50;
  animation: dropdownIn 0.15s ease-out;
}
@keyframes dropdownIn {
  from { opacity: 0; transform: translateY(-4px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.dropdown-item {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; font-size: 0.8125rem; color: #d1d5db;
  border-radius: 0.5rem; cursor: pointer; transition: background 0.15s ease;
  border: none; background: none; width: 100%; text-align: left;
}
.dropdown-item:hover { background: rgba(14, 165, 233, 0.1); color: #e2e8f0; }
.dropdown-item.danger { color: #f87171; }
.dropdown-item.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* =============== NOTIFICATION BELL =============== */
.notif-bell { position: relative; }
.notif-bell .notif-badge {
  position: absolute; top: -2px; right: -2px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; border: 2px solid rgb(3, 7, 18);
}

/* =============== SEARCH =============== */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  z-index: 100; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 15vh; animation: viewFadeIn 0.15s ease-out;
}
.search-box {
  background: rgb(15, 23, 42); border: 1px solid rgba(51, 65, 85, 0.5);
  border-radius: 1rem; width: 100%; max-width: 520px; overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.search-box input {
  width: 100%; padding: 1rem 1.25rem; background: transparent;
  border: none; outline: none; color: white; font-size: 1rem;
}
.search-results { max-height: 300px; overflow-y: auto; }
.search-result-item {
  padding: 0.625rem 1.25rem; cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; gap: 0.75rem;
}
.search-result-item:hover { background: rgba(14, 165, 233, 0.08); }

/* =============== PASSWORD STRENGTH =============== */
.password-strength { display: flex; gap: 3px; margin-top: 0.5rem; }
.password-strength .segment {
  flex: 1; height: 3px; border-radius: 2px; background: rgba(51, 65, 85, 0.5);
  transition: background 0.3s ease;
}
.password-strength[data-strength="1"] .segment:nth-child(1) { background: #ef4444; }
.password-strength[data-strength="2"] .segment:nth-child(-n+2) { background: #eab308; }
.password-strength[data-strength="3"] .segment:nth-child(-n+3) { background: #22c55e; }
.password-strength[data-strength="4"] .segment { background: #22c55e; }

/* =============== FOCUS VISIBLE =============== */
*:focus-visible {
  outline: 2px solid #0EA5E9; outline-offset: 2px; border-radius: 4px;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible {
  outline: 2px solid #0EA5E9; outline-offset: 1px;
}

/* =============== COMPARISON TABLE =============== */
.compare-table {
  width: 100%; border-collapse: separate; border-spacing: 0;
}
.compare-table th, .compare-table td {
  padding: 0.75rem 1rem; text-align: left; font-size: 0.8125rem;
  border-bottom: 1px solid rgba(51, 65, 85, 0.3);
}
.compare-table th { color: #6b7280; font-weight: 500; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.6875rem; }
.compare-table td { color: #d1d5db; }
.compare-table .highlight-col { background: rgba(14, 165, 233, 0.05); }
.compare-check { color: #22c55e; }
.compare-x { color: #6b7280; }

/* =============== EXPANDING ROW =============== */
.expand-row { display: none; }
.expand-row.open { display: table-row; }
.expand-row td { background: rgba(14, 165, 233, 0.03); }
