/* DwellChecker Main Stylesheet
 * Common base styles extracted from inline styles
 * Used across all pages
 */

:root {
  --bg: #0b1220; /* deep navy */
  --panel: #0e1830;
  --card: #0f1729;
  --muted: #9fb0d0;
  --text: #eef3ff;
  --accent: #7aa2ff;
  --accent-2: #22d3ee;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #fb7185;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 16px;
  --maxw: 1200px;
  
  /* Additional variables for dashboard/account pages */
  --bg-card: #1a2332;
  --bg-input: #2a3441;
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  --border-color: #3a4553;
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: radial-gradient(1200px 800px at 10% -20%, rgba(34, 211, 238, 0.15), transparent 60%),
              radial-gradient(1000px 700px at 110% 10%, rgba(122, 162, 255, 0.12), transparent 60%),
              var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

/* Layout Utilities */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 20px;
}

/* Navigation */
.nav {
  position: sticky;
  top: 0;
  -webkit-backdrop-filter: saturate(150%) blur(8px);
  backdrop-filter: saturate(150%) blur(8px);
  background: rgba(11, 18, 32, 0.65);
  border-bottom: 1px solid var(--border);
  z-index: 40;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

.nav a:hover {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 18px;
  align-items: center;
}

/* Buttons and CTAs */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #0b1220;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: 0;
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s ease;
}

.cta:hover::before {
  left: 100%;
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(122, 162, 255, 0.3);
}

.cta:active {
  transform: translateY(0);
}

.cta.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #0b1220;
  font-weight: 800;
  padding: 14px 28px;
  font-size: 1.1rem;
}

.ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid rgba(122, 162, 255, 0.35);
}

/* Typography */
h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  margin: 16px 0 10px;
}

h2 {
  font-size: clamp(24px, 3.2vw, 34px);
  margin: 0 0 10px;
}

h3 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text);
}

.lead {
  color: var(--muted);
  max-width: 70ch;
  margin: 0 0 22px;
}

.sub {
  color: var(--muted);
  margin: 0 0 14px;
}

/* Cards and Panels */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: all 0.3s ease;
}

.card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.feature-card,
.pricing-card,
.testimonial {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out forwards;
  opacity: 0;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.feature-card:hover::before {
  opacity: 1;
}

.feature-card:hover,
.pricing-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Form Elements */
.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s ease;
}

.form-input:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(122, 162, 255, 0.1);
}

/* Buttons */
.btn {
  background: var(--accent);
  color: #0b1220;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(122, 162, 255, 0.3);
}

.btn.secondary {
  background: var(--panel);
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn.success {
  background: var(--success);
  color: #0b1220;
}

.btn.warning {
  background: var(--warning);
  color: #0b1220;
}

.btn.error {
  background: var(--error);
  color: white;
}

/* Sections */
.section {
  padding: 56px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 48px;
}

.section-header h2 {
  max-width: 600px;
  margin: 0 auto 16px;
}

.section-header .sub {
  max-width: 500px;
  margin: 0 auto;
}

/* Grid Layouts */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 32px;
  margin: 48px 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.pricing-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin: 40px 0;
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin: 48px 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--muted);
  font-size: 13px;
}

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

/* Utility Classes */
.text-center {
  text-align: center;
}

.text-muted {
  color: var(--muted);
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Animations */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-5px);
  }
  75% {
    transform: translateX(5px);
  }
}

/* Loading States */
.loading {
  position: relative;
  pointer-events: none;
  opacity: 0.6;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Focus States for Accessibility */
.cta:focus,
.btn:focus,
button:focus,
a:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
  .features-grid,
  .tools-grid,
  .pricing-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 14px;
  }

  .container {
    padding: 40px 15px;
  }

  h1 {
    font-size: 2.5rem;
    line-height: 1.2;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 40px 15px;
  }

  h1 {
    font-size: 2rem;
  }

  .section {
    padding: 40px 0 20px;
  }

  .feature-card,
  .pricing-card {
    padding: 24px;
  }

  h2 {
    font-size: 1.8rem;
  }
}

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

/* Global Alerts (from UIUtils.showAlert) */
.global-alert {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  max-width: 400px;
  word-wrap: break-word;
  animation: fadeInUp 0.3s ease-out;
}

.global-alert-success {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid #10b981;
  color: #10b981;
}

.global-alert-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid #ef4444;
  color: #ef4444;
}

.global-alert-warning {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid #f59e0b;
  color: #f59e0b;
}

.global-alert-info {
  background: rgba(122, 162, 255, 0.12);
  border: 1px solid #7aa2ff;
  color: #7aa2ff;
}

/* Mobile Navigation Toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 50;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--muted);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Skeleton Loading Utility */
.skeleton-shimmer {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.04) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}

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

/* Print Styles */
@media print {
  .nav,
  .cta,
  .btn,
  .global-alert {
    display: none;
  }
}

/* Mobile Navigation */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: rgba(11, 18, 32, 0.97);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    padding: 16px 20px;
    gap: 16px;
    border-bottom: 1px solid var(--border);
  }

  .nav-links.nav-open {
    display: flex;
  }

  .nav-inner {
    position: relative;
  }

  .nav-links a {
    font-size: 1rem;
    padding: 4px 0;
  }
}

