:root {
  --primary-color: #6c5ce7;
  --primary-hover: #5649d1;
  --secondary-color: #a29bfe;
  --accent-color: #00cec9;
  --background: #f0f4f8;
  --surface: #ffffff;
  --text: #2c3e50;
  --text-muted: #7f8c8d;
  --border: rgba(0, 0, 0, 0.08);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
  --success: #10B981;
  --error: #EF4444;
  --warning: #F59E0B;
  --side-nav-width: 260px;
  --header-height: 70px;
}


body.dark-mode {
  --primary-color: #8b0000;
  --primary-hover: #a00000;
  --secondary-color: #8b0000;
  --accent-color: #8b0000;
  --background: #000000;
  --surface: #121212;
  --text: #ffffff;
  --text-muted: #cccccc;
  --border: rgba(255, 255, 255, 0.08);
  --shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 15px 35px rgba(0, 0, 0, 0.5);
  --success: #8b0000;
  --error: #8b0000;
  --warning: #8b0000;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--background);
  color: var(--text);
  transition: background 0.3s, color 0.3s;
  overflow-x: hidden;
  user-select: none;
}

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: var(--side-nav-width);
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  transition: transform 0.3s;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo i {
  font-size: 2rem;
}

.sidebar-nav {
  padding: 1rem 0;
}

.nav-section-title {
  padding: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 1rem;
}

.nav-section-title:first-child {
  margin-top: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.5rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  margin: 0.25rem 0.5rem;
  border-radius: 10px;
}

.nav-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
  z-index: -1;
  border-radius: 10px;
}

.nav-link:hover::before,
.nav-link.active::before {
  width: 100%;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  transform: translateX(5px);
}

.nav-link i {
  font-size: 1.25rem;
  width: 24px;
  transition: transform 0.3s ease;
}

.nav-link:hover i {
  transform: scale(1.1);
}

.main-content {
  margin-left: var(--side-nav-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s;
}

.header {
  position: sticky;
  top: 0;
  height: var(--header-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 50;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
}

.menu-toggle:hover {
  background: var(--border);
  color: var(--primary-color);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
}

.theme-toggle:hover {
  background: var(--primary-color);
  color: white;
  transform: scale(1.05);
}

.content-wrapper {
  flex: 1;
  position: relative;
}

.page {
  display: none;
}

.page.active {
  display: block;
  animation: fadeIn 0.4s ease-in-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.hero-banner {
  text-align: center;
  padding: 3rem 1rem;
  margin-bottom: 3rem;
}

.hero-description {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.feature-card {
  background: var(--surface);
  padding: 2rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: all 0.3s;
  text-align: center;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2.5rem;
}

.feature-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.feature-card p {
  color: var(--text-muted);
  line-height: 1.6;
}

.stats-section {
  margin-top: 4rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  color: white;
}

.stat-icon.blue { background: linear-gradient(135deg, #3b82f6, #60a5fa); }
.stat-icon.green { background: linear-gradient(135deg, #10b981, #34d399); }
.stat-icon.purple { background: linear-gradient(135deg, #8b5cf6, #a78bfa); }

.stat-info h4 {
  font-size: 0.9rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
}

.card {
  background: var(--surface);
  border-radius: 24px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: 2rem;
}

.card-header {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
  position: relative;
  z-index: 1;
}

.icon-wrapper {
  width: 70px;
  height: 70px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: white;
}

.header-text h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: white;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.9);
}

.card-body {
  padding: 2rem;
}

.form-section {
  margin-bottom: 1.5rem;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}

.form-label i {
  color: var(--primary-color);
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: all 0.3s;
}

.input-wrapper:focus-within {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
  transform: translateY(-2px);
}

body.dark-mode .input-wrapper:focus-within {
  box-shadow: 0 0 0 4px rgba(139, 0, 0, 0.15);
}

.input-prefix {
  background: var(--background);
  padding: 1rem 1.25rem;
  font-weight: 600;
  color: var(--text-muted);
  border-right: 2px solid var(--border);
}

.form-input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: none;
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  font-family: 'Outfit', sans-serif;
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

.form-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.btn-generate {
  width: 100%;
  padding: 1.25rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  font-family: 'Outfit', sans-serif;
}

.btn-generate:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(220, 38, 38, 0.3);
}

body.dark-mode .btn-generate:hover:not(:disabled) {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.btn-generate:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.btn-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.code-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: var(--background);
  border-radius: 16px;
  border: 1px solid var(--border);
}

.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--success);
  color: white;
  padding: 0.6rem 1.25rem;
  border-radius: 25px;
  font-size: 0.9rem;
  font-weight: 600;
}

.timer-wrapper {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  padding: 0.6rem 1.25rem;
  border-radius: 25px;
  font-weight: 700;
  font-family: 'Courier New', monospace;
  border: 2px solid var(--border);
}

.timer.warning { color: var(--warning); }
.timer.danger { color: var(--error); }

.code-display {
  background: var(--surface);
  padding: 2rem;
  border-radius: 14px;
  margin-bottom: 1.25rem;
  text-align: center;
  border: 2px dashed var(--primary-color);
  position: relative;
}

.code-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.code-value {
  font-size: 2.75rem;
  font-weight: 800;
  color: var(--primary-color);
  letter-spacing: 6px;
  font-family: 'Courier New', monospace;
  user-select: all;
}

.btn-copy {
  width: 100%;
  padding: 1rem;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  font-family: 'Outfit', sans-serif;
}

.btn-copy:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.btn-copy.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.instructions {
  padding-top: 1.5rem;
  border-top: 2px solid var(--border);
}

.instructions h3 {
  font-size: 1.1rem;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.steps-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.steps-list li {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--surface);
  border-radius: 12px;
  border: 1px solid var(--border);
}

.step-number {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  flex-shrink: 0;
}

.step-text strong {
  color: var(--primary-color);
}

.error-message {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: 12px;
  color: var(--error);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.page-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}


.footer {
  margin-top: auto;
  padding: 2rem;
  background: transparent;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer-content p {
  color: var(--text-muted);
  margin: 0.5rem 0;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}

.overlay.active {
  display: block;
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .menu-toggle {
    display: flex;
  }

  .container {
    padding: 1rem;
  }

  .gradient-text {
    font-size: 2rem;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-hover);
}

/* EFECTOS MODO OSCURO - SIN NEÓN */
body.dark-mode .card {
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5);
}

body.dark-mode .feature-icon,
body.dark-mode .stat-icon {
  box-shadow: none;
}

body.dark-mode .nav-link.active {
  box-shadow: none;
}

body.dark-mode .code-display {
  border-color: var(--primary-color);
  background: #0a0a0a;
}

body.dark-mode .status-badge {
  background: var(--primary-color);
  box-shadow: none;
}

body.dark-mode .sidebar {
  background: #121212;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.dark-mode .header {
  background: #121212;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}