/* ==========================================
   DEALER ASSISTANT - DARK THEME
   Leonardo.ai-inspired modern SaaS design
   ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Dark Theme Colors */
  --bg-primary: #0f1115;
  --bg-secondary: #1a1d23;
  --bg-tertiary: #23262d;
  --bg-input: #2a2d35;

  --text-primary: #ffffff;
  --text-secondary: #a8b3cf;
  --text-tertiary: #6b7280;

  --accent-primary: #6366f1;
  --accent-hover: #7c3aed;
  --accent-glow: rgba(99, 102, 241, 0.3);

  --border-color: #2d3139;
  --border-subtle: #1f2128;

  --success: #10b981;
  --error: #ef4444;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 20px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px var(--accent-glow);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ==========================================
   PASSWORD GATE
   ========================================== */

.password-gate {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0f1115 0%, #1a1d23 100%);
}

.password-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeIn 0.5s ease;
}

.password-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.password-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 30px;
}

.password-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.password-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 1rem;
  transition: var(--transition);
}

.password-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.password-btn {
  width: 100%;
  padding: 14px 24px;
  background: var(--accent-primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.password-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.password-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  color: var(--error);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  animation: shake 0.4s ease;
}

/* ==========================================
   MAIN APP
   ========================================== */

.main-app {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px;
  animation: fadeIn 0.5s ease;
}

/* ==========================================
   HEADER
   ========================================== */

.header {
  text-align: center;
  padding: 40px 0 60px;
}

.app-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.app-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.5px;
}

/* ==========================================
   SECTION HEADING
   ========================================== */

.section-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

/* ==========================================
   MODE TILES
   ========================================== */

.mode-selection {
  margin-bottom: 40px;
}

.mode-tiles {
  display: grid;
  gap: 12px;
}

.mode-tile {
  width: 100%;
  min-height: 70px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.mode-tile::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: transparent;
  transition: var(--transition);
}

.mode-tile:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.mode-tile:hover::before {
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-hover));
}

.mode-tile.active {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  box-shadow: var(--shadow-glow);
}

.mode-tile.active::before {
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-hover));
}

.mode-icon {
  font-size: 1.75rem;
  filter: grayscale(0.3);
}

.mode-tile:hover .mode-icon,
.mode-tile.active .mode-icon {
  filter: grayscale(0);
  transform: scale(1.1);
  transition: var(--transition);
}

.mode-label {
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--text-primary);
}

/* ==========================================
   FORM CONTAINER
   ========================================== */

.form-container {
  margin-bottom: 40px;
  animation: slideIn 0.4s ease;
}

.form-section {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}

.section-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-subtle);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-field label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-field label .required {
  color: var(--error);
  margin-left: 4px;
}

.form-field label .optional {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 6px;
}

.form-field input,
.form-field textarea {
  width: 100%;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  transition: var(--transition);
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-field textarea {
  resize: vertical;
  min-height: 90px;
}

/* ==========================================
   GENERATE BUTTONS
   ========================================== */

.generate-btn {
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 24px;
  position: relative;
  overflow: hidden;
}

.generate-btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.generate-btn:hover::before {
  width: 300px;
  height: 300px;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.generate-btn:active {
  transform: translateY(0);
}

.generate-btn:disabled {
  background: var(--bg-tertiary);
  cursor: not-allowed;
  transform: none;
}

/* Sticky Mobile Button */
.sticky-generate {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(to top, var(--bg-primary) 80%, transparent);
  backdrop-filter: blur(10px);
  z-index: 1000;
  animation: slideUp 0.4s ease;
  display: none !important;
}

@media (max-width: 767px) {
  .sticky-generate {
    display: block !important;
  }
}

.generate-btn-mobile {
  width: 100%;
  padding: 16px 32px;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-hover));
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

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

/* Loading State */
.loader {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

/* ==========================================
   OUTPUT SECTION
   ========================================== */

.output-section {
  margin: 40px 0;
  animation: fadeIn 0.5s ease;
}

.output-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 0;
}

.output-tab {
  flex: 1;
  padding: 14px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.output-tab:hover {
  color: var(--text-primary);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}

.output-tab.active {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

.tab-icon {
  font-size: 1.2rem;
}

.tab-label {
  display: none;
}

.tab-content-container {
  position: relative;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-content.active {
  display: block;
}

.output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.output-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.copy-btn {
  padding: 8px 16px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.copy-btn:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.copy-btn.copied {
  background: var(--success);
  color: white;
  border-color: var(--success);
}

.copy-icon {
  font-size: 1rem;
}

.output-textarea {
  width: 100%;
  padding: 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: 'Inter', sans-serif;
  line-height: 1.7;
  resize: vertical;
  transition: var(--transition);
}

.output-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ==========================================
   ERROR MESSAGE
   ========================================== */

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--error);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 20px 0;
  color: var(--error);
  animation: shake 0.5s ease;
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

.mobile-only {
  display: block;
}

.desktop-only {
  display: none;
}

@media (min-width: 768px) {
  .mobile-only {
    display: none;
  }

  .desktop-only {
    display: block;
  }

  .tab-label {
    display: inline;
  }

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

  .main-app {
    padding: 40px;
  }

  .header {
    padding: 60px 0 80px;
  }

  .app-title {
    font-size: 3rem;
  }
}

/* ==========================================
   ANIMATIONS
   ========================================== */

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

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

@keyframes shake {
  0%, 100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

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