/* Music Video Generator - Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --link-color: #22d3ee;        /* Bright cyan for visibility on purple background */
  --link-hover: #06b6d4;        /* Darker cyan for hover */
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --error-color: #ef4444;
  --bg-dark: #1f2937;
  --bg-medium: #374151;
  --bg-light: #4b5563;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --border-color: #6b7280;
  --bg-primary: #111827;        /* Very dark background */
  --bg-secondary: #1f2937;      /* Dark background */
  --text-muted: #9ca3af;        /* Muted text */
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: var(--text-primary);
  min-height: 100vh;
  padding: 20px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* General link styling for visibility on purple background */
a {
  color: var(--link-color);
  text-decoration: none;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-dark);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  padding: 30px;
  text-align: center;
  border-bottom: 3px solid var(--primary-hover);
}

header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 1.1em;
  color: var(--text-secondary);
  opacity: 0.9;
}

main {
  padding: 30px;
}

/* Sections */
.config-section,
.input-section,
.status-section,
.results-section,
.log-section {
  background: var(--bg-medium);
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.config-section button {
  margin-top: 15px;
  width: 100%;
}

h2 {
  font-size: 1.5em;
  margin-bottom: 20px;
  color: var(--primary-color);
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 10px;
}

/* Input Groups */
.input-group {
  margin-bottom: 20px;
}

.input-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
}

.input-group input[type="text"],
.input-group textarea {
  width: 100%;
  padding: 12px;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.3s ease;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

.input-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* Buttons */
.button-group {
  display: flex;
  gap: 15px;
  margin-top: 25px;
}

.btn {
  padding: 12px 30px;
  font-size: 1.1em;
  font-weight: 600;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  flex: 1;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
  background: var(--bg-light);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--border-color);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Mode Toggle */
.mode-toggle {
  display: flex;
  gap: 0;
  background: var(--bg-medium);
  border-radius: 6px;
  padding: 4px;
}

.mode-btn {
  padding: 8px 20px;
  background: transparent;
  color: var(--text-secondary);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.mode-btn.active {
  background: var(--primary-color);
  color: white;
}

/* Tag Selectors */
.tag-category {
  margin-bottom: 20px;
}

.tag-category-label {
  color: #60a5fa;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  display: block;
}

.tag-category-desc {
  color: #9ca3af;
  font-size: 12px;
  margin-bottom: 10px;
  display: block;
}

.tag-select {
  width: 100%;
  padding: 10px;
  background: #111827;
  color: #f3f4f6;
  border: 1px solid #374151;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.tag-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.tag-select:hover {
  border-color: #4b5563;
}

/* Tag Radio Group */
.tag-radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 12px;
  background: #111827;
  border: 1px solid #374151;
  border-radius: 6px;
}

.tag-radio-label {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  color: #d1d5db;
  font-size: 14px;
  user-select: none;
}

.tag-radio-label:hover {
  background: #2d3748;
  border-color: #4b5563;
}

.tag-radio-label input[type="radio"] {
  margin: 0;
  margin-right: 8px;
  cursor: pointer;
  accent-color: var(--primary-color);
  width: 16px;
  height: 16px;
}

.tag-radio-label:has(input[type="radio"]:checked) {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--primary-color);
  color: #f3f4f6;
  font-weight: 500;
}

/* Tag Pills */
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--primary-color);
  color: white;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

.tag-pill .tag-category-badge {
  background: rgba(255, 255, 255, 0.2);
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tag-pill .tag-remove {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  transition: background 0.2s;
}

.tag-pill .tag-remove:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Tag Selection Counter */
.tag-selection-counter {
  transition: color 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  white-space: nowrap;
}

/* Status Box */
.status-box {
  padding: 15px 20px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1.05em;
  border: 2px solid;
}

.status-indicator {
  font-size: 1.5em;
  animation: pulse 2s ease-in-out infinite;
}

.status-idle {
  background: var(--bg-light);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.status-idle .status-indicator {
  color: var(--text-secondary);
  animation: none;
}

.status-processing {
  background: rgba(59, 130, 246, 0.1);
  border-color: #3b82f6;
  color: #93c5fd;
}

.status-processing .status-indicator {
  color: #3b82f6;
}

.status-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--success-color);
  color: #6ee7b7;
}

.status-success .status-indicator {
  color: var(--success-color);
  animation: none;
}

.status-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: var(--error-color);
  color: #fca5a5;
}

.status-error .status-indicator {
  color: var(--error-color);
  animation: none;
}

.status-warning {
  background: rgba(245, 158, 11, 0.1);
  border-color: var(--warning-color);
  color: #fcd34d;
}

.status-warning .status-indicator {
  color: var(--warning-color);
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Generation Spinner */
.generation-spinner {
  margin-top: 20px;
  padding: 20px;
  background: var(--bg-dark);
  border-radius: 12px;
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 20px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--border-color);
  border-top: 4px solid var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.generation-stage {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

#generation-stage-icon {
  font-size: 1.5em;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

#generation-stage-text {
  font-size: 1.1em;
  font-weight: 600;
  color: var(--text-primary);
}

/* Results Section */
.results-section pre {
  background: var(--bg-dark);
  padding: 15px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
  max-height: 400px;
  overflow-y: auto;
}

.results-section details {
  background: var(--bg-dark);
  padding: 10px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.results-section summary {
  font-weight: 600;
  color: var(--primary-color);
  padding: 5px;
}

.download-link {
  display: inline-block;
  margin: 5px 0;
  padding: 8px 16px;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s ease;
}

.download-link:hover {
  background: var(--primary-hover);
}

audio {
  width: 100%;
  margin-top: 10px;
  border-radius: 4px;
}

/* Log Box */
.log-box {
  background: var(--bg-dark);
  padding: 15px;
  border-radius: 6px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

.log-entry {
  padding: 4px 0;
  border-bottom: 1px solid rgba(107, 114, 128, 0.3);
}

.log-entry:last-child {
  border-bottom: none;
}

.log-info {
  color: #93c5fd;
}

.log-success {
  color: var(--success-color);
}

.log-warning {
  color: var(--warning-color);
}

.log-error {
  color: var(--error-color);
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-dark);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bg-light);
}

/* Preset Section */
.preset-section {
  background: var(--bg-medium);
  padding: 25px;
  margin-bottom: 20px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.preset-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

#preset-search {
  flex: 1;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 16px;
}

#preset-search:focus {
  outline: none;
  border-color: var(--primary-color);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  max-height: 500px;
  overflow-y: auto;
  padding: 5px;
}

.preset-card {
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.preset-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.preset-card.selected {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
}

.preset-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 10px;
}

.preset-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preset-card-badge {
  font-size: 10px;
  padding: 3px 8px;
  background: var(--primary-color);
  color: white;
  border-radius: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.preset-card-description {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.preset-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-tag {
  font-size: 11px;
  padding: 3px 8px;
  background: var(--bg-medium);
  color: var(--text-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-color);
}

.placeholder-control {
  margin-bottom: 15px;
}

.placeholder-control label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 14px;
}

.placeholder-control select {
  width: 100%;
  padding: 10px;
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-primary);
  font-size: 16px;
}

.placeholder-control select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Navigation Menu */
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  background: var(--bg-medium);
  border-bottom: 2px solid var(--border-color);
  padding: 0;
  align-items: center;
}

.nav-left {
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.nav-left .logo {
  margin: 0;
  padding: 15px 0;
  font-size: 1.5em;
  font-weight: 700;
  color: var(--primary-color);
}

.nav-center {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 5px;
}

.nav-right {
  display: flex;
  align-items: center;
  padding: 0 15px;
}

.nav-item {
  padding: 15px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
  font-weight: 500;
  white-space: nowrap;
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

.nav-item.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
}

/* Dashboard Styles */
.profile-card {
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: bold;
  color: white;
}

.profile-info h2 {
  margin: 0 0 5px 0;
  color: var(--text-primary);
  border: none;
  padding: 0;
}

.plan-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
}

.plan-free {
  background: #374151;
  color: #9ca3af;
}

.plan-web_pro, .plan-mobile_pro {
  background: rgba(99, 102, 241, 0.2);
  color: #6366f1;
}

.plan-enterprise {
  background: rgba(251, 191, 36, 0.2);
  color: #f59e0b;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
}

.stat-card {
  text-align: center;
  padding: 15px;
  background: var(--bg-dark);
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.stat-value {
  font-size: 32px;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.quick-actions {
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 25px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.quick-actions h2 {
  margin-bottom: 20px;
}

.action-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--bg-dark);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.3s ease;
}

.action-button:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.action-icon {
  font-size: 32px;
}

.action-title {
  font-weight: 600;
  margin-bottom: 5px;
}

.action-description {
  font-size: 13px;
  color: var(--text-secondary);
}

.recent-generations {
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 25px;
  border: 1px solid var(--border-color);
}

.recent-generations h2 {
  margin-bottom: 20px;
}

.generation-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
}

.generation-card:last-child {
  margin-bottom: 0;
}

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

.generation-status {
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.generation-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.generation-prompt {
  color: var(--text-primary);
  margin-bottom: 10px;
  font-size: 14px;
}

.generation-actions {
  margin-top: 10px;
}

/* History Page Styles */
.history-filters {
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border-color);
}

.history-list {
  background: var(--bg-medium);
  border-radius: 8px;
  padding: 25px;
  border: 1px solid var(--border-color);
}

.history-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s ease;
}

.history-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.2);
}

.history-card:last-child {
  margin-bottom: 0;
}

.history-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.history-status {
  padding: 6px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.history-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.history-content {
  margin-bottom: 15px;
}

.history-prompt {
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 8px;
  line-height: 1.5;
}

.history-preset {
  color: var(--primary-color);
  font-size: 13px;
  margin-bottom: 10px;
  font-weight: 500;
}

.history-details {
  display: flex;
  gap: 15px;
  font-size: 13px;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.history-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.btn-danger {
  background: var(--error-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

.loading-spinner {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  font-size: 16px;
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }

  header h1 {
    font-size: 1.8em;
  }

  main {
    padding: 15px;
  }

  .button-group {
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  h2 {
    font-size: 1.3em;
  }

  .config-section,
  .input-section,
  .status-section,
  .results-section,
  .preset-section,
  .log-section {
    padding: 20px;
  }

  .nav-menu {
    flex-wrap: wrap;
  }

  .nav-left,
  .nav-center,
  .nav-right {
    padding: 0 10px;
  }

  .nav-item {
    padding: 12px 15px;
    font-size: 14px;
  }
}

/* Mobile Phones (480px and below) */
@media (max-width: 480px) {
  body {
    padding: 8px;
  }

  header h1 {
    font-size: 1.5em;
  }

  .subtitle {
    font-size: 0.95em;
  }

  main {
    padding: 12px;
  }

  h2 {
    font-size: 1.2em;
    margin-bottom: 15px;
  }

  /* Sections - reduce padding for phones */
  .config-section,
  .input-section,
  .status-section,
  .results-section,
  .preset-section,
  .log-section {
    padding: 15px;
    margin-bottom: 15px;
  }

  /* Navigation - stack logo on top for more room */
  .nav-menu {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-left {
    width: 100%;
    justify-content: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
  }

  .nav-left .logo {
    font-size: 1.4em;
    padding: 8px 0;
  }

  .nav-center {
    width: 100%;
    justify-content: space-around;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0;
    gap: 0;
  }

  .nav-right {
    width: 100%;
    justify-content: center;
    padding: 10px 0;
    border-top: 1px solid var(--border-color);
  }

  .nav-item {
    padding: 14px 8px;
    font-size: 12px;
    white-space: nowrap;
    flex: 1;
    text-align: center;
    min-width: fit-content;
  }

  /* Preset grid - single column on phones */
  .preset-grid {
    grid-template-columns: 1fr;
    gap: 12px;
    max-height: 400px;
  }

  .preset-card {
    padding: 12px;
  }

  .preset-card-title {
    font-size: 15px;
  }

  .preset-card-description {
    font-size: 12px;
  }

  /* Tag radio group - 2 columns on phones */
  .tag-radio-group {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 10px;
  }

  .tag-radio-label {
    padding: 6px 10px;
    font-size: 13px;
  }

  /* Buttons - adjust sizing */
  .btn {
    padding: 10px 20px;
    font-size: 1em;
  }

  .mode-btn {
    padding: 6px 14px;
    font-size: 13px;
  }

  /* Input groups */
  .input-group {
    margin-bottom: 15px;
  }

  .input-group label {
    font-size: 14px;
    margin-bottom: 6px;
  }

  .input-group input[type="text"],
  .input-group textarea,
  .tag-select {
    padding: 10px;
    font-size: 16px;
  }

  .input-group textarea {
    min-height: 70px;
  }

  /* Preset category buttons */
  .preset-category-btn {
    padding: 6px 12px !important;
    font-size: 12px !important;
  }

  /* Tag pills */
  .tag-pill {
    padding: 5px 10px;
    font-size: 12px;
  }

  /* Model selector */
  .model-option {
    padding: 12px;
  }

  .model-name {
    font-size: 14px;
  }

  .model-description {
    font-size: 12px;
  }

  .model-cost {
    font-size: 12px;
  }

  /* Profile card */
  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-avatar {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }
}

/* Small phones (390px and below - iPhone 14/15 standard) */
@media (max-width: 390px) {
  header h1 {
    font-size: 1.4em;
  }

  h2 {
    font-size: 1.1em;
  }

  .config-section,
  .input-section,
  .status-section,
  .results-section,
  .preset-section,
  .log-section {
    padding: 12px;
  }

  .nav-left .logo {
    font-size: 1.3em;
  }

  .nav-item {
    padding: 12px 6px;
    font-size: 11px;
  }

  .preset-card-title {
    font-size: 14px;
  }

  .tag-radio-group {
    grid-template-columns: 1fr;
  }
}

/* Very small phones (375px and below - iPhone SE) */
@media (max-width: 375px) {
  body {
    padding: 5px;
  }

  main {
    padding: 10px;
  }

  .config-section,
  .input-section,
  .status-section,
  .results-section,
  .preset-section,
  .log-section {
    padding: 10px;
  }
}

/* ============================================================================
   Cover Page Styles
   ============================================================================ */

.page-header {
  padding: 40px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  border-bottom: 3px solid var(--primary-hover);
}

.page-header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.page-header p {
  font-size: 1.1em;
  color: var(--text-secondary);
}

.feature-explain {
  padding: 40px;
  background: var(--bg-medium);
}

.explain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.explain-card {
  background: var(--bg-dark);
  padding: 30px;
  border-radius: 12px;
  text-align: center;
  border: 2px solid var(--border-color);
  transition: transform 0.2s, border-color 0.2s;
}

.explain-card:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
}

.explain-icon {
  font-size: 3em;
  display: block;
  margin-bottom: 15px;
}

.explain-card h3 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.explain-card p {
  color: var(--text-secondary);
}

.cover-generator {
  padding: 40px;
}

.generator-card {
  background: var(--bg-medium);
  border-radius: 12px;
  padding: 30px;
}

.generator-step {
  margin-bottom: 40px;
}

.generator-step h2 {
  margin-bottom: 20px;
  color: var(--primary-color);
}

/* Upload Zone */
.upload-zone {
  border: 3px dashed var(--border-color);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.3s, background 0.3s;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-zone:hover {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.05);
}

.upload-zone.drag-over {
  border-color: var(--success-color);
  background: rgba(16, 185, 129, 0.1);
}

.upload-placeholder .upload-icon {
  font-size: 4em;
  display: block;
  margin-bottom: 20px;
}

.upload-placeholder p {
  font-size: 1.2em;
  margin-bottom: 10px;
}

.upload-placeholder small {
  color: var(--text-secondary);
}

.upload-preview {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

.upload-preview audio {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.upload-info {
  text-align: center;
}

.upload-info p {
  margin-bottom: 10px;
  font-size: 1.1em;
}

/* Preset Selector */
.preset-selector {
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 20px;
}

.preset-search input {
  width: 100%;
  padding: 12px 20px;
  background: var(--bg-medium);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1em;
  margin-bottom: 20px;
}

.preset-search input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.preset-list {
  max-height: 300px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.preset-item {
  background: var(--bg-medium);
  padding: 15px 20px;
  border-radius: 8px;
  margin-bottom: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
}

.preset-item:hover {
  background: var(--bg-light);
}

.preset-item.selected {
  border-color: var(--primary-color);
  background: rgba(99, 102, 241, 0.1);
}

.preset-item h4 {
  margin-bottom: 5px;
}

.preset-item p {
  color: var(--text-secondary);
  font-size: 0.9em;
}

.selected-preset {
  background: var(--primary-color);
  padding: 20px;
  border-radius: 8px;
  margin-top: 20px;
}

.selected-preset h3 {
  margin-bottom: 10px;
}

.selected-preset p {
  margin-bottom: 15px;
  opacity: 0.9;
}

.preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-tags .tag {
  background: rgba(255, 255, 255, 0.2);
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.9em;
}

/* Denoise Control */
.denoise-control {
  background: var(--bg-dark);
  border-radius: 12px;
  padding: 30px;
}

.denoise-slider {
  margin-bottom: 30px;
}

.denoise-slider input[type="range"] {
  width: 100%;
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  outline: none;
  margin-bottom: 15px;
}

.denoise-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 24px;
  height: 24px;
  background: var(--primary-color);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.denoise-slider input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.denoise-labels {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
  font-size: 0.9em;
}

.denoise-display {
  text-align: center;
}

.denoise-value {
  font-size: 3em;
  font-weight: bold;
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 10px;
}

.denoise-label {
  font-size: 0.4em;
  font-weight: normal;
  color: var(--text-primary);
  margin-top: 5px;
}

.denoise-description {
  color: var(--text-secondary);
  font-size: 1em;
}

/* Generator Actions */
.generator-actions {
  text-align: center;
  padding-top: 20px;
}

.generator-actions .btn-primary {
  padding: 15px 50px;
  font-size: 1.2em;
  margin-bottom: 15px;
}

.cost-info {
  color: var(--text-secondary);
  font-size: 0.9em;
}

/* Generation Status */
.generation-status {
  background: var(--bg-medium);
  border-radius: 12px;
  padding: 30px;
  margin-top: 30px;
  text-align: center;
}

.status-card h3 {
  margin-bottom: 20px;
  font-size: 1.5em;
}

.status-card p {
  color: var(--text-secondary);
}

/* Generation Result */
.generation-result {
  background: var(--success-color);
  border-radius: 12px;
  padding: 30px;
  margin-top: 30px;
  text-align: center;
}

.generation-result h3 {
  margin-bottom: 20px;
  font-size: 1.5em;
}

.generation-result audio {
  width: 100%;
  max-width: 600px;
  margin: 20px auto;
}

.result-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  margin-top: 20px;
}

/* Tips Section */
.tips-section {
  padding: 40px;
  background: var(--bg-dark);
}

.tips-section h2 {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
}

.tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.tip-card {
  background: var(--bg-medium);
  padding: 25px;
  border-radius: 12px;
  border-left: 4px solid var(--primary-color);
}

.tip-card h4 {
  margin-bottom: 10px;
  color: var(--primary-color);
}

.tip-card p {
  color: var(--text-secondary);
  font-size: 0.95em;
}
/* Model Selector Styles */
.model-selector {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

.model-option {
  display: block;
  width: 100%;
  padding: 15px;
  background: #1f2937;
  border: 2px solid #374151;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: left;
}

.model-option:hover {
  border-color: #6366f1;
  background: #252f3f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.2);
}

.model-option.active {
  border-color: #6366f1;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.model-option.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  border-color: #4b5563;
}

.model-option.disabled:hover {
  border-color: #4b5563;
  background: #1f2937;
  transform: none;
  box-shadow: none;
}

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

.model-name {
  font-size: 16px;
  font-weight: 600;
  color: #f3f4f6;
}

.model-badge {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.model-badge.recommended {
  background: #6366f1;
  color: #fff;
}

.model-badge.fast {
  background: #10b981;
  color: #fff;
}

.model-badge.premium {
  background: #f59e0b;
  color: #000;
}

.model-description {
  font-size: 13px;
  color: #9ca3af;
  margin-bottom: 8px;
  line-height: 1.4;
}

.model-cost {
  font-size: 14px;
  font-weight: 600;
  color: #60a5fa;
}

/* Modal Base Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(5px);
}

.modal-content {
  background: #1f2937;
  border-radius: 12px;
  max-width: 90%;
  max-height: 90vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: modalSlideIn 0.3s ease-out;
}

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

.modal-header {
  padding: 20px 25px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  margin: 0;
  padding: 0;
  border: none;
  color: #fff;
  font-size: 20px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #fff;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}

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

.modal-body {
  padding: 25px;
  color: #d1d5db;
}

/* Tier Badge Styles */
.tier-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.tier-badge.free {
  background: #6b7280;
  color: #fff;
}

.tier-badge.pro {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
}

.tier-badge.creator {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
}

/* Button Text Style */
.btn-text {
  background: none;
  border: none;
  color: #6366f1;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 4px;
  transition: all 0.2s;
}

.btn-text:hover {
  background: rgba(99, 102, 241, 0.1);
  color: #818cf8;
}
/* Pricing Section Styles */
.pricing-section {
  background: var(--bg-medium);
  padding: 40px 25px;
  margin-bottom: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.pricing-section h2 {
  text-align: center;
  font-size: 2em;
  margin-bottom: 10px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 30px;
}

.pricing-card {
  background: #1f2937;
  border: 2px solid #374151;
  border-radius: 12px;
  padding: 30px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.pricing-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.pricing-card.popular {
  border-color: #6366f1;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.pricing-card.current {
  border-color: #10b981;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.1) 100%);
}

.popular-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  padding: 6px 20px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.pricing-header {
  text-align: center;
  margin-bottom: 25px;
  padding-bottom: 25px;
  border-bottom: 1px solid #374151;
}

.pricing-header h3 {
  font-size: 1.8em;
  color: #f3f4f6;
  margin-bottom: 15px;
}

.pricing-price {
  margin: 20px 0;
}

.price-amount {
  font-size: 3em;
  font-weight: 700;
  color: #fff;
}

.price-period {
  font-size: 1em;
  color: #9ca3af;
  margin-left: 5px;
}

.pricing-description {
  color: #9ca3af;
  font-size: 0.95em;
  margin-top: 10px;
}

.pricing-features {
  flex: 1;
  margin-bottom: 25px;
}

.feature-item {
  padding: 12px 0;
  color: #d1d5db;
  font-size: 0.95em;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
}

.feature-item:last-child {
  border-bottom: none;
}

.pricing-button {
  width: 100%;
  padding: 15px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1.05em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pricing-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.pricing-button.current-plan {
  background: #10b981;
  cursor: default;
}

.pricing-button.current-plan:hover {
  background: #10b981;
  transform: none;
  box-shadow: none;
}

.pricing-button.downgrade {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.pricing-button.downgrade:hover {
  background: linear-gradient(135deg, #4b5563, #374151);
}

.pricing-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.tier-free .pricing-header h3 {
  color: #9ca3af;
}

.tier-pro .pricing-header h3 {
  color: #818cf8;
}

.tier-creator .pricing-header h3 {
  color: #fbbf24;
}

.plan-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.plan-badge.plan-free {
  background: #6b7280;
  color: #fff;
}

.plan-badge.plan-pro {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
}

.plan-badge.plan-creator {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #000;
  font-weight: 800;
}

/* Site Footer */
.site-footer {
  background: var(--bg-dark);
  border-top: 2px solid var(--border-color);
  padding: 40px 20px 20px;
  margin-top: 60px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 30px;
}

.footer-section h4 {
  color: var(--primary-color);
  margin-bottom: 15px;
  font-size: 1.1em;
}

.footer-section a {
  display: block;
  color: var(--link-color);
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.2s, transform 0.2s;
  font-size: 0.95em;
}

.footer-section a:hover {
  color: var(--link-hover);
  transform: translateX(3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.9em;
}

.footer-bottom p {
  margin: 5px 0;
}

/* Responsive footer */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 25px;
  }
  
  .site-footer {
    padding: 30px 15px 15px;
    margin-top: 40px;
  }
}

/* ===================================== */
/* VIDEO GENERATION STYLES               */
/* ===================================== */

/* Video Preset Grid */
.video-preset-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* Video Preset Card */
.video-preset-card {
  background: var(--bg-secondary);
  border-radius: 12px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.video-preset-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

/* Video Preset Thumbnail */
.video-preset-thumbnail {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-preset-thumbnail::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.3);
}

.video-preset-icon {
  font-size: 4em;
  z-index: 1;
  position: relative;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.5));
}

/* Video Preset Info */
.video-preset-info {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.video-preset-info h4 {
  color: var(--text-primary);
  margin: 0 0 10px 0;
  font-size: 1.2em;
}

.video-preset-info p {
  color: var(--text-secondary);
  font-size: 0.9em;
  line-height: 1.5;
  margin-bottom: 15px;
  flex: 1;
}

/* Video Preset Tags */
.video-preset-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 15px;
}

.video-preset-tags .tag {
  background: rgba(99, 102, 241, 0.2);
  color: var(--primary-color);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Video Preset Cost */
.video-preset-cost {
  color: var(--warning-color);
  font-weight: 700;
  font-size: 1.1em;
  margin-bottom: 15px;
}

.video-preset-card .btn {
  width: 100%;
  margin: 0 20px 20px 20px;
  width: calc(100% - 40px);
}

/* Video Progress Bar */
.video-progress-bar-container {
  width: 100%;
  height: 24px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.video-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 12px;
  transition: width 0.5s ease;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 0.85em;
}

.video-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, 
    transparent, 
    rgba(255, 255, 255, 0.3), 
    transparent
  );
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* Video Result Section */
#video-result-section video {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Responsive Video Grid */
@media (max-width: 768px) {
  .video-preset-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .video-preset-thumbnail {
    height: 120px;
  }
  
  .video-preset-icon {
    font-size: 3em;
  }
}
/* Filter Chip Styles */
.filter-chip {
  padding: 8px 16px;
  border: 1px solid #4b5563;
  border-radius: 20px;
  background: #374151;
  color: #d1d5db;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip:hover {
  background: #4b5563;
  border-color: #667eea;
}

.filter-chip.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  font-weight: 500;
}

.filter-chip[data-filter-type="clear"] {
  background: #1f2937;
  border-color: #6b7280;
  color: #9ca3af;
}

.filter-chip[data-filter-type="clear"]:hover {
  background: #374151;
  border-color: #9ca3af;
}

/* Template Card Styles */
.template-card {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 12px;
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
  border-color: #667eea;
}

.template-card-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 12px;
}

.template-card-title {
  font-size: 16px;
  font-weight: 600;
  color: #f9fafb;
  margin: 0 0 8px 0;
}

.template-card-badge {
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  background: rgba(102, 126, 234, 0.2);
  color: #a5b4fc;
  white-space: nowrap;
}

.template-card-language-badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: #374151;
  color: #9ca3af;
  white-space: nowrap;
  text-transform: uppercase;
}

.template-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  color: #9ca3af;
}

.template-card-tag {
  padding: 3px 8px;
  background: #1f2937;
  border-radius: 4px;
  font-size: 11px;
}

.template-card-preview {
  font-size: 13px;
  color: #d1d5db;
  line-height: 1.5;
  max-height: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  font-family: monospace;
  margin-bottom: 12px;
}

.template-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 12px;
  border-top: 1px solid #4b5563;
  font-size: 12px;
  color: #9ca3af;
}

.template-card-footer .word-count {
  display: flex;
  align-items: center;
  gap: 4px;
}

.template-card-footer .usage {
  display: flex;
  align-items: center;
  gap: 4px;
}