/* 
  CurlSMS - Core Style System
  Premium Developer-Centric Dark Mode Styling
  Inspired by Vercel, Supabase, and linear.app
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --bg-primary: #030712;
  --bg-secondary: #090d16;
  --bg-card: #0f172a;
  --bg-card-hover: #1e293b;
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  
  /* Neon Accent Colors */
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.15);
  --accent-emerald-bright: #34d399;
  
  /* Text colors */
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Global resets & Scrollbar */
* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  font-family: var(--font-sans);
}

/* ================= FAIL-SAFE LAYOUT UTILITIES ================= */
/* Layout Centering & Container Widths */
.max-w-7xl { max-width: 80rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.mx-auto { margin-left: auto; margin-right: auto; }

/* Grid System */
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }

@media (min-width: 768px) {
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .md\:col-span-5 { grid-column: span 5 / span 5; }
  .md\:col-span-7 { grid-column: span 7 / span 7; }
  .md\:border-b-0 { border-bottom-width: 0px; }
  .md\:border-r { border-right: 1px solid var(--border-color); }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .lg\:col-span-7 { grid-column: span 7 / span 7; }
  .lg\:col-span-5 { grid-column: span 5 / span 5; }
  .lg\:col-span-3 { grid-column: span 3 / span 3; }
  .lg\:col-span-9 { grid-column: span 9 / span 9; }
  .lg\:px-8 { padding-left: 2rem; padding-right: 2rem; }
}

/* Flexbox System */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-stretch { align-items: stretch; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-grow { flex-grow: 1; }
.flex-shrink-0 { flex-shrink: 0; }

@media (min-width: 640px) {
  .sm\:flex-row { flex-direction: row; }
}

/* Gaps */
.gap-1\.5 { gap: 0.375rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Font Weights & Styles */
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.uppercase { text-transform: uppercase; }
.tracking-wider { letter-spacing: 0.05em; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-widest { letter-spacing: 0.1em; }

/* Margins & Paddings Fail-safes */
.my-20 { margin-top: 5rem; margin-bottom: 5rem; }
.my-12 { margin-top: 3rem; margin-bottom: 3rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.mt-8 { margin-top: 2rem; }
.mt-16 { margin-top: 4rem; }
.mb-16 { margin-bottom: 4rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-10 { margin-bottom: 2.5rem; }
.mb-12 { margin-bottom: 3rem; }
.mt-6 { margin-top: 1.5rem; }
.my-6 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.pt-16 { padding-top: 4rem; }
.pt-24 { padding-top: 6rem; }
.pt-8 { padding-top: 2rem; }
.pb-24 { padding-bottom: 6rem; }
.p-8 { padding: 2rem; }
.p-6 { padding: 1.5rem; }
.p-4 { padding: 1rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-3\.5 { padding: 0.875rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-1\.5 { padding-top: 0.375rem; padding-bottom: 0.375rem; }
.px-3\.5 { padding-left: 0.875rem; padding-right: 0.875rem; }
.py-2\.5 { padding-top: 0.625rem; padding-bottom: 0.625rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

/* Sizing Utilities */
.w-full { width: 100%; }
.w-fit { width: fit-content; }
.w-12 { width: 3rem; }
.w-24 { width: 6rem; }
.w-8 { width: 2rem; }
.h-16 { height: 4rem; }
.h-8 { height: 2rem; }
.h-2 { height: 0.5rem; }
.h-2\.5 { height: 0.625rem; }
.h-px { height: 1px; }
.h-full { height: 100%; }

/* Borders & Colors Fail-safes */
.border { border: 1px solid var(--border-color); }
.border-b { border-bottom: 1px solid var(--border-color); }
.border-t { border-top: 1px solid var(--border-color); }
.border-r { border-right: 1px solid var(--border-color); }
.rounded-lg { border-radius: 8px; }
.rounded-xl { border-radius: 12px; }
.rounded-2xl { border-radius: 16px; }
.rounded-full { border-radius: 9999px; }

/* Font Sizes */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.text-4xl { font-size: 2.25rem; }
.text-5xl { font-size: 3rem; }
.text-6xl { font-size: 3.75rem; }

/* Display utilities */
.hidden { display: none; }
@media (min-width: 768px) {
  .md\:flex { display: flex; }
}
@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
}


/* Radial grid background - Supabase style */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 50% 0px, rgba(16, 185, 129, 0.08) 0%, transparent 50%),
    radial-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 100% 100%, 24px 24px;
  pointer-events: none;
  z-index: 0;
}

/* Scrollbar customization */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: #1e293b;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #334155;
}

/* Utility classes */
.font-mono {
  font-family: var(--font-mono);
}

.text-emerald {
  color: var(--accent-emerald-bright);
}

/* Modern Glass & Card Effects */
.glass-panel {
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.glass-panel:hover {
  border-color: var(--border-color-hover);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.7);
}

.glow-card {
  position: relative;
}

.glow-card::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, transparent 40%, rgba(16, 185, 129, 0.25) 100%);
  border-radius: inherit;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.glow-card:hover::after {
  opacity: 1;
}

/* Buttons */
.btn-primary {
  background: linear-gradient(135deg, var(--accent-emerald) 0%, #059669 100%);
  color: #ffffff;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 12px var(--accent-emerald-glow);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
  filter: brightness(1.1);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Terminal Mockup */
.terminal-window {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  background-color: #030712;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 40px -15px rgba(0,0,0,0.8);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.terminal-header {
  background-color: #090d16;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
}

.terminal-dots {
  display: flex;
  gap: 0.375rem;
}

.terminal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dot.red { background-color: #ef4444; }
.terminal-dot.yellow { background-color: #f59e0b; }
.terminal-dot.green { background-color: #10b981; }

.terminal-tabs {
  display: flex;
  background: #090d16;
  border-bottom: 1px solid var(--border-color);
  padding: 0 0.5rem;
}

.terminal-tab {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.terminal-tab.active {
  color: var(--accent-emerald-bright);
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.03);
}

.terminal-body {
  padding: 1.25rem;
  flex-grow: 1;
  overflow-y: auto;
  line-height: 1.5;
  color: #e2e8f0;
}

/* Syntax Highlight Colors */
.syntax-cmd { color: #f43f5e; }
.syntax-opt { color: #60a5fa; }
.syntax-str { color: #34d399; }
.syntax-key { color: #f472b6; }
.syntax-val { color: #a78bfa; }
.syntax-comment { color: #475569; }

/* Phone Mockup Frame */
.phone-mockup {
  width: 280px;
  height: 560px;
  background: #030712;
  border: 10px solid #1e293b;
  border-radius: 40px;
  position: relative;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.9),
    0 0 25px rgba(16, 185, 129, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.phone-screen {
  flex-grow: 1;
  background: #090d16;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 1rem;
}

.phone-notch {
  width: 110px;
  height: 20px;
  background: #1e293b;
  border-bottom-left-radius: 15px;
  border-bottom-right-radius: 15px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}

.phone-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.65rem;
  color: var(--text-secondary);
  font-weight: 600;
  padding-top: 0.5rem;
  z-index: 5;
}

.phone-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1rem;
  z-index: 5;
}

.phone-wallpaper-circle {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15) 0%, transparent 70%);
  top: 30%;
  left: 15%;
  z-index: 1;
}

.phone-lock-status {
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

.phone-time {
  font-size: 2.25rem;
  font-weight: 300;
  color: #fff;
  margin-bottom: 0.25rem;
}

.phone-date {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

/* SMS Notification Banner styling */
.sms-banner {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 0.75rem;
  width: 100%;
  position: absolute;
  top: -120px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: calc(100% - 20px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  z-index: 20;
  display: flex;
  flex-direction: column;
  transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.sms-banner.show {
  top: 3.5rem;
}

.sms-banner-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.65rem;
  color: var(--accent-emerald-bright);
  font-weight: bold;
  margin-bottom: 0.25rem;
}

.sms-banner-body {
  font-size: 0.75rem;
  color: #fff;
  line-height: 1.3;
}

/* Vibrating shake animation for phone mockup */
@keyframes shake {
  0%, 100% { transform: rotate(0deg) translate(0px, 0px); }
  10% { transform: rotate(1deg) translate(-1px, 1px); }
  20% { transform: rotate(-1deg) translate(1px, -1px); }
  30% { transform: rotate(1.5deg) translate(-2px, -1px); }
  40% { transform: rotate(-1.5deg) translate(2px, 2px); }
  50% { transform: rotate(1deg) translate(-1px, -1px); }
  60% { transform: rotate(-1deg) translate(1px, 1px); }
  70% { transform: rotate(0.5deg) translate(0px, -1px); }
  80% { transform: rotate(-0.5deg) translate(-1px, 0px); }
  90% { transform: rotate(0deg) translate(1px, 1px); }
}

.phone-shake {
  animation: shake 0.6s ease-in-out;
}

/* Custom Custom Slider for Threshold */
input[type="range"].custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: #1e293b;
  border-radius: 8px;
  outline: none;
}

input[type="range"].custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-emerald);
  cursor: pointer;
  box-shadow: 0 0 10px var(--accent-emerald);
  transition: transform 0.1s, background-color 0.1s;
}

input[type="range"].custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--accent-emerald-bright);
}

/* Pricing Card Glow Background */
.pricing-glow {
  position: relative;
  overflow: hidden;
}

.pricing-glow::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  pointer-events: none;
}

/* Sidebar Tab Indicators */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.875rem;
  color: var(--text-secondary);
  border-radius: 6px;
  transition: all 0.2s;
  cursor: pointer;
  user-select: none;
}

.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: rgba(16, 185, 129, 0.08);
  color: var(--accent-emerald-bright);
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Layout Routing states */
.view-state {
  display: none;
  animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-state.active {
  display: block;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.2s ease-in-out;
}

.tab-pane.active {
  display: block;
}

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

/* Grid backgrounds for auth */
.grid-bg-overlay {
  background-image: 
    radial-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* Clipboard Feedback Popup */
.copy-tooltip {
  position: absolute;
  bottom: 120%;
  left: 50%;
  transform: translateX(-50%) translateY(5px);
  background: #10b981;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.copy-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Animated sound wave indicators */
.wave-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  background-color: var(--accent-emerald);
  margin: 0 1px;
  border-radius: 2px;
  animation: bounce 0.6s ease-in-out infinite alternate;
}
.wave-bar:nth-child(2) { animation-delay: 0.1s; }
.wave-bar:nth-child(3) { animation-delay: 0.25s; }
.wave-bar:nth-child(4) { animation-delay: 0.15s; }

@keyframes bounce {
  from { transform: scaleY(1); }
  to { transform: scaleY(2.2); }
}

/* Key Regeneration Spin */
@keyframes spin-once {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.spin-animate {
  animation: spin-once 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
