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

/* Root Variables - Dark Theme */
:root {
  --primary-gradient: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
  --primary-color: #32cd32;
  --primary-dark: #28a428;
  --secondary-color: #14b8a6;
  --secondary-dark: #0d9488;
  --accent-color: #32cd32;
  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #9ca3af;
  --bg-primary: #1a1a1a;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #262626;
  --border-color: #666666;
  --border-focus: #32cd32;
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 12px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 30px rgb(0 0 0 / 0.3);
  --shadow-xl: 0 20px 40px rgb(0 0 0 / 0.4);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  /* Fluid gutters — one source; site-layout may override header padding */
  --layout-page-inline: clamp(0.75rem, 3.5vw, 2rem);
  --layout-page-block: clamp(1rem, 2.5vw, 2.5rem);
  --layout-max-width-content: 1100px;
  --touch-target-min: 44px;
}

/* Breakpoints used across the project: sm 480px · md 768px · lg 1024px */

/* Sticky footer: html + body fill the viewport so the flex column can distribute height */
html {
  min-height: 100%;
  min-height: 100dvh;
}

/* Base Styles */
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-secondary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* Primary content fills space between header and footer (see also #main-content for legacy div shells) */
body > main,
body > #main-content {
  flex: 1 1 0;
  min-width: 0;
}

/* Header */
.header {
  background: #1a1a1a;
  border-bottom: 1px solid #666666;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem var(--layout-page-inline);
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 64px;
  gap: clamp(0.75rem, 2vw, 2rem);
}

.logo-section {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  height: 100%;
  min-height: 45px;
}

.logo {
  width: 45px;
  height: 45px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  height: 100%;
  min-height: 45px;
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.1;
}

.brand-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-weight: 500;
  line-height: 1.1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  height: 100%;
  min-height: 45px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  height: 100%;
  min-height: 45px;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  line-height: 1;
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.btn-primary {
  background: #32cd32;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: "Poppins", sans-serif;
  line-height: 1;
}

.btn-primary:hover {
  opacity: 0.9;
}

/* User Avatar */
.user-avatar {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.125rem;
  font-weight: 700;
  cursor: pointer;
  border: 3px solid #000;
  transition: all 0.3s ease;
  position: relative;
  text-transform: uppercase;
}

.user-avatar:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(50, 205, 50, 0.3);
}

/* User Profile Dropdown */
.user-profile-dropdown {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  padding: 1.5rem;
  min-width: 280px;
  z-index: 1000;
  border: 2px solid #e5e7eb;
  display: none;
}

.user-profile-dropdown.active {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-profile-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #f1f5f9;
  margin-bottom: 1rem;
}

.user-profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  border: 3px solid #000;
  text-transform: uppercase;
}

.user-profile-info {
  flex: 1;
}

.user-profile-email {
  font-size: 0.875rem;
  color: #1f2937;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.user-profile-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.user-profile-badge.pro {
  background: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
  color: white;
  border: 1px solid #000;
}

.user-profile-badge.free {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.user-profile-badge.admin {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  border: 1px solid #000;
}

.user-profile-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.user-profile-stat {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid #e2e8f0;
}

.user-profile-stat-label {
  font-size: 0.625rem;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.user-profile-stat-value {
  font-size: 1.125rem;
  color: #1f2937;
  font-weight: 700;
}

.user-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.user-profile-btn {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.875rem;
}

.user-profile-btn.upgrade {
  background: linear-gradient(135deg, #32cd32 0%, #28a428 100%);
  color: white;
  border: 2px solid #000;
}

.user-profile-btn.upgrade:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.user-profile-btn.manage {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: 2px solid #000;
}

.user-profile-btn.manage:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.user-profile-btn.logout {
  background: transparent;
  color: #ef4444;
  border: 2px solid #ef4444;
}

.user-profile-btn.logout:hover {
  background: #ef4444;
  color: #ffffff;
}

.user-avatar-container {
  position: relative;
}

/* Mobile Menu */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.mobile-menu-btn:hover {
  background: var(--bg-tertiary);
  color: var(--primary-color);
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  display: none;
  backdrop-filter: blur(8px);
}

.mobile-menu-overlay.show {
  display: block;
}

.mobile-menu-content {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100%;
  background: var(--bg-primary);
  box-shadow: var(--shadow-xl);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.mobile-menu-overlay.show .mobile-menu-content {
  transform: translateX(0);
}

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.mobile-menu-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.mobile-menu-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.mobile-menu-nav {
  padding: 1rem 0;
}

.mobile-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  border: none;
  background: none;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.mobile-menu-item:hover {
  background: var(--bg-secondary);
  border-left-color: var(--primary-color);
  color: var(--primary-color);
}

/* Main Content */
.main-container {
  max-width: var(--layout-max-width-content);
  margin: 0 auto;
  padding: var(--layout-page-block) var(--layout-page-inline);
  box-sizing: border-box;
}

/* Strategy Card */
.strategy-card {
  background: linear-gradient(
    135deg,
    rgba(50, 205, 50, 0.05) 0%,
    rgba(26, 26, 26, 0.98) 50%
  );
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  overflow: visible;
  margin-bottom: 2rem;
  border: 2px solid transparent;
  background-clip: padding-box;
  position: relative;
  backdrop-filter: blur(10px);
}

.strategy-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  padding: 2px;
  background: linear-gradient(135deg, #32cd32, #10b981, #32cd32);
  -webkit-mask: linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  animation: gradientRotate 3s linear infinite;
}

@keyframes gradientRotate {
  0% {
    filter: hue-rotate(0deg);
  }
  100% {
    filter: hue-rotate(360deg);
  }
}

.card-header {
  background: linear-gradient(
    135deg,
    rgba(50, 205, 50, 0.2) 0%,
    rgba(16, 185, 129, 0.1) 100%
  );
  color: white;
  padding: 2rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid rgba(50, 205, 50, 0.3);
}

.card-header::before {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(
      circle at 20% 50%,
      rgba(50, 205, 50, 0.3) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 80% 80%,
      rgba(16, 185, 129, 0.2) 0%,
      transparent 30%
    ),
    radial-gradient(
      circle at 40% 30%,
      rgba(255, 255, 255, 0.05) 0%,
      transparent 20%
    );
  animation: floatOrbs 15s ease-in-out infinite;
}

@keyframes floatOrbs {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(5%, 5%) rotate(120deg);
  }
  66% {
    transform: translate(-5%, 3%) rotate(240deg);
  }
}

.card-header-content {
  position: relative;
  z-index: 1;
}

.card-icon {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 70px;
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  backdrop-filter: blur(10px);
}

.card-icon i {
  font-size: 2rem;
  color: white;
}

.card-subtitle {
  font-size: 1rem;
  opacity: 0.95;
  font-weight: 500;
  line-height: 1.5;
  max-width: 700px;
  margin: 0 auto;
}

/* Form Section */
.form-section {
  padding: 2.5rem 2rem;
  position: relative;
}

.form-section::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 300px;
  height: 300px;
  background: radial-gradient(
    circle,
    rgba(50, 205, 50, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  pointer-events: none;
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    transform: translate(-50%, -50%) scale(1);
    opacity: 0.5;
  }
  50% {
    transform: translate(-50%, -50%) scale(1.2);
    opacity: 0.3;
  }
}

.form-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #ffffff !important;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-label i {
  color: #32cd32;
  font-size: 0.875rem;
}

.form-input,
.form-select {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.2);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%2364748b' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.75rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
}

/* Strategy Input */
.strategy-section {
  margin-bottom: 2rem;
}

.strategy-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.strategy-label i {
  color: #32cd32;
  font-size: 1rem;
}

.ai-badge {
  background: #32cd32;
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: auto;
}

.strategy-textarea {
  width: 100%;
  min-height: 200px;
  padding: 1rem;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.6;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.strategy-textarea:focus {
  outline: none;
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(50, 205, 50, 0.2);
}

.strategy-textarea::placeholder {
  color: var(--text-muted);
  line-height: 1.7;
}

/* Action Buttons */
.action-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
  position: relative;
  z-index: 1;
}

.action-section .btn-group-left {
  display: flex;
  gap: 1rem;
}

.action-section .btn-group-right {
  display: flex;
  gap: 1rem;
}

.btn-utility {
  background: transparent;
  color: var(--text-primary);
  border: 2px solid #32cd32;
  padding: 0.625rem 1rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-utility:hover {
  background: rgba(50, 205, 50, 0.1);
  border-color: #28a428;
}

.btn-utility.processing {
  opacity: 0.6;
  pointer-events: none;
}

.btn-utility.processing i:not(.fa-spinner) {
  display: none;
}

.btn-utility .fa-spinner {
  display: none;
}

.btn-utility.processing .fa-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

.btn-utility .loading-spinner {
  display: none;
}

.btn-utility:disabled {
  opacity: 0.6;
  pointer-events: none;
}

.btn-utility:disabled .btn-text {
  display: none;
}

.btn-utility:disabled .loading-spinner {
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* Primary CTAs: /static/css/btn-primary-action.css (loaded last on each page) */

/* Progress Indicator Styles */
.progress-indicator {
  display: none;
  padding: 2rem 0;
  margin: 2rem auto;
  max-width: 800px;
}

.progress-indicator.active {
  display: block;
  animation: fadeInDown 0.4s ease forwards;
}

.progress-indicator.hiding {
  animation: fadeOutUp 0.3s ease forwards;
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOutUp {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.progress-phases {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  position: relative;
  margin-bottom: 1.5rem;
}

.progress-line {
  position: absolute;
  top: 19px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e5e7eb;
  z-index: 0;
}

.progress-line-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: linear-gradient(90deg, #32cd32, #28a428);
  width: 0%;
  transition: width 0.5s ease;
}

.progress-phase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  z-index: 1;
  flex: 1;
}

.progress-dot {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: 3px solid #e5e7eb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
  position: relative;
}

.progress-phase.active .progress-dot {
  border-color: #32cd32;
  background: #f0fdf4;
  animation: pulse-dot 1.5s ease-in-out infinite;
}

.progress-phase.completed .progress-dot {
  border-color: #32cd32;
  background: #32cd32;
  color: white;
}

.progress-phase.pending .progress-dot {
  border-color: #e5e7eb;
  background: white;
}

@keyframes pulse-dot {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(50, 205, 50, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 10px rgba(50, 205, 50, 0);
  }
}

.progress-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
}

.progress-phase.active .progress-label {
  color: #32cd32;
}

.progress-phase.completed .progress-label {
  color: #10b981;
}

.progress-eta {
  font-size: 0.75rem;
  color: #9ca3af;
  margin-top: 0.25rem;
}

.progress-phase.active .progress-eta {
  color: #32cd32;
  font-weight: 500;
}

.btn-main {
  background: #32cd32;
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  position: relative;
  overflow: hidden;
}

.btn-main:hover {
  opacity: 0.9;
}

.btn-main:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-main .loading-spinner {
  display: none;
}

.btn-main.loading .btn-text {
  opacity: 0;
}

.btn-main.loading .loading-spinner {
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  animation: spin-centered 1s linear infinite;
}

@keyframes spin-centered {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Results Container */
.results-container {
  background: var(--bg-primary);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-top: 2rem;
  display: none;
  border: 1px solid var(--border-color);
}

.results-container.show {
  display: block;
  animation: slideUp 0.4s ease;
}

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

.results-header {
  background: var(--bg-tertiary);
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
}

.results-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-title i {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #32cd32;
  color: white;
  border-radius: 8px;
}

.results-content {
  padding: 2.5rem;
}

/* Error States */
.error-container {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 1rem;
  display: none;
  opacity: 0;
  transform: translateY(-10px);
}

.error-container.show {
  display: block;
  animation: fadeInSlideDown 0.4s ease forwards;
}

@keyframes fadeInSlideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.error-message {
  color: #ef4444;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Loading States */
.loading-message {
  text-align: center;
  padding: 4rem;
  color: var(--text-secondary);
}

.loading-message i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  animation: spin 1s linear infinite;
  color: #32cd32;
}

/* Feedback Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}

.modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: modalSlideIn 0.3s ease;
  border: 1px solid var(--border-color);
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  background: #32cd32;
  color: white;
  padding: 1.25rem 1.5rem;
  border-radius: 12px 12px 0 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

.feedback-form {
  padding: 2rem;
}

.feedback-form .form-group {
  margin-bottom: 1.5rem;
}

.feedback-form .form-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  display: block;
}

.feedback-form .form-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border-color) !important;
  border-radius: 8px;
  font-size: 0.875rem;
  font-family: inherit;
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.feedback-form .form-input:focus {
  outline: none;
  border-color: var(--border-focus) !important;
  box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

.feedback-form textarea.form-input {
  min-height: 120px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  margin-top: 2rem;
}

.modal-actions .btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions .btn-secondary:hover {
  background: var(--bg-secondary);
  border-color: #94a3b8;
}

.modal-actions .btn-primary {
  background: #32cd32;
  color: white;
  border: none;
  padding: 0.625rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.modal-actions .btn-primary:hover {
  opacity: 0.9;
}

/* Responsive Design — md breakpoint */
@media (max-width: 768px) {
  .header-container {
    padding: 0.75rem var(--layout-page-inline);
  }

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

  .brand-subtitle {
    font-size: 0.75rem;
  }

  .logo {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }

  .desktop-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: block !important;
  }

  .header-right {
    gap: 0.75rem;
  }

  .main-container {
    padding: min(1.25rem, var(--layout-page-block)) var(--layout-page-inline);
  }

  .btn-group-left,
  .btn-group-right {
    width: 100%;
    flex-direction: column;
  }

  .btn-utility {
    width: 100%;
    justify-content: center;
  }

  .card-header {
    padding: 2rem 1.5rem;
  }

  .card-icon {
    width: 70px;
    height: 70px;
  }

  .card-icon i {
    font-size: 2rem;
  }

  .card-subtitle {
    font-size: 1rem;
  }

  .form-section {
    padding: 1.5rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .action-section {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }

  .btn-main {
    margin-left: 0;
    order: -1;
  }

  .strategy-textarea {
    min-height: 180px;
    padding: 1rem;
  }

  .strategy-label {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 1rem;
  }

  .strategy-label .ai-badge {
    margin-left: 0;
    align-self: flex-start;
  }

  .results-container {
    margin-top: 1.5rem;
  }

  .results-header {
    padding: 1.25rem 1.5rem;
  }

  .results-title {
    font-size: 1.125rem;
  }

  .results-content {
    padding: 1.5rem;
  }

  .mobile-menu-content {
    width: 100%;
    max-width: 320px;
  }

  /* Ensure mobile menu items are properly styled */
  .mobile-menu-item {
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  /* Fix mobile menu header */
  .mobile-menu-header {
    padding: 1.5rem;
  }
}

@media (max-width: 480px) {
  .header-container {
    padding: 0 0.75rem;
  }

  .header-right {
    gap: 0.5rem;
  }

  .mobile-menu-btn {
    padding: 0.375rem;
    font-size: 1.125rem;
  }

  .mobile-menu-content {
    width: 100%;
    max-width: 280px;
  }

  .mobile-menu-header {
    padding: 1.25rem;
  }

  .mobile-menu-item {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }

  .card-subtitle {
    font-size: 0.9rem;
  }

  .btn-utility {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .btn-main {
    font-size: 0.9rem;
    padding: 1rem 2rem;
  }

  /* Results sections responsive */
  .summary-section h3,
  .metrics-section h3,
  .equity-vs-spy-section h3,
  .plot-section h3 {
    font-size: 1.125rem !important;
    gap: 0.5rem !important;
  }

  .summary-section h3 span,
  .metrics-section h3 span,
  .equity-vs-spy-section h3 span,
  .plot-section h3 span {
    width: 36px !important;
    height: 36px !important;
    border-width: 2px !important;
    box-shadow: 0 2px 0 #000 !important;
  }

  .summary-section h3 svg,
  .metrics-section h3 svg,
  .equity-vs-spy-section h3 svg,
  .plot-section h3 svg {
    width: 18px !important;
    height: 18px !important;
  }

  .summary-section > div,
  .plot-section > div {
    padding: 1rem !important;
  }

  .equity-vs-spy-section > div {
    padding: 1rem !important;
  }

  .equity-vs-spy-section > div > div {
    padding: 1rem !important;
  }

  .summary-section > div > div {
    font-size: 0.875rem !important;
    line-height: 1.6 !important;
  }

  .metrics-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  .metrics-grid > div {
    padding: 1.25rem !important;
  }

  .metrics-grid > div > div:first-child {
    font-size: 0.75rem !important;
  }

  .metrics-grid > div > div:last-child {
    font-size: 1.25rem !important;
  }

  /* Low trades warning responsive */
  .low-trades-warning {
    padding: 1rem !important;
  }

  .low-trades-warning > div {
    gap: 0.75rem !important;
  }

  .low-trades-warning > div > div:first-child {
    font-size: 1.5rem !important;
  }

  .low-trades-warning h4 {
    font-size: 0.95rem !important;
    margin-bottom: 0.5rem !important;
  }

  .low-trades-warning p {
    font-size: 0.8rem !important;
    line-height: 1.5 !important;
    margin-bottom: 0.75rem !important;
  }

  .multi-stock-btn {
    font-size: 0.65rem !important;
    padding: 0.4rem 0.8rem !important;
  }

  /* Comparison badges responsive */
  .comparison-badges-container {
    gap: 0.25rem !important;
  }

  .comparison-badge {
    padding: 0.375rem 0.5rem !important;
    border-radius: 6px !important;
  }

  .comparison-badge-label {
    font-size: 0.5rem !important;
  }

  .comparison-badge-value {
    font-size: 0.9rem !important;
  }
}
