/* ============================================================
   CSS Color Toolkit — Stylesheet
   MSK Estudio Web · 2026
   ============================================================
   Dark-mode, glassmorphism, micro-animations.
   Parent site (Tailwind) owns header/footer; this file owns
   everything between them.
   ============================================================ */

/* ----------------------------------------------------------
   0. Custom Properties
   ---------------------------------------------------------- */
:root {
  /* Brand palette */
  --cian-futurista:    #00FFE8;
  --azul-electrico:    #0077FF;
  --violeta-tech:      #8A2EFF;
  --negro-profundo:    #0A0A0A;
  --gris-grafito:      #1E1E1E;
  --gris-claro:        #D9D9D9;
  --blanco-puro:       #FFFFFF;
  --verde-lima-neon:   #00FF88;

  /* Derived / utility */
  --surface-0:         #0A0A0A;
  --surface-1:         #111111;
  --surface-2:         #141414;
  --surface-3:         #1A1A1A;
  --surface-4:         #222222;
  --border-subtle:     #2A2A2A;
  --border-default:    #333333;
  --text-primary:      #FFFFFF;
  --text-secondary:    #B0B0B0;
  --text-muted:        #777777;
  --danger:            #FF4D6A;
  --success:           #00FF88;

  /* Gradients */
  --gradient-cian-azul:    linear-gradient(135deg, var(--cian-futurista), var(--azul-electrico));
  --gradient-azul-violeta: linear-gradient(135deg, var(--azul-electrico), var(--violeta-tech));
  --gradient-brand:        linear-gradient(135deg, var(--cian-futurista), var(--azul-electrico), var(--violeta-tech));

  /* Typography */
  --font-body:  'Montserrat', sans-serif;
  --font-mono:  'JetBrains Mono', monospace;

  /* Sizing */
  --header-h:   100px;
  --radius-sm:  8px;
  --radius-md:  12px;
  --radius-lg:  16px;
  --radius-pill: 9999px;

  /* Transitions */
  --ease-out:   cubic-bezier(0.22, 1, 0.36, 1);
  --t-fast:     0.15s;
  --t-normal:   0.25s;
  --t-slow:     0.35s;
}

/* ----------------------------------------------------------
   1. Base / Reset (scoped)
   ---------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

::selection {
  background: var(--cian-futurista);
  color: var(--negro-profundo);
}

/* Webkit scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: var(--surface-0);
}
::-webkit-scrollbar-thumb {
  background: var(--border-default);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* Focus ring — accessible */
:focus-visible {
  outline: 2px solid var(--cian-futurista);
  outline-offset: 2px;
}

/* ----------------------------------------------------------
   2. Keyframe Animations
   ---------------------------------------------------------- */
@keyframes gradient-shift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

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

@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(0, 255, 232, 0.25); }
  50%      { box-shadow: 0 0 20px rgba(0, 255, 232, 0.45); }
}

/* ----------------------------------------------------------
   3. Layout & Structure
   ---------------------------------------------------------- */
.tool-main {
  padding-top: var(--header-h);
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding-left: 16px;
  padding-right: 16px;
  padding-bottom: 64px;
  animation: fadeInUp 0.5s var(--ease-out) both;
}

/* ----------------------------------------------------------
   4. Breadcrumb
   ---------------------------------------------------------- */
.breadcrumb {
  padding: 16px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb li + li::before {
  content: '>';
  margin: 0 8px;
  color: var(--border-default);
  font-size: 0.7rem;
}

.breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--t-fast) ease;
}

.breadcrumb a:hover {
  color: var(--cian-futurista);
}

.breadcrumb li:last-child {
  color: var(--text-secondary);
}

/* ----------------------------------------------------------
   5. Hero Section
   ---------------------------------------------------------- */
.tool-hero {
  text-align: center;
  padding: 48px 0 40px;
}

.tool-hero-badge {
  display: inline-block;
  background: var(--gradient-brand);
  color: var(--negro-profundo);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 16px;
  border-radius: var(--radius-pill);
  margin-bottom: 20px;
}

.tool-hero h1 {
  font-family: var(--font-body);
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.15;
  margin: 0 0 16px;
}

.gradient-text {
  background: var(--gradient-brand);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
}

.tool-hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ----------------------------------------------------------
   6. Tool Container & Content Wrapper
   ---------------------------------------------------------- */
.tool-container {
  max-width: 1400px;
  margin: 0 auto;
}

.tool-content-wrapper {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.tool-panels {
  flex: 1;
  min-width: 0;
}

/* ----------------------------------------------------------
   7. Tabs
   ---------------------------------------------------------- */
.tool-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: rgba(30, 30, 30, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  margin-bottom: 24px;
  overflow-x: auto;
}

.tool-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 80px;
  padding: 12px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    color var(--t-normal) ease,
    background var(--t-normal) ease,
    box-shadow var(--t-normal) ease;
}

.tool-tab i {
  font-size: 1.15rem;
  transition: transform var(--t-normal) var(--ease-out);
}

.tool-tab span {
  white-space: nowrap;
}

.tool-tab:hover:not(.active) {
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
}

.tool-tab.active {
  background: var(--gradient-cian-azul);
  color: var(--negro-profundo);
  box-shadow:
    0 0 16px rgba(0, 255, 232, 0.25),
    0 2px 8px rgba(0, 119, 255, 0.2);
}

.tool-tab.active i {
  transform: scale(1.1);
}

/* ----------------------------------------------------------
   8. Tool Panels
   ---------------------------------------------------------- */
.tool-panel {
  display: none;
  animation: fadeInUp 0.35s var(--ease-out) both;
}

.tool-panel.active {
  display: block;
}

.tool-panel[hidden] {
  display: none !important;
}

/* ----------------------------------------------------------
   9. AdSense Slots
   ---------------------------------------------------------- */
.adsense-slot {
  min-height: 90px;
  background: var(--surface-1);
  border: 1px dashed var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.adsense-banner {
  width: 100%;
  margin: 24px 0;
}

.adsense-sidebar {
  display: none; /* hidden on mobile */
}

.adsense-slot-sidebar {
  min-height: 250px;
}

/* ----------------------------------------------------------
   10. Gradient Tool
   ---------------------------------------------------------- */
.gradient-tool {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.gradient-preview-container {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.gradient-preview {
  width: 100%;
  min-height: 200px;
  border-radius: var(--radius-lg);
  transition: background var(--t-slow) ease;
}

.gradient-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.gradient-size-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.6);
  font-family: var(--font-mono);
}

.gradient-controls {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ----------------------------------------------------------
   11. Control Components (shared)
   ---------------------------------------------------------- */
.control-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.control-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Button Group */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-1);
}

.btn-option {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition:
    background var(--t-fast) ease,
    color var(--t-fast) ease,
    box-shadow var(--t-fast) ease;
}

.btn-option.active {
  background: var(--gradient-cian-azul);
  color: var(--negro-profundo);
  font-weight: 600;
  box-shadow: 0 2px 10px rgba(0, 255, 232, 0.2);
}

.btn-option:hover:not(.active) {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

/* Primary Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--gradient-cian-azul);
  color: var(--negro-profundo);
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-normal) ease;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow:
    0 0 20px rgba(0, 255, 232, 0.3),
    0 4px 16px rgba(0, 119, 255, 0.25);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary kbd {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}

/* Secondary Button */
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color var(--t-fast) ease,
    color var(--t-fast) ease;
}

.btn-secondary:hover {
  border-color: var(--cian-futurista);
  color: var(--cian-futurista);
}

/* Copy Button */
.btn-copy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  cursor: pointer;
  transition:
    border-color var(--t-fast) ease,
    color var(--t-fast) ease,
    background var(--t-fast) ease;
}

.btn-copy:hover {
  border-color: var(--cian-futurista);
  color: var(--cian-futurista);
}

.btn-copy.copied {
  border-color: var(--verde-lima-neon);
  color: var(--verde-lima-neon);
  background: rgba(0, 255, 136, 0.08);
}

/* Swap Button */
.btn-swap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  transition:
    transform var(--t-normal) var(--ease-out),
    border-color var(--t-fast) ease,
    color var(--t-fast) ease;
  flex-shrink: 0;
}

.btn-swap:hover {
  transform: rotate(180deg);
  border-color: var(--cian-futurista);
  color: var(--cian-futurista);
}

/* ----------------------------------------------------------
   12. Angle Control
   ---------------------------------------------------------- */
.angle-control-wrapper {
  display: flex;
  align-items: center;
  gap: 16px;
}

.angle-wheel {
  width: 60px;
  height: 60px;
  border: 2px solid var(--border-default);
  border-radius: 50%;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color var(--t-fast) ease;
  background: var(--surface-1);
}

.angle-wheel:hover {
  border-color: var(--text-muted);
}

.angle-indicator {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--cian-futurista);
  border-radius: 50%;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 6px var(--cian-futurista);
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: var(--surface-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  background: var(--cian-futurista);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 255, 232, 0.15);
  transition:
    box-shadow var(--t-fast) ease,
    transform var(--t-fast) ease;
}

.range-slider::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(0, 255, 232, 0.2);
  transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  background: var(--cian-futurista);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 0 3px rgba(0, 255, 232, 0.15);
}

.range-slider::-moz-range-thumb:hover {
  box-shadow: 0 0 0 6px rgba(0, 255, 232, 0.2);
}

.range-slider::-moz-range-track {
  height: 4px;
  background: var(--surface-4);
  border-radius: 2px;
  border: none;
}

/* ----------------------------------------------------------
   13. Color Stops
   ---------------------------------------------------------- */
.color-stops-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.color-stop-item {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-3);
  border-radius: 10px;
  border: 1px solid transparent;
  transition: border-color var(--t-fast) ease;
}

.color-stop-item:hover {
  border-color: var(--border-subtle);
}

/* Color Picker Input */
.color-picker-input {
  -webkit-appearance: none;
  appearance: none;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 2px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: transparent;
  overflow: hidden;
  flex-shrink: 0;
  transition: border-color var(--t-fast) ease;
}

.color-picker-input:hover {
  border-color: var(--text-muted);
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: none;
  border-radius: 5px;
}

.color-picker-input::-moz-color-swatch {
  border: none;
  border-radius: 5px;
}

.color-picker-input.large {
  width: 56px;
  height: 56px;
  border-radius: 10px;
}

.color-picker-input.large::-webkit-color-swatch {
  border-radius: 7px;
}

/* Hex Input */
.hex-input {
  padding: 8px 12px;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  outline: none;
  width: 110px;
  transition:
    border-color var(--t-fast) ease,
    box-shadow var(--t-fast) ease;
}

.hex-input:focus {
  border-color: var(--cian-futurista);
  box-shadow: 0 0 0 3px rgba(0, 255, 232, 0.1);
}

.hex-input.large {
  padding: 12px 16px;
  font-size: 1rem;
  width: 140px;
}

/* Stop position slider */
.color-stop-position {
  -webkit-appearance: none;
  appearance: none;
  width: 80px;
  height: 4px;
  background: var(--surface-4);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.color-stop-position::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  background: var(--cian-futurista);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.color-stop-position::-moz-range-thumb {
  width: 12px;
  height: 12px;
  background: var(--cian-futurista);
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.color-stop-position::-moz-range-track {
  height: 4px;
  background: var(--surface-4);
  border-radius: 2px;
  border: none;
}

/* Remove stop button */
.btn-remove-stop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-default);
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background var(--t-fast) ease,
    border-color var(--t-fast) ease,
    color var(--t-fast) ease;
}

.btn-remove-stop:hover {
  background: rgba(255, 77, 106, 0.12);
  border-color: var(--danger);
  color: var(--danger);
}

/* ----------------------------------------------------------
   14. Preset Grid
   ---------------------------------------------------------- */
.preset-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.preset-item {
  height: 48px;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition:
    border-color var(--t-fast) ease,
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) ease;
}

.preset-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.04);
}

.preset-item.active {
  border-color: var(--cian-futurista);
  box-shadow: 0 0 12px rgba(0, 255, 232, 0.25);
}

/* ----------------------------------------------------------
   15. CSS Output
   ---------------------------------------------------------- */
.css-output-container {
  background: var(--surface-1);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: 20px;
}

.css-output-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--surface-4);
}

.css-output-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.css-output-code {
  padding: 16px;
  margin: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-primary);
  white-space: pre;
  tab-size: 2;
}

.css-output-code .property {
  color: var(--gris-claro);
}

.css-output-code .value {
  color: var(--cian-futurista);
}

/* ----------------------------------------------------------
   16. Palette Tool
   ---------------------------------------------------------- */
.palette-tool {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.palette-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.palette-display {
  display: flex;
  min-height: 120px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}

.palette-swatch {
  flex: 1;
  position: relative;
  cursor: pointer;
  transition: background-color var(--t-normal) ease;
  min-width: 0;
}

.palette-swatch-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity var(--t-fast) ease;
}

.palette-swatch:hover .palette-swatch-overlay {
  opacity: 1;
}

.palette-swatch-hex {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
  color: var(--blanco-puro);
}

.palette-swatch-actions {
  display: flex;
  gap: 6px;
}

.palette-swatch.locked {
  position: relative;
}

.palette-swatch.locked::after {
  content: '\f023'; /* lock icon — Font Awesome */
  font-family: 'Font Awesome 6 Free', 'Font Awesome 5 Free', sans-serif;
  font-weight: 900;
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.palette-export {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

/* ----------------------------------------------------------
   17. Contrast Checker
   ---------------------------------------------------------- */
.contrast-tool {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.contrast-inputs {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.contrast-color-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.color-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.contrast-preview {
  padding: 32px;
  border-radius: var(--radius-lg);
  min-height: 150px;
  transition:
    background-color var(--t-normal) ease,
    color var(--t-normal) ease;
  border: 1px solid var(--border-subtle);
}

.contrast-preview-heading {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 12px;
}

.contrast-preview-body {
  font-size: 16px;
  margin: 0 0 8px;
  line-height: 1.5;
}

.contrast-preview-small {
  font-size: 12px;
  margin: 0;
  opacity: 0.85;
}

.contrast-results {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.contrast-ratio-display {
  text-align: center;
  padding: 16px 0;
}

.contrast-ratio-number {
  font-size: 3rem;
  font-weight: 800;
  background: var(--gradient-brand);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 4s ease infinite;
  line-height: 1.1;
}

.contrast-ratio-label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.contrast-grades {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.contrast-grade {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--border-default);
}

.contrast-grade.pass-grade {
  border-left-color: var(--verde-lima-neon);
}

.contrast-grade.fail-grade {
  border-left-color: var(--danger);
}

.grade-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

.grade-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  width: fit-content;
}

.grade-badge.pass {
  background: rgba(0, 255, 136, 0.15);
  color: var(--verde-lima-neon);
}

.grade-badge.fail {
  background: rgba(255, 77, 106, 0.15);
  color: var(--danger);
}

.grade-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* Suggestions */
.contrast-suggestions {
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
  margin-top: 4px;
}

.contrast-suggestions h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.suggestions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.suggestion-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background var(--t-fast) ease;
}

.suggestion-item:hover {
  background: var(--surface-3);
}

.suggestion-item .swatch {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ----------------------------------------------------------
   18. Converter Tool
   ---------------------------------------------------------- */
.converter-tool {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.converter-input-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.converter-preview-swatch {
  width: 100%;
  height: 80px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-default);
  transition:
    background-color var(--t-normal) ease,
    border-color var(--t-fast) ease;
}

.converter-preview-swatch:hover {
  border-color: var(--text-muted);
}

.converter-main-input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.converter-outputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.converter-format {
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  transition: border-color var(--t-fast) ease;
}

.converter-format:hover {
  border-color: var(--border-default);
}

.converter-format label {
  display: block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.converter-value-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.converter-format code {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--cian-futurista);
  word-break: break-all;
}

.btn-copy-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-default);
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  flex-shrink: 0;
  transition:
    border-color var(--t-fast) ease,
    color var(--t-fast) ease,
    background var(--t-fast) ease;
}

.btn-copy-small:hover {
  border-color: var(--cian-futurista);
  color: var(--cian-futurista);
}

.btn-copy-small.copied {
  border-color: var(--verde-lima-neon);
  color: var(--verde-lima-neon);
  background: rgba(0, 255, 136, 0.08);
}

/* ----------------------------------------------------------
   19. FAQ Section
   ---------------------------------------------------------- */
.faq-section {
  max-width: 900px;
  margin: 48px auto 0;
  padding: 0 16px;
}

.faq-title {
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 32px;
  position: relative;
  padding-bottom: 12px;
}

.faq-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--gradient-cian-azul);
  border-radius: 2px;
}

.faq-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.faq-item {
  background: var(--surface-2);
  border: 1px solid var(--surface-4);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--t-normal) ease;
}

.faq-item[open] {
  border-color: rgba(0, 255, 232, 0.25);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  list-style: none;
  transition: color var(--t-fast) ease;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-question:hover {
  color: var(--cian-futurista);
}

.faq-question .faq-icon {
  transition: transform var(--t-normal) var(--ease-out);
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.faq-item[open] .faq-icon {
  transform: rotate(180deg);
}

.faq-answer {
  padding: 0 20px 20px;
  color: var(--gris-claro);
  font-size: 0.9rem;
  line-height: 1.7;
}

.faq-answer code {
  background: var(--surface-3);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
}

/* ----------------------------------------------------------
   20. CTA Section
   ---------------------------------------------------------- */
.cta-section {
  width: 100%;
  background: linear-gradient(180deg, var(--gris-grafito), var(--negro-profundo));
  padding: 56px 16px;
  margin-top: 56px;
  border-top: 1px solid var(--border-subtle);
}

.cta-content {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.cta-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 12px;
}

.cta-content p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin: 0 0 28px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.btn-cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gradient-cian-azul);
  color: var(--negro-profundo);
  padding: 14px 32px;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-normal) ease;
}

.btn-cta-primary:hover {
  transform: scale(1.04);
  box-shadow:
    0 0 24px rgba(0, 255, 232, 0.3),
    0 4px 20px rgba(0, 119, 255, 0.25);
}

.btn-cta-primary:active {
  transform: scale(0.98);
}

.btn-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  border: 2px solid var(--cian-futurista);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--cian-futurista);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--t-fast) ease,
    color var(--t-fast) ease;
}

.btn-cta-secondary:hover {
  background: var(--cian-futurista);
  color: var(--negro-profundo);
}

/* ----------------------------------------------------------
   21. Toast Notification
   ---------------------------------------------------------- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(120px);
  background: var(--gris-grafito);
  border: 1px solid var(--cian-futurista);
  border-radius: var(--radius-md);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 9999;
  opacity: 0;
  transition:
    transform var(--t-normal) var(--ease-out),
    opacity var(--t-normal) ease;
  box-shadow:
    0 0 16px rgba(0, 255, 232, 0.15),
    0 8px 32px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast i {
  color: var(--verde-lima-neon);
  font-size: 1rem;
}

/* ----------------------------------------------------------
   22. Responsive — sm (640px)
   ---------------------------------------------------------- */
@media (min-width: 640px) {
  .tool-hero h1 {
    font-size: 2.5rem;
  }

  .contrast-inputs {
    flex-direction: row;
    align-items: flex-end;
  }

  .converter-input-area {
    flex-direction: row;
    align-items: stretch;
  }

  .converter-preview-swatch {
    width: 120px;
    height: auto;
    min-height: 80px;
  }

  .converter-outputs {
    grid-template-columns: repeat(2, 1fr);
  }

  .preset-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .contrast-ratio-number {
    font-size: 4rem;
  }
}

/* ----------------------------------------------------------
   23. Responsive — md (768px)
   ---------------------------------------------------------- */
@media (min-width: 768px) {
  .tool-main {
    padding-left: 24px;
    padding-right: 24px;
  }

  .tool-hero h1 {
    font-size: 2.75rem;
  }

  .tool-hero-subtitle {
    font-size: 1.1rem;
  }

  .gradient-tool {
    grid-template-columns: 1fr 1fr;
  }

  .gradient-preview {
    min-height: 300px;
  }

  .palette-display {
    min-height: 200px;
  }

  .contrast-preview {
    min-height: 180px;
  }

  .contrast-results {
    flex-direction: row;
    align-items: flex-start;
  }

  .contrast-ratio-display {
    flex-shrink: 0;
    min-width: 160px;
  }

  .contrast-grades {
    flex: 1;
  }

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

/* ----------------------------------------------------------
   24. Responsive — lg (1024px)
   ---------------------------------------------------------- */
@media (min-width: 1024px) {
  .tool-main {
    padding-left: 32px;
    padding-right: 32px;
  }

  .tool-hero h1 {
    font-size: 3rem;
  }

  .tool-content-wrapper {
    flex-direction: row;
  }

  /* Sidebar visible */
  .adsense-sidebar {
    display: block;
    width: 300px;
    flex-shrink: 0;
    position: sticky;
    top: var(--header-h);
    align-self: flex-start;
  }

  .preset-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .converter-outputs {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ----------------------------------------------------------
   25. Responsive — xl (1280px)
   ---------------------------------------------------------- */
@media (min-width: 1280px) {
  .tool-main {
    padding-left: 40px;
    padding-right: 40px;
  }

  .cta-content h2 {
    font-size: 2rem;
  }
}

/* ----------------------------------------------------------
   26. Utility / Accessibility
   ---------------------------------------------------------- */

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print — strip decorative styling */
@media print {
  .tool-tabs,
  .adsense-slot,
  .adsense-banner,
  .adsense-sidebar,
  .toast,
  .cta-section {
    display: none !important;
  }

  .tool-panel {
    display: block !important;
  }

  .gradient-preview,
  .palette-display,
  .contrast-preview {
    border: 1px solid #ccc;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
