/* 
  Pro Case Converter
  Dark-first, responsive, sticky header UI
*/

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Theme variables */
:root {
  --bg: #050609;
  --bg-elevated: #101320;
  --bg-elevated-soft: #151827;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --accent: #3c8cff;
  --accent-soft: rgba(60, 140, 255, 0.15);
  --accent-strong: #5aa1ff;
  --text-main: #f5f7fb;
  --text-muted: #aeb4c7;
  --danger: #ff5c7a;
  --shadow-soft: 0 18px 40px rgba(3, 5, 14, 0.85);
  --panel-radius: 1.25rem;
}

[data-theme="light"] {
  --bg: #f6f7fb;
  --bg-elevated: #ffffff;
  --bg-elevated-soft: #ffffff;
  --border-subtle: rgba(15, 23, 42, 0.1);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.12);
  --accent-strong: #1d4ed8;
  --text-main: #0f172a;
  --text-muted: #6b7280;
  --danger: #b91c1c;
  --shadow-soft: 0 18px 40px rgba(15, 23, 42, 0.18);
}

/* Layout helpers */
body {
  background-color: var(--bg);
  color: var(--text-main);
}

.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(to bottom, rgba(5, 6, 9, 0.96), rgba(5, 6, 9, 0.92));
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .site-header {
  background: linear-gradient(to bottom, rgba(246, 247, 251, 0.98), rgba(246, 247, 251, 0.96));
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.4rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.35), 0 8px 18px rgba(15, 23, 42, 0.9);
  background: radial-gradient(circle at 30% 20%, #1f2937, #020617);
}

[data-theme="light"] .brand-logo {
  box-shadow: 0 0 0 1px rgba(148, 163, 184, 0.45), 0 8px 18px rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at 30% 20%, #ffffff, #e5e7eb);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-tagline {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mode-indicator {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at top left, rgba(148, 163, 184, 0.12), rgba(15, 23, 42, 0.98));
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.mode-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.mode-value {
  font-size: 0.78rem;
  font-weight: 500;
}

/* Theme toggle */
.theme-toggle {
  position: relative;
  width: 60px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border-subtle);
  background: radial-gradient(circle at 20% 20%, rgba(148, 163, 184, 0.16), rgba(15, 23, 42, 0.98));
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  cursor: pointer;
  color: #fbbf24;
  box-shadow: 0 12px 25px rgba(15, 23, 42, 0.65);
}

.theme-icon {
  font-size: 0.95rem;
  opacity: 0.45;
  transition: opacity 0.18s ease-out, transform 0.18s ease-out;
}

[data-theme="dark"] .theme-icon-dark {
  opacity: 1;
  transform: translateX(1px);
}

[data-theme="dark"] .theme-icon-light {
  opacity: 0.35;
}

[data-theme="light"] .theme-icon-dark {
  opacity: 0.25;
}

[data-theme="light"] .theme-icon-light {
  opacity: 1;
  transform: translateX(-1px);
}

/* Hero */
.hero {
  padding: 0.8rem;
}

.hero h1 {
  font-size: clamp(1.9rem, 3vw, 2.4rem);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.hero-subtitle {
  max-width: 640px;
  font-size: 0.98rem;
  color: var(--text-muted);
}

/* Tool section */
.tool-section {
  padding: 0.6rem 0 2.6rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1.4fr);
  gap: 1.5rem;
  align-items: flex-start;
}

/* Controls panel */
.tool-controls {
  background: radial-gradient(circle at top left, rgba(60, 140, 255, 0.14), rgba(15, 23, 42, 0.98));
  border-radius: var(--panel-radius);
  padding: 1.1rem 1.1rem 1.2rem;
  border: 1px solid rgba(148, 163, 184, 0.32);
  box-shadow: var(--shadow-soft);
}

[data-theme="light"] .tool-controls {
  background: radial-gradient(circle at top left, rgba(191, 219, 254, 0.32), #ffffff);
  border-color: rgba(148, 163, 184, 0.5);
}

.button-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 1rem;
}

/* Buttons */
.btn,
.btn-primary,
.btn-outline,
.btn-ghost {
  font-size: 0.84rem;
  font-weight: 500;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-main);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: background-color 0.15s ease-out, border-color 0.15s ease-out, transform 0.1s ease-out, box-shadow 0.15s ease-out;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  border-color: rgba(148, 163, 184, 0.25);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.5);
}

.btn {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.4);
}

[data-theme="light"] .btn {
  background: rgba(248, 250, 252, 0.95);
  border-color: rgba(148, 163, 184, 0.55);
}

.btn:hover,
.btn-primary:hover,
.btn-outline:hover,
.btn-ghost:hover {
  transform: translateY(-1px);
}

.btn-primary:hover {
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.6);
}

.btn:hover {
  background: rgba(30, 64, 175, 0.8);
  border-color: rgba(191, 219, 254, 0.8);
}

[data-theme="light"] .btn:hover {
  background: rgba(219, 234, 254, 0.95);
  border-color: rgba(129, 140, 248, 0.9);
}

.btn-ghost {
  background: transparent;
  border-color: rgba(148, 163, 184, 0.5);
  color: var(--text-muted);
}

.btn-outline {
  background: rgba(15, 23, 42, 0.8);
  border-color: rgba(148, 163, 184, 0.5);
}

[data-theme="light"] .btn-outline {
  background: #ffffff;
}

.btn.is-active {
  background: var(--accent-soft);
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

/* Meta info */
.tool-meta {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.counter {
  flex: 1;
  padding: 0.5rem 0.65rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.98));
  display: flex;
  flex-direction: column;
}

[data-theme="light"] .counter {
  background: #ffffff;
}

.counter span:first-child {
  font-weight: 600;
  font-size: 0.98rem;
}

.counter-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Actions */
.tool-actions {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.helper-text {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Panels */
.tool-panels {
  display: grid;
  grid-template-rows: minmax(190px, 1fr) minmax(190px, 1fr);
  gap: 1rem;
}

.panel {
  background: var(--bg-elevated);
  border-radius: var(--panel-radius);
  padding: 0.75rem 0.75rem 0.85rem;
  border: 1px solid var(--border-subtle);
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

[data-theme="light"] .panel {
  background: var(--bg-elevated);
}

.panel-label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.panel-textarea {
  resize: vertical;
  width: 100%;
  flex: 1 1 auto;
  min-height: 160px;
  border-radius: 0.9rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.7rem 0.8rem;
  font: inherit;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-main);
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.99));
  outline: none;
}

[data-theme="light"] .panel-textarea {
  background: #f9fafb;
}

.panel-textarea::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

.panel-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.4);
}

.panel-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
}

/* SEO copy and FAQ */
.seo-copy {
  padding: 1.8rem 0 2.5rem;
  border-top: 1px solid var(--border-subtle);
}

.seo-copy h2 {
  font-size: 1.2rem;
  margin-bottom: 1.1rem;
}

.seo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.seo-card {
  background: var(--bg-elevated-soft);
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .seo-card {
  background: #ffffff;
}

.seo-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
}

.seo-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.faq-block h2 {
  font-size: 1.1rem;
  margin-bottom: 0.9rem;
}

.faq-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.faq-item {
  background: var(--bg-elevated-soft);
  border-radius: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-subtle);
}

[data-theme="light"] .faq-item {
  background: #ffffff;
}

.faq-item h3 {
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.faq-item p {
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 1.1rem 0 1.6rem;
  background: radial-gradient(circle at top, rgba(15, 23, 42, 0.96), rgba(5, 6, 9, 1));
}

[data-theme="light"] .site-footer {
  background: #f3f4f6;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-meta {
  font-size: 0.78rem;
}

/* Visually hidden */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 960px) {
  .tool-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .tool-controls {
    order: -1;
  }

  .tool-panels {
    grid-template-rows: none;
  }
}

@media (max-width: 720px) {
  .header-inner {
    padding-inline: 0;
  }

  .brand-name {
    font-size: 0.95rem;
  }

  .brand-tagline {
    display: none;
  }

  .mode-indicator {
    display: none;
  }

  .tool-controls {
    padding: 0.9rem;
  }

  .button-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-actions {
    flex-direction: column;
  }

  .seo-grid,
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .panel-textarea {
    min-height: 140px;
  }

  .hero {
    padding-top: 1.6rem;
  }
}
