/* ============================================
   AI PAGE — Scandinavian Minimalist
   Relies on universal-scandi.css :root tokens.
   No glass, no neon glow, no dark theme artifacts.
   ============================================ */

/* ============================================
   BODY
   ============================================ */
body {
  font-family: 'Inter', sans-serif;
  margin: 0;
  padding: 0;
  padding-top: 64px;
  background-color: var(--primary-bg);
  color: var(--primary-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Color clouds — each pseudo-element layer pulses independently */
body::before,
body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle 380px at 8% 12%, rgba(209, 77, 106, 0.42), transparent 65%),
    radial-gradient(ellipse 420px 280px at 88% 6%, rgba(115, 83, 186, 0.36), transparent 60%),
    radial-gradient(ellipse 300px 380px at 42% 88%, rgba(45, 159, 214, 0.33), transparent 60%);
  filter: blur(80px);
  animation: cloudPulse1 8s ease-in-out infinite;
}

body::after {
  background:
    radial-gradient(ellipse 340px 260px at 72% 48%, rgba(209, 77, 106, 0.26), transparent 55%),
    radial-gradient(circle 300px at 18% 58%, rgba(115, 83, 186, 0.22), transparent 55%);
  filter: blur(80px);
  animation: cloudPulse2 11s ease-in-out infinite;
}

@keyframes cloudPulse1 {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.6; transform: scale(1.08); }
}

@keyframes cloudPulse2 {
  0%, 100% { opacity: 1; transform: scale(1.05); }
  50%      { opacity: 0.55; transform: scale(0.95); }
}

/* Ensure all content sits above the clouds (exclude header — must stay fixed) */
body > *:not(header) {
  position: relative;
  z-index: 1;
}

/* ============================================
   INSTRUCTIONS CONTAINER
   ============================================ */
.instructions-container {
  display: flex;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 15px 20px;
  gap: 30px;
}

.usage-instructions {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 20px;
}

.usage-section h2, .import-section h2 {
  font-size: 1.8rem;
  margin-bottom: 15px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.usage-section, .key-features-section {
  flex: 1;
  padding: 15px 0;
}

.import-steps {
  padding-left: 25px;
  color: var(--secondary-text);
  line-height: 1.7;
}

.import-steps li {
  margin-bottom: 10px;
}

/* ============================================
   KEY FEATURES SECTION
   ============================================ */
.key-features-section {
  flex: 1;
  padding: 15px 0;
}

.key-features-section h2 {
  font-size: 1.6rem;
  margin-bottom: 12px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.feature-highlight {
  display: flex;
  align-items: flex-start;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
}

.feature-highlight:hover {
  background-color: var(--tertiary-bg);
  border-color: var(--page-border);
}

.feature-highlight .feature-icon {
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  opacity: 0.9;
}

.feature-highlight .feature-content {
  flex: 1;
}

.feature-highlight h4 {
  margin: 0 0 5px 0;
  font-size: 1.05rem;
  color: var(--primary-text);
  font-weight: 600;
}

.feature-highlight p {
  margin: 0;
  color: var(--secondary-text);
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ============================================
   MAIN PAGE CONTAINER
   ============================================ */
.ai-page-container {
  display: flex;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
  gap: 30px;
}

/* ============================================
   LEFT SIDE — SETUP CONTAINER
   ============================================ */
.ai-setup-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
  position: relative;
}

/* Simple divider instead of glowing gradient */
.ai-setup-container::after {
  content: "";
  position: absolute;
  top: 10%;
  right: 0;
  height: 80%;
  width: 1px;
  background: #E5E7EB;
  opacity: 1;
}

.ai-setup-container h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.setup-intro {
  color: var(--secondary-text);
  margin-bottom: 30px;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Frosted glass card pattern */
.setup-form {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
  position: relative;
  box-sizing: border-box;
}

.form-group {
  margin-bottom: 20px;
  padding: 0 15px;
}

.form-actions {
  padding: 0 15px;
}

.prompt-tips {
  margin-left: 15px;
  margin-right: 15px;
}

/* ============================================
   RIGHT SIDE — EXAMPLES CONTAINER
   ============================================ */
.ai-examples-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.ai-examples-container h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.examples-intro {
  color: var(--secondary-text);
  margin-bottom: 30px;
  font-size: 1.05rem;
  line-height: 1.6;
}

/* Frosted glass card pattern */
.example-box {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-top-color: rgba(255, 255, 255, 0.5);
  border-left: 3px solid var(--highlight-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 30px;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.example-box:hover {
  box-shadow: var(--shadow-lg);
  border-left-color: var(--highlight-hover);
}

.example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  border-bottom: 1px solid #E5E7EB;
  padding-bottom: 15px;
}

.example-header h3 {
  font-size: 1.35rem;
  margin: 0;
  color: var(--highlight-color);
  font-weight: 600;
}

.example-indicator {
  display: flex;
  gap: 6px;
  margin-top: 5px;
}

.indicator {
  cursor: pointer;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--tertiary-bg);
  border: 1px solid var(--page-border);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.indicator:hover {
  background-color: rgba(209, 77, 106, 0.1);
  border-color: var(--highlight-color);
  transform: scale(1.15);
}

.indicator.active {
  background-color: var(--highlight-color);
  border-color: var(--highlight-color);
  box-shadow: 0 0 6px rgba(209, 77, 106, 0.3);
}

.example-content {
  color: var(--secondary-text);
  line-height: 1.7;
  flex: 1;
  animation: fadeChange 0.5s ease-in-out;
}

.example-form {
  border-left: 3px solid var(--highlight-color);
  position: relative;
}

.example-label {
  color: var(--highlight-color) !important;
  font-weight: 600 !important;
  font-size: 0.8rem !important;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

.example-field {
  background-color: var(--tertiary-bg);
  padding: 14px;
  border-radius: var(--radius-sm);
  color: var(--secondary-text);
  line-height: 1.6;
  font-size: 0.93rem;
  border: 1px solid var(--page-border);
}

.example-list {
  margin: 0;
  padding-left: 20px;
}

.example-list li {
  margin-bottom: 6px;
}

.example-prompt {
  background-color: var(--tertiary-bg);
  padding: 14px;
  border-radius: var(--radius-sm);
  color: var(--secondary-text);
  line-height: 1.7;
  font-size: 0.93rem;
  min-height: 150px;
  animation: fadeChange 0.5s ease-in-out;
  border: 1px solid var(--page-border);
}

.example-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  background: linear-gradient(135deg, var(--highlight-color), var(--highlight-hover));
  color: white;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  box-shadow: 0 2px 8px rgba(209, 77, 106, 0.25);
}

#example-indicators {
  display: flex;
  gap: 5px;
  margin-top: 5px;
}

.model-selection-controls {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 40px;
}

.example-model-wrapper,
.user-model-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.example-model-section,
.user-model-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.model-selector {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.selector-label {
  font-size: 0.78rem;
  color: var(--muted-text);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.user-models-dropdown {
  padding: 8px 14px;
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sm);
  background: var(--secondary-bg);
  backdrop-filter: none;
  color: var(--primary-text);
  font-size: 0.9rem;
  width: 200px;
  cursor: pointer;
  transition: all 0.25s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.user-models-dropdown option {
  background-color: var(--secondary-bg);
  color: var(--primary-text);
}

.user-models-dropdown:hover {
  border-color: var(--secondary-text);
  background-color: var(--tertiary-bg);
}

.user-models-dropdown:focus {
  outline: none;
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(209, 77, 106, 0.08);
}

@keyframes fadeChange {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ============================================
   FEATURES SECTION
   ============================================ */
.ai-features {
  margin-top: 30px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 20px;
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-top-color: var(--page-border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.feature-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: #D1D5DB;
}

.feature-icon {
  margin-right: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  opacity: 0.9;
}

.feature-text h4 {
  margin: 0 0 10px 0;
  color: var(--primary-text);
  font-size: 1.05rem;
  font-weight: 600;
}

.feature-text p {
  color: var(--secondary-text);
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ============================================
   FORM ELEMENTS
   ============================================ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 4px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--secondary-text);
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Helper text beneath labels — always visible, unlike placeholders */
.field-hint {
  display: block;
  font-size: 0.82rem;
  color: var(--muted-text);
  margin-bottom: 8px;
  line-height: 1.4;
  font-weight: 400;
}

.tooltip {
  display: inline-block;
  width: 16px;
  height: 16px;
  background-color: var(--tertiary-bg);
  color: var(--secondary-text);
  border-radius: 50%;
  text-align: center;
  line-height: 16px;
  font-size: 11px;
  font-weight: bold;
  cursor: help;
  margin-left: 6px;
  position: relative;
  border: 1px solid var(--page-border);
  transition: all 0.2s ease;
}

.tooltip:hover {
  background-color: var(--tertiary-bg);
  border-color: #D1D5DB;
}

.tooltip:hover::after {
  content: attr(title);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 100%;
  margin-bottom: 6px;
  background-color: var(--secondary-bg);
  color: var(--primary-text);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-weight: normal;
  white-space: nowrap;
  font-size: 12px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--page-border);
  z-index: 10;
  text-transform: none;
  letter-spacing: normal;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 13px 16px;
  background-color: var(--secondary-bg);
  border: 1px solid var(--page-border);
  color: var(--primary-text);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(209, 77, 106, 0.08);
  outline: none;
  background-color: var(--secondary-bg);
}

.ai-prompt-textarea {
  resize: vertical;
  min-height: 150px;
  font-family: 'Inter', sans-serif;
}

/* ============================================
   MULTI-SELECT DROPDOWN
   ============================================ */
.custom-multi-dropdown {
  position: relative;
  width: 100%;
}

.dropdown-selected {
  width: 100%;
  padding: 13px 16px;
  background-color: var(--secondary-bg);
  border: 1px solid var(--page-border);
  color: var(--primary-text);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  position: relative;
  transition: all 0.25s ease;
}

.dropdown-selected:after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid var(--muted-text);
  transition: transform 0.2s ease;
}

.custom-multi-dropdown.open .dropdown-selected:after {
  transform: translateY(-50%) rotate(180deg);
}

.dropdown-selected:hover {
  border-color: var(--secondary-text);
  background-color: var(--tertiary-bg);
}

.dropdown-options {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: var(--secondary-bg);
  border: 1px solid var(--page-border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  z-index: 10;
  display: none;
  box-shadow: var(--shadow-lg);
}

.custom-multi-dropdown.open .dropdown-options {
  display: block;
}

.dropdown-option {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dropdown-option:last-child {
  border-bottom: none;
}

.dropdown-option:hover {
  background-color: var(--tertiary-bg);
}

.dropdown-option.selected {
  background-color: rgba(209, 77, 106, 0.05);
}

.checkmark {
  display: inline-block;
  width: 20px;
  opacity: 0;
  color: var(--highlight-color);
  font-weight: bold;
  transition: opacity 0.2s ease;
}

.dropdown-option.selected .checkmark {
  opacity: 1;
}

.option-text {
  flex: 1;
}

/* ============================================
   FORM ACTIONS
   ============================================ */
.form-actions {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  gap: 15px;
}

/* Rose-to-charcoal gradient */
.save-model-button {
  padding: 13px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  flex: 1;
  background: linear-gradient(135deg, #D14D6A 0%, #1F2937 100%);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  letter-spacing: 0.3px;
}

.save-model-button:hover {
  background: linear-gradient(135deg, #B8455E 0%, #111827 100%);
  box-shadow: var(--shadow-lg);
  animation: ctaBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes ctaBounce {
  0%   { transform: translateY(0); }
  40%  { transform: translateY(-5px); }
  60%  { transform: translateY(-2px); }
  100% { transform: translateY(-3px); }
}

/* ============================================
   INSTRUCTION CARDS
   ============================================ */
.instruction-card {
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-top-color: var(--page-border);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  position: relative;
  padding-left: 50px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  min-height: 40px;
  transition: all 0.25s ease;
}

.instruction-card:hover {
  border-color: #D1D5DB;
  background: var(--tertiary-bg);
}

/* Rose-to-purple gradient number circles */
.instruction-number {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  background: linear-gradient(135deg, #D14D6A 0%, #7353BA 100%);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 600;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(209, 77, 106, 0.25);
}

.ai-setup-container .example-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--page-border);
}

.ai-setup-container .example-header h3 {
  margin: 0;
  color: var(--primary-text);
  font-size: 1.5rem;
  font-weight: 600;
}

.ai-setup-container textarea {
  resize: vertical;
  min-height: 60px;
  max-height: 400px;
  width: 100%;
}

.ai-setup-container .ai-prompt-textarea {
  min-height: 120px;
}

.instruction-card h4 {
  margin: 0;
  font-size: 1.05rem;
  color: var(--primary-text);
  width: 140px;
  white-space: nowrap;
  font-weight: 600;
}

.instruction-card p {
  margin: 0;
  color: var(--secondary-text);
  font-size: 0.88rem;
  flex: 1;
  padding-left: 15%;
  line-height: 1.4;
}

/* ============================================
   PROMPT TIPS
   ============================================ */
.prompt-tips {
  background: var(--tertiary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sm);
  padding: 18px;
  margin-top: 20px;
}

.prompt-tips h4 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 0.85rem;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}

.prompt-tips ul {
  margin: 0;
  padding-left: 20px;
  color: var(--secondary-text);
}

.prompt-tips li {
  margin-bottom: 6px;
  font-size: 0.88rem;
  line-height: 1.5;
}

/* ============================================
   ANIMATED PROMPT ARROW
   ============================================ */
.animated-prompt-container {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 10px 0 20px;
}

.animated-prompt-arrow {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: auto;
}

.arrow-text {
  font-size: 14px;
  color: var(--secondary-text);
  margin-bottom: 8px;
  font-weight: 500;
}

.arrow-container {
  position: relative;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.arrow-circle {
  position: absolute;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background-color: rgba(209, 77, 106, 0.06);
  animation: pulseCircle 2s ease-in-out infinite;
}

.arrow-path {
  animation: arrowBounce 1.5s ease-in-out infinite;
  position: relative;
  z-index: 2;
}

@keyframes arrowBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(4px); }
}

@keyframes pulseCircle {
  0%, 100% { transform: scale(1); opacity: 0.15; }
  50% { transform: scale(1.2); opacity: 0.3; }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 1024px) {
  .animated-prompt-container {
    margin: 5px 0 15px;
  }

  .instructions-container,
  .ai-page-container {
    flex-direction: column;
    padding: 20px;
  }

  .ai-setup-container {
    width: 100%;
    margin-bottom: 40px;
  }

  .ai-setup-container::after {
    display: none;
  }

  .ai-examples-container {
    width: 100%;
  }

  .example-box {
    min-height: 200px;
  }

  .usage-section,
  .import-section {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .arrow-text {
    font-size: 13px;
  }

  .ai-examples-container h2,
  .ai-setup-container h2,
  .usage-section h2,
  .key-features-section h2 {
    font-size: 1.8rem;
  }

  .example-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

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

  .model-selection-controls {
    position: static;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
  }

  .user-models-dropdown {
    width: 100%;
  }

  .models-controls {
    flex-direction: column;
  }

  .models-filter {
    width: 100%;
    min-width: 0;
  }

  .instruction-card {
    padding-left: 42px;
  }

  .instruction-card h4 {
    width: auto;
    white-space: normal;
    font-size: 0.95rem;
  }

  .instruction-card p {
    padding-left: 0;
    font-size: 0.82rem;
  }
}

@media (max-width: 480px) {
  .arrow-text {
    font-size: 12px;
  }

  .ai-examples-container h2,
  .ai-setup-container h2,
  .usage-section h2,
  .key-features-section h2 {
    font-size: 1.6rem;
  }

  .examples-intro,
  .setup-intro {
    font-size: 1rem;
  }

  .instructions-container,
  .ai-page-container {
    padding: 20px 15px;
  }
}

/* ============================================
   MODELS CONTAINER
   ============================================ */
.ai-models-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 20px;
}

.ai-models-container h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--primary-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.models-intro {
  color: var(--secondary-text);
  margin-bottom: 20px;
  font-size: 1.05rem;
  line-height: 1.6;
}

.models-controls {
  display: flex;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 15px;
}

.refresh-models-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.93rem;
  transition: all 0.25s ease;
  font-weight: 500;
}

.refresh-models-button:hover {
  background-color: #E5E7EB;
  transform: translateY(-1px);
  border-color: #D1D5DB;
}

.models-filter {
  padding: 10px 36px 10px 18px;
  background-color: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sm);
  font-size: 0.93rem;
  cursor: pointer;
  transition: all 0.25s ease;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.models-filter:hover {
  border-color: #D1D5DB;
}

.models-table-wrapper {
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-top-color: var(--page-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 24px;
  overflow-x: auto;
}

.models-table {
  width: 100%;
  border-collapse: collapse;
}

.models-table thead {
  background-color: var(--tertiary-bg);
  border-bottom: 1px solid var(--page-border);
}

.models-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--muted-text);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.models-table tbody tr {
  border-bottom: 1px solid var(--page-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.models-table tbody tr:hover {
  background-color: var(--tertiary-bg);
}

.models-table tbody tr.deleted-model {
  opacity: 0.5;
  background-color: rgba(220, 38, 38, 0.03);
}

.models-table td {
  padding: 14px 16px;
  color: var(--secondary-text);
  font-size: 0.9rem;
}

.models-table .model-name {
  color: var(--primary-text);
  font-weight: 500;
}

.model-actions {
  display: flex;
  gap: 8px;
}

.action-button {
  padding: 7px 12px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.25s ease;
  font-weight: 500;
}

/* Rose-to-charcoal gradient */
.edit-button {
  background: linear-gradient(135deg, #D14D6A 0%, #1F2937 100%);
  color: white;
  box-shadow: var(--shadow-sm);
}

.edit-button:hover {
  background: linear-gradient(135deg, #B8455E 0%, #111827 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.delete-button {
  background: rgba(220, 38, 38, 0.06);
  border: 1px solid rgba(220, 38, 38, 0.15);
  color: #DC2626;
  box-shadow: none;
}

.delete-button:hover {
  background: rgba(220, 38, 38, 0.1);
  border-color: rgba(220, 38, 38, 0.25);
  transform: translateY(-1px);
}

.restore-button {
  background: rgba(22, 163, 74, 0.06);
  border: 1px solid rgba(22, 163, 74, 0.15);
  color: #16A34A;
  box-shadow: none;
}

.restore-button:hover {
  background: rgba(22, 163, 74, 0.1);
  border-color: rgba(22, 163, 74, 0.25);
  transform: translateY(-1px);
}

.no-models-message {
  text-align: center;
  padding: 48px;
  color: var(--muted-text);
}

.no-models-message p {
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ============================================
   EDIT FORM
   ============================================ */
.edit-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 30px;
}

.back-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background-color: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--page-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.93rem;
  transition: all 0.25s ease;
  font-weight: 500;
}

.back-button:hover {
  background-color: #E5E7EB;
  transform: translateX(-2px);
  border-color: #D1D5DB;
}

.edit-form-wrapper {
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-top-color: var(--page-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

#editModelForm .form-group {
  margin-bottom: 20px;
}

#editModelForm label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  font-size: 0.85rem;
  color: var(--secondary-text);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

#editModelForm input,
#editModelForm textarea {
  width: 100%;
  padding: 13px 16px;
  background-color: var(--secondary-bg);
  border: 1px solid var(--page-border);
  color: var(--primary-text);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: 'Inter', sans-serif;
  transition: all 0.25s ease;
}

#editModelForm input:focus,
#editModelForm textarea:focus {
  border-color: var(--highlight-color);
  box-shadow: 0 0 0 3px rgba(209, 77, 106, 0.08);
  outline: none;
  background-color: var(--secondary-bg);
}

.edit-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 30px;
}

.edit-form-actions button:hover {
  transform: translateY(-1px);
}

/* ============================================
   NOTIFICATION SYSTEM
   ============================================ */
#notification-container {
  position: fixed;
  top: 100px;
  right: 20px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.notification {
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  min-width: 300px;
  max-width: 400px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease-out;
  position: relative;
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.notification.success {
  background: #F0FDF4;
  border-color: #BBF7D0;
  box-shadow: var(--shadow-lg);
}

.notification.success .notification-icon {
  color: #16A34A;
}

.notification.success .notification-title {
  color: #16A34A;
}

.notification.error {
  background: #FEF2F2;
  border-color: #FECACA;
  box-shadow: var(--shadow-lg);
}

.notification.error .notification-icon {
  color: #DC2626;
}

.notification.error .notification-title {
  color: #DC2626;
}

.notification.warning {
  background: #FFFBEB;
  border-color: #FDE68A;
  box-shadow: var(--shadow-lg);
}

.notification.warning .notification-icon {
  color: #D97706;
}

.notification.warning .notification-title {
  color: #D97706;
}

.notification-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}

.notification-content {
  flex: 1;
}

.notification-title {
  color: var(--primary-text);
  font-weight: 600;
  margin-bottom: 4px;
  font-size: 14px;
}

.notification-message {
  color: var(--secondary-text);
  font-size: 13px;
  line-height: 1.5;
}

.notification-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: var(--muted-text);
  cursor: pointer;
  font-size: 18px;
  padding: 0;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.notification-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--primary-text);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.notification.removing {
  animation: slideOut 0.3s ease-in;
}

/* ============================================
   MODAL SYSTEM
   ============================================ */
.custom-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
}

.custom-modal.hidden {
  display: none;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--secondary-bg);
  backdrop-filter: none;
  border: 1px solid var(--page-border);
  border-top-color: var(--page-border);
  border-radius: var(--radius-xl);
  padding: 0;
  min-width: 400px;
  max-width: 500px;
  box-shadow: var(--shadow-xl);
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  padding: 24px 28px;
  border-bottom: 1px solid #E5E7EB;
}

.modal-title {
  margin: 0;
  color: var(--primary-text);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.modal-body {
  padding: 24px 28px;
  color: var(--secondary-text);
  font-size: 0.93rem;
  line-height: 1.6;
}

.modal-footer {
  padding: 18px 28px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid #E5E7EB;
}

.modal-btn {
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  min-width: 120px;
  letter-spacing: 0.2px;
}

.modal-btn-primary {
  background: linear-gradient(135deg, #D14D6A 0%, #1F2937 100%);
  color: white;
  box-shadow: var(--shadow-md);
}

.modal-btn-primary:hover {
  background: linear-gradient(135deg, #B8455E 0%, #111827 100%);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.modal-btn-secondary {
  background-color: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--page-border);
}

.modal-btn-secondary:hover {
  background-color: #E5E7EB;
  border-color: #D1D5DB;
}

.modal-btn-cancel {
  background-color: transparent;
  color: var(--secondary-text);
  border: 1px solid var(--page-border);
}

.modal-btn-cancel:hover {
  background-color: var(--tertiary-bg);
  border-color: #D1D5DB;
}

@keyframes modalSlideIn {
  from {
    transform: scale(0.92);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* ============================================
   CANCEL / UPDATE BUTTONS
   ============================================ */
.cancel-edit-button,
.update-model-button {
  padding: 13px 26px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.2px;
}

.cancel-edit-button {
  background-color: var(--tertiary-bg);
  color: var(--primary-text);
  border: 1px solid var(--page-border);
}

.cancel-edit-button:hover {
  background-color: #E5E7EB;
  border-color: #D1D5DB;
}

/* Rose-to-charcoal gradient */
.update-model-button {
  background: linear-gradient(135deg, #D14D6A 0%, #1F2937 100%);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
}

.update-model-button:hover {
  background: linear-gradient(135deg, #B8455E 0%, #111827 100%);
  box-shadow: var(--shadow-lg);
  animation: ctaBounce 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ============================================
   EDIT WRAPPER
   ============================================ */
.ai-models-edit-wrapper {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.ai-models-edit-wrapper .ai-models-container {
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
}

/* ============================================
   DISABLED DROPDOWN OPTION
   ============================================ */
.dropdown-item.disabled-option:hover {
  background-color: transparent !important;
}

.dropdown-item.disabled-option {
  cursor: not-allowed !important;
  opacity: 0.45;
  background-color: transparent !important;
}

/* ============================================
   AUTH WALL (logged-out state)
   ============================================ */
.ai-auth-wall {
  max-width: 560px;
  margin: 40px auto 80px;
  padding: 0 20px;
}

.ai-auth-wall-card {
  background: var(--secondary-bg, #FFFFFF);
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  padding: 40px 36px;
  text-align: center;
  box-shadow: 0 4px 24px rgba(17, 24, 39, 0.06);
}

.ai-auth-wall-card h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 12px;
}

.ai-auth-wall-card p {
  font-size: 0.95rem;
  color: #4B5563;
  line-height: 1.6;
}

.ai-auth-wall-card a {
  color: #E63962;
  font-weight: 600;
  text-decoration: none;
}

.ai-auth-wall-card a:hover {
  text-decoration: underline;
}

/* ============================================
   TEMPLATE CHIPS
   ============================================ */
.template-chips-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.template-chips-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6B7280;
}

.template-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.template-chip {
  border: 1px solid #E5E7EB;
  background: #FFFFFF;
  color: #374151;
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.template-chip:hover {
  border-color: #E63962;
  color: #E63962;
  background: rgba(230, 57, 98, 0.04);
}

/* ============================================
   PROMPT REGEN BAR (manual edits kept)
   ============================================ */
.prompt-regen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  padding: 8px 14px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  border-radius: 8px;
  font-size: 0.83rem;
  color: #92400E;
}

.prompt-regen-bar button {
  flex-shrink: 0;
  border: 1px solid #F59E0B;
  background: #FFFFFF;
  color: #92400E;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.prompt-regen-bar button:hover {
  background: #FEF3C7;
}

/* ============================================
   MODEL TEST PANEL
   ============================================ */
.ai-test-container {
  width: 100%;
  max-width: 1400px;
  margin: 12px auto 60px;
  padding: 32px 36px;
  background: var(--secondary-bg, #FFFFFF);
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(17, 24, 39, 0.05);
}

.test-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.test-header-row h2 {
  font-size: 1.4rem;
  font-weight: 600;
  color: #111827;
  margin: 0;
}

.test-quota {
  font-size: 0.85rem;
  font-weight: 500;
  color: #6B7280;
  background: #F3F4F6;
  border-radius: 999px;
  padding: 5px 14px;
}

.test-quota.quota-low {
  color: #B91C1C;
  background: #FEF2F2;
}

.test-intro {
  font-size: 0.92rem;
  color: #4B5563;
  line-height: 1.6;
  margin: 10px 0 22px;
  max-width: 760px;
}

.test-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.test-model-select {
  font-family: inherit;
  font-size: 0.9rem;
  color: #111827;
  background: #FFFFFF;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 9px 36px 9px 14px;
  min-width: 240px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
}

.test-model-select:focus {
  outline: none;
  border-color: #E63962;
  box-shadow: 0 0 0 3px rgba(230, 57, 98, 0.1);
}

.run-test-button {
  margin: 0;
}

.test-add-row {
  border: 1px dashed #D1D5DB;
  background: transparent;
  color: #6B7280;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.test-add-row:hover {
  border-color: #9CA3AF;
  color: #374151;
}

.test-table-wrapper {
  overflow-x: auto;
}

.test-table {
  width: 100%;
  border-collapse: collapse;
}

.test-table th {
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6B7280;
  padding: 10px 12px;
  border-bottom: 1px solid #E5E7EB;
}

.test-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #F3F4F6;
  font-size: 0.9rem;
  color: #111827;
  vertical-align: middle;
}

.test-col-num { width: 36px; }
.test-col-url { width: 30%; min-width: 220px; }
.test-col-status { width: 120px; }
.test-col-score { width: 70px; }

.test-row-num {
  color: #9CA3AF;
  font-size: 0.82rem;
}

.test-url-cell input.test-url {
  width: 100%;
  font-family: inherit;
  font-size: 0.9rem;
  color: #111827;
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  padding: 8px 12px;
  transition: border-color 0.15s ease;
}

.test-url-cell input.test-url:focus {
  outline: none;
  border-color: #E63962;
  box-shadow: 0 0 0 3px rgba(230, 57, 98, 0.08);
}

.test-status {
  font-size: 0.82rem;
  font-weight: 500;
  color: #6B7280;
}

.test-status.status-pending { color: #9CA3AF; }
.test-status.status-scraping,
.test-status.status-evaluating { color: #B45309; }
.test-status.status-done { color: #047857; }
.test-status.status-failed { color: #B91C1C; }

.test-score-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
}

.test-score-badge.score-high { background: #ECFDF5; color: #047857; }
.test-score-badge.score-mid  { background: #FFFBEB; color: #B45309; }
.test-score-badge.score-low  { background: #FEF2F2; color: #B91C1C; }

.test-reason-cell {
  color: #4B5563;
  font-size: 0.85rem;
  line-height: 1.45;
  max-width: 480px;
}

@media (max-width: 768px) {
  .ai-test-container {
    padding: 22px 16px;
    border-radius: 12px;
  }

  .test-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .test-model-select {
    min-width: 0;
    width: 100%;
  }
}
