/* AI Melody Studio - CSS Design System */

:root {
  /* Dark Theme Variables */
  --bg-app: #03010b;
  --bg-sidebar: #070514;
  --bg-panel: rgba(15, 11, 32, 0.7);
  --bg-card: rgba(22, 17, 46, 0.6);
  --bg-input: rgba(10, 7, 24, 0.8);
  
  --border-color: rgba(168, 85, 247, 0.15);
  --border-active: rgba(236, 72, 153, 0.5);
  
  --text-main: #f3f1f8;
  --text-muted: #9c92b8;
  --text-glow: #e879f9;
  
  /* Shared Gradients & Glows */
  --grad-primary: linear-gradient(135deg, #d946ef 0%, #8b5cf6 50%, #06b6d4 100%);
  --grad-pink-purple: linear-gradient(135deg, #ec4899 0%, #a855f7 100%);
  --grad-cyan-blue: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --grad-accent-btn: linear-gradient(90deg, #ec4899 0%, #8b5cf6 50%, #d946ef 100%);
  
  --glow-pink: 0 0 15px rgba(236, 72, 153, 0.4);
  --glow-purple: 0 0 15px rgba(139, 92, 246, 0.4);
  --glow-cyan: 0 0 15px rgba(6, 182, 212, 0.4);
  --shadow-glass: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Theme Variables Toggle */
body.light-theme {
  --bg-app: #f4f3fa;
  --bg-sidebar: #eae6f4;
  --bg-panel: rgba(240, 238, 250, 0.85);
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-input: rgba(255, 255, 255, 1);
  
  --border-color: rgba(139, 92, 246, 0.2);
  --border-active: rgba(139, 92, 246, 0.6);
  
  --text-main: #17122b;
  --text-muted: #6b6382;
  --text-glow: #8b5cf6;
  
  --shadow-glass: 0 8px 32px 0 rgba(100, 100, 150, 0.1);
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Montserrat', 'Noto Sans Thai', sans-serif;
  scrollbar-width: thin;
  scrollbar-color: var(--border-active) var(--bg-sidebar);
}

/* Custom Scrollbars */
*::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
*::-webkit-scrollbar-track {
  background: var(--bg-sidebar);
}
*::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
}
*::-webkit-scrollbar-thumb:hover {
  background: var(--border-active);
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  position: relative;
  transition: var(--transition-smooth);
}

/* Main Layout Grid */
.app-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  height: 100vh;
  width: 100vw;
  position: relative;
  z-index: 2;
}

/* Column 1: Sidebar styling */
.sidebar {
  background-color: var(--bg-sidebar);
  border-right: 1px solid var(--border-color);
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  transition: var(--transition-smooth);
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.logo-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glass);
}

.pulse-logo {
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0% { filter: drop-shadow(0 0 2px rgba(236, 72, 153, 0.3)); }
  50% { filter: drop-shadow(0 0 8px rgba(168, 85, 247, 0.8)); }
  100% { filter: drop-shadow(0 0 2px rgba(236, 72, 153, 0.3)); }
}

.brand-info h1 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: var(--grad-pink-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-info p {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex-grow: 1;
}

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 10px;
  transition: var(--transition-smooth);
  border: 1px solid transparent;
}

.sidebar-nav li a:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.sidebar-nav li.active a {
  color: var(--text-main);
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%);
  border: 1px solid var(--border-active);
  box-shadow: inset 0 0 10px rgba(168, 85, 247, 0.1);
}

.sidebar-nav li.active svg {
  color: #e879f9;
  filter: drop-shadow(0 0 5px #e879f9);
}

/* Sidebar Footer & Status */
.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.model-status-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px;
}

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

.model-name {
  font-size: 11px;
  font-weight: 600;
}

.status-badge {
  font-size: 9px;
  font-weight: 700;
  color: #10b981;
  display: flex;
  align-items: center;
  gap: 4px;
}

.status-badge .dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  display: inline-block;
}

.status-badge .dot.pulse {
  animation: status-pulse 1.5s infinite;
}

@keyframes status-pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.5); opacity: 0.4; }
  100% { transform: scale(1); opacity: 1; }
}

.api-label {
  font-size: 10px;
  color: var(--text-muted);
}

.upgrade-btn {
  background: var(--grad-accent-btn);
  border: none;
  border-radius: 10px;
  padding: 12px;
  color: #fff;
  font-weight: 600;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--glow-pink);
}

.upgrade-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.7);
}

/* Sidebar Mini Player */
.mini-player {
  background: rgba(10, 7, 24, 0.9);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: grid;
  grid-template-columns: 44px 1fr;
  grid-template-rows: auto auto;
  gap: 8px;
}

.mini-cover {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-color);
  grid-row: span 2;
}

.mini-track-info h4 {
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-track-info p {
  font-size: 9px;
  color: var(--text-muted);
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mini-player-controls button {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.mini-player-controls button:hover {
  color: var(--text-main);
}

.play-btn-circle {
  background: var(--text-main) !important;
  color: var(--bg-app) !important;
  width: 24px;
  height: 24px;
  border-radius: 50% !important;
}

.mini-volume-control {
  grid-column: span 2;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--text-muted);
}

/* Column 2: Center Workspace styling */
.workspace {
  background-image: radial-gradient(circle at 50% 10%, rgba(139, 92, 246, 0.08) 0%, rgba(3, 1, 11, 0) 60%);

  padding: 24px 30px;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.workspace-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.workspace-title h2 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.workspace-title p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dropdown-wrapper select {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
}

.dropdown-wrapper {
  position: relative;
}

.dropdown-wrapper::after {
  content: '▾';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  font-size: 10px;
}

.theme-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.theme-btn:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #f87171;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 13px;
  border-radius: 9px;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-family: 'Montserrat', 'Noto Sans Thai', sans-serif;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.6);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

.avatar-glow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  padding: 2px;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-purple);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--bg-app);
}

/* Panel Navigation Tabs */
.panel-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  margin-bottom: 24px;
}

.panel-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 8px;
  transition: var(--transition-smooth);
}

.panel-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.panel-tab.active {
  color: var(--text-main);
  background: rgba(139, 92, 246, 0.15);
  box-shadow: inset 0 0 10px rgba(139, 92, 246, 0.1);
  border: 1px solid var(--border-color);
}

/* Tab Panel visibility */
.tab-panel {
  display: none;
  animation: fadeIn 0.4s ease-in-out forwards;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

/* Prompt Box Area */
.prompt-input-wrapper {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow-glass);
}

.prompt-textarea-container {
  position: relative;
  width: 100%;
}

.prompt-textarea-container textarea {
  width: 100%;
  height: 100px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 50px 14px 14px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  outline: none;
  resize: none;
  transition: var(--transition-smooth);
}

.prompt-textarea-container textarea:focus {
  border-color: #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.sparkle-btn {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.sparkle-btn:hover {
  transform: scale(1.08);
  border-color: #00f2fe;
  box-shadow: var(--glow-cyan);
}

.char-counter {
  position: absolute;
  right: 16px;
  bottom: -22px;
  font-size: 10px;
  color: var(--text-muted);
}

.quick-tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.quick-tag {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.quick-tag:hover {
  color: var(--text-main);
  background: rgba(168, 85, 247, 0.1);
  border-color: var(--border-active);
}

/* Sections Styling */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-title-row h3 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.more-link {
  font-size: 11px;
  color: var(--text-glow);
  text-decoration: none;
  font-weight: 600;
}

/* Genres Grid */
.genres-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.genre-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 12px;
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.genre-item:hover {
  transform: translateY(-2px);
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.genre-item.active {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  box-shadow: var(--glow-pink);
}

.genre-icon {
  font-size: 16px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.genre-item span:last-child {
  font-size: 11px;
  font-weight: 600;
}

/* Genre gradients backgrounds */
.pink-grad { background: rgba(236, 72, 153, 0.15); }
.red-grad { background: rgba(239, 68, 68, 0.15); }
.yellow-grad { background: rgba(245, 158, 11, 0.15); }
.purple-grad { background: rgba(139, 92, 246, 0.15); }
.blue-grad { background: rgba(59, 130, 246, 0.15); }
.orange-grad { background: rgba(249, 115, 22, 0.15); }
.cyan-grad { background: rgba(6, 182, 212, 0.15); }
.gold-grad { background: rgba(212, 175, 55, 0.15); }
.brown-grad { background: rgba(160, 82, 45, 0.15); }
.white-grad { background: rgba(255, 255, 255, 0.15); }

/* Moods Container */
.moods-container {
  display: flex;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  padding: 16px;
  border-radius: 16px;
}

.mood-item {
  background: transparent;
  border: none;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.emoji-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: var(--transition-smooth);
}

.mood-item span {
  font-size: 11px;
  font-weight: 500;
}

.mood-item:hover .emoji-circle {
  transform: scale(1.1);
  border-color: var(--border-active);
}

.mood-item.active {
  color: var(--text-main);
}

.mood-item.active .emoji-circle {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Instruments Grid */
.instruments-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.instrument-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: left;
}

.instrument-item:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.instrument-item.active {
  border-color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.3);
}

.instrument-icon {
  font-size: 18px;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  align-items: center;
  justify-content: center;
}

.instrument-name h4 {
  font-size: 11px;
  font-weight: 600;
}

.instrument-name p {
  font-size: 8px;
  color: var(--text-muted);
}

.add-more {
  justify-content: center;
  color: var(--text-muted);
}

.add-more .plus {
  background: transparent;
  font-size: 20px;
  border: 1px dashed var(--border-color);
}

/* Parameters (BPM / Key / Energy) */
.parameters-grid {
  display: grid;
  grid-template-columns: 1fr 120px 1fr;
  gap: 14px;
}

.param-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.param-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
}

.param-value-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  background: rgba(168, 85, 247, 0.15);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
}

.slider-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.bpm-adjust-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 26px;
  height: 26px;
  border-radius: 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* Custom Input Sliders */
.custom-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  cursor: pointer;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 8px #a855f7;
  cursor: pointer;
  transition: transform 0.1s;
}

.custom-slider::-webkit-slider-thumb:hover {
  transform: scale(1.3);
}

/* Specialized sliders colors */
.custom-slider.energy {
  background: linear-gradient(to right, #00f2fe, #4facfe 50%, #ec4899);
}

.custom-slider.energy::-webkit-slider-thumb {
  background: #06b6d4;
  box-shadow: 0 0 8px #06b6d4;
}

.custom-slider.timeline {
  height: 4px;
}

.custom-slider.timeline::-webkit-slider-thumb {
  width: 10px;
  height: 10px;
  background: #ec4899;
  box-shadow: 0 0 6px #ec4899;
}

.key-selector-dropdown select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  cursor: pointer;
}

/* Main Generate Action Button */
.generate-action-container {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.main-generate-btn {
  background: var(--grad-primary);
  border: none;
  border-radius: 16px;
  padding: 16px 40px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
  transition: var(--transition-smooth);
}

.main-generate-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 80%);
  opacity: 0;
  transition: opacity 0.3s;
}

.main-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.6);
}

.main-generate-btn:hover::after {
  opacity: 1;
}

.random-generate-btn {
  background: var(--grad-cyan-blue);
  border: none;
  border-radius: 16px;
  padding: 16px 40px;
  color: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(6, 182, 212, 0.4);
  transition: var(--transition-smooth);
}

.random-generate-btn::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.2) 0%, transparent 80%);
  opacity: 0;
  transition: opacity 0.3s;
}

.random-generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.6);
}

.random-generate-btn:hover::after {
  opacity: 1;
}

.dice-icon {
  margin-bottom: 2px;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.random-generate-btn:hover .dice-icon {
  transform: rotate(180deg) scale(1.15);
}

.sparkle-icon {
  margin-bottom: 2px;
}

#generate-btn-text, #random-generate-btn-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-subtext {
  font-size: 9px;
  opacity: 0.8;
}

/* Column 3: Right Console styling */
.console {
  background-color: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
}

.console-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.console-title-container {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.console-title-container h3 {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 0;
  color: var(--text-main);
}

.console-logo {
  color: #a855f7;
  filter: drop-shadow(0 0 4px rgba(168, 85, 247, 0.4));
}

.console-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.console-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.console-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-active);
  color: var(--text-main);
  box-shadow: 0 0 10px rgba(236, 72, 153, 0.2);
}

.console-action-btn svg {
  transition: transform 0.2s ease;
}

.console-action-btn:hover svg {
  transform: scale(1.1);
}

.console-tabs {
  display: flex;
  background: var(--bg-input);
  border-radius: 10px;
  padding: 4px;
  border: 1px solid var(--border-color);
}

.console-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.console-tab.active {
  background: var(--bg-card);
  color: var(--text-main);
  box-shadow: var(--shadow-glass);
}

.console-content {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Meta Details Grid */
.meta-details-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 10px;
}

.meta-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.meta-cell:not(:last-child) {
  border-right: 1px solid var(--border-color);
  padding-right: 8px;
}

.meta-cell:not(:first-child) {
  padding-left: 8px;
}

.cell-label {
  font-size: 9px;
  color: var(--text-muted);
  font-weight: 600;
}

.cell-val {
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.ai-badge {
  background: var(--grad-pink-purple);
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  color: white;
}

.text-glow-cyan {
  color: #06b6d4;
  text-shadow: 0 0 5px rgba(6, 182, 212, 0.4);
}

/* Console Cards */
.console-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-glass);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h4 {
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.purple-dot {
  width: 6px;
  height: 6px;
  background-color: #a855f7;
  border-radius: 50%;
  box-shadow: 0 0 6px #a855f7;
}

.cyan-dot {
  width: 6px;
  height: 6px;
  background-color: #06b6d4;
  border-radius: 50%;
  box-shadow: 0 0 6px #06b6d4;
}

.copy-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.copy-action-btn:hover {
  color: var(--text-main);
  border-color: var(--border-active);
}

.prompt-text-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 12px;
  max-height: 100px;
  overflow-y: auto;
}

.prompt-text-box p {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.6;
  color: var(--text-main);
  word-break: break-all;
}

.advanced-settings-trigger {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  padding: 6px 0;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  margin-top: 6px;
  transition: var(--transition-smooth);
}

.advanced-settings-trigger:hover {
  color: var(--text-main);
}

.advanced-settings-trigger .chevron-down {
  transition: transform 0.3s ease;
}

.advanced-settings-drawer {
  margin-top: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.advanced-settings-drawer label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.advanced-settings-drawer input[type="text"] {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--text-main);
  font-size: 11px;
  outline: none;
  width: 100%;
  transition: var(--transition-smooth);
}

.advanced-settings-drawer input[type="text"]:focus {
  border-color: var(--border-active);
  box-shadow: 0 0 8px rgba(236, 72, 153, 0.15);
}

.advanced-settings-drawer select {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 6px 10px;
  color: var(--text-main);
  font-size: 11px;
  outline: none;
  cursor: pointer;
  width: 120px;
  transition: var(--transition-smooth);
}

.advanced-settings-drawer select:focus {
  border-color: var(--border-active);
}

.drawer-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.drawer-field-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

/* Result Song Card & Player */
.result-song-card {
  border-color: rgba(6, 182, 212, 0.2);
}

.creation-status {
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
}

.creation-status.success { color: #10b981; }

.dot.pulse-cyan {
  width: 6px;
  height: 6px;
  background-color: #06b6d4;
  border-radius: 50%;
  animation: cyan-pulse 1.5s infinite;
}

@keyframes cyan-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0.7); }
  70% { transform: scale(1.2); box-shadow: 0 0 0 6px rgba(6, 182, 212, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(6, 182, 212, 0); }
}

.visualizer-container {
  background: rgba(10, 7, 24, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  height: 80px;
  overflow: hidden;
  position: relative;
}

#waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.audio-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.player-control-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.player-control-btn:hover {
  background: var(--text-main);
  color: var(--bg-app);
}

.player-control-btn.play {
  background: var(--grad-pink-purple);
  border: none;
  width: 36px;
  height: 36px;
  box-shadow: var(--glow-pink);
}

.player-control-btn.play:hover {
  transform: scale(1.05);
}

.timeline-container {
  flex-grow: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-display {
  font-size: 10px;
  color: var(--text-muted);
  width: 30px;
}

.player-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 34px;
  gap: 8px;
  margin-top: 12px;
}

.player-action-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.player-action-btn:hover {
  color: var(--text-main);
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.player-action-btn.icon-only {
  padding: 8px 0;
}

/* Recent Tracks styling */
.recent-tracks-card {
  flex-grow: 1;
}

.recent-tracks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
}

.track-item {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.track-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border-color);
}

.track-item.active {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
}

.track-img-container {
  width: 46px;
  height: 46px;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.track-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: white;
  transition: var(--transition-smooth);
}

.track-item:hover .play-overlay {
  opacity: 1;
}

.track-details h5 {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 2px;
}

.track-details p {
  font-size: 9px;
  color: var(--text-muted);
}

.track-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.track-duration {
  font-size: 9px;
  color: var(--text-muted);
}

/* Mini pulsing music waves */
.mini-wave-animation {
  display: none;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.track-item.active .mini-wave-animation {
  display: flex;
}

.track-item.active .track-duration {
  display: none;
}

.mini-wave-animation span {
  width: 2px;
  background-color: #ec4899;
  border-radius: 1px;
  animation: mini-wave 0.8s ease-in-out infinite alternate;
}

.mini-wave-animation span:nth-child(1) { height: 10px; animation-delay: 0.1s; }
.mini-wave-animation span:nth-child(2) { height: 6px; animation-delay: 0.3s; }
.mini-wave-animation span:nth-child(3) { height: 8px; animation-delay: 0.2s; }
.mini-wave-animation span:nth-child(4) { height: 4px; animation-delay: 0.4s; }

@keyframes mini-wave {
  from { height: 2px; }
  to { height: 10px; }
}

/* Bottom visualizer overlay bar */
.footer-visualizer-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 30px;
  z-index: 1;
  pointer-events: none;
  opacity: 0.7;
}

#footer-visualizer-canvas {
  width: 100%;
  height: 100%;
}

/* Loading Spinner Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(3, 1, 11, 0.95);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  animation: fadeIn 0.3s ease-in-out;
}

.loading-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid rgba(168, 85, 247, 0.1);
  border-top-color: #ec4899;
  border-bottom-color: #06b6d4;
  border-radius: 50%;
  animation: spin 1s infinite linear;
  box-shadow: var(--glow-pink);
}

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

.loading-spinner-box h3 {
  font-size: 16px;
  font-weight: 700;
}

.loading-spinner-box p {
  font-size: 12px;
  color: var(--text-muted);
}

/* Toast System */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 200;
}

.toast {
  background: rgba(15, 11, 32, 0.95);
  color: var(--text-main);
  border: 1px solid #10b981;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  animation: slideInRight 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

/* Lyrics & Advanced Tabs Styling */
.lyrics-view-container {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.lyrics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lyrics-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.glass-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.glass-btn:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: var(--border-active);
}

.lyrics-scroll-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 18px;
  height: 380px;
  overflow-y: auto;
  line-height: 1.8;
  font-size: 13px;
  white-space: pre-line;
}

.placeholder-text {
  color: var(--text-muted);
  text-align: center;
  margin-top: 100px;
}

.lyrics-section-tag {
  color: #e879f9;
  font-weight: 700;
  margin: 14px 0 6px 0;
  display: block;
}

.advanced-settings-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.advanced-settings-panel h3 {
  font-size: 15px;
  font-weight: 700;
}

.settings-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-item label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.radio-toggle {
  display: flex;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  width: 100%;
}

.toggle-option {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.toggle-option.active {
  background: var(--bg-card);
  color: var(--text-main);
}

.custom-select-full {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 10px;
  border-radius: 8px;
  outline: none;
  font-size: 12px;
}

.structure-blocks {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.structure-block {
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border-color);
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
}

.export-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.export-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-main);
}

.export-card:hover {
  transform: translateY(-3px);
  border-color: var(--border-active);
}

.export-icon {
  font-size: 24px;
  display: block;
  margin-bottom: 12px;
}

.export-card h4 {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 4px;
}

.export-card p {
  font-size: 9px;
  color: var(--text-muted);
}

/* Responsive Breakpoints */
@media (max-width: 1300px) {
  .app-container {
    grid-template-columns: 240px 1fr;
  }
  .genres-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1024px) {
  .app-container {
    grid-template-columns: 80px 1fr;
  }
  .sidebar {
    padding: 18px 10px;
    align-items: center;
  }
  .brand-info, .sidebar-nav li span, .model-status-card, .upgrade-btn span, .mini-player {
    display: none;
  }
}

/* Custom SVG vector icons color transitions */
.genre-icon svg {
  color: var(--text-main);
  transition: var(--transition-smooth);
}

.genre-item.active .genre-icon svg {
  color: #ec4899;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.4));
}

.emoji-circle svg {
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.mood-item:hover .emoji-circle svg {
  color: var(--text-main);
}

.mood-item.active .emoji-circle svg {
  color: #ec4899;
  filter: drop-shadow(0 0 6px rgba(236, 72, 153, 0.7));
}

.instrument-icon svg {
  color: var(--text-muted);
  transition: var(--transition-smooth);
}

.instrument-item:hover .instrument-icon svg,
.instrument-item.active .instrument-icon svg {
  color: var(--text-main);
}

.instrument-item.active .instrument-icon svg {
  color: #ec4899;
  filter: drop-shadow(0 0 4px rgba(236, 72, 153, 0.4));
}

.quick-tag svg {
  color: var(--text-muted);
  transition: var(--transition-smooth);
  margin-right: 2px;
  vertical-align: middle;
}

.quick-tag:hover svg {
  color: var(--text-main);
}

.quick-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================
   17. GEMINI API KEY SETTINGS PAGE STYLES
   ========================================== */

/* Active settings layout changes */
body.settings-active .app-container {
  grid-template-columns: 260px 1fr !important;
}

.settings-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.4s ease-in-out forwards;
}

.settings-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-glass);
}

.settings-card h4 {
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.new-key-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.3px;
}

.api-input-wrapper {
  position: relative;
  width: 100%;
  display: flex;
}

.api-input-wrapper input {
  width: 100%;
  padding: 12px 50px 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px;
  outline: none;
  transition: var(--transition-smooth);
}

.api-input-wrapper input:focus {
  border-color: #a855f7;
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

.visibility-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
}

.visibility-btn:hover {
  color: var(--text-main);
}

.visibility-btn svg {
  pointer-events: none;
}

.form-actions-row {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 10px;
}

.glass-btn.test-btn {
  padding: 12px 20px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.save-key-btn {
  padding: 12px 24px;
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 10px;
  background: var(--grad-accent-btn);
  color: #fff;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: var(--glow-pink);
}

.save-key-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.7);
}

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

.reset-keys-btn {
  padding: 8px 14px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
}

.keys-table-container {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.12);
}

.keys-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 12px;
}

.keys-table th, .keys-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

.keys-table th {
  background: rgba(255, 255, 255, 0.02);
  font-weight: 600;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.keys-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.01);
}

.keys-table tbody tr:last-child td {
  border-bottom: none;
}

.table-placeholder {
  text-align: center;
  color: var(--text-muted);
  padding: 36px !important;
  font-style: italic;
}

/* Status pills */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid transparent;
}

.status-pill .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.status-pill.active {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.2);
}
.status-pill.active .dot {
  background-color: #10b981;
  box-shadow: 0 0 6px #10b981;
}

.status-pill.exhausted {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.2);
}
.status-pill.exhausted .dot {
  background-color: #f59e0b;
  box-shadow: 0 0 6px #f59e0b;
}

.status-pill.inactive {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}
.status-pill.inactive .dot {
  background-color: #ef4444;
  box-shadow: 0 0 6px #ef4444;
}

/* Model badge */
.model-badge {
  background: rgba(139, 92, 246, 0.12);
  color: #c084fc;
  border: 1px solid rgba(139, 92, 246, 0.2);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  font-family: monospace;
}

/* Actions list */
.action-btn-group {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.action-btn-group button {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-btn-group button:hover {
  border-color: var(--border-active);
  background: rgba(255, 255, 255, 0.05);
}

.action-btn-group button.delete-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
  color: #ef4444;
}

.help-card ul {
  list-style-type: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.help-card li {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  position: relative;
  padding-left: 20px;
}

.help-card li::before {
  content: "•";
  color: #a855f7;
  font-size: 16px;
  position: absolute;
  left: 0;
  top: -1px;
}

.help-card li strong {
  color: var(--text-main);
}

/* Song Type Toggle Row Styles */
.song-type-toggle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  padding: 8px 12px;
  border-radius: 12px;
  justify-content: space-between;
}

.toggle-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.vocal-toggle-switch {
  display: flex;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.vocal-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.vocal-mode-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.02);
}

.vocal-mode-btn.active {
  color: #fff;
  background: var(--grad-accent-btn);
  box-shadow: 0 2px 8px rgba(236, 72, 153, 0.4);
}

/* ==========================================
   18. READY-MADE MUSIC STYLE TEMPLATE STYLES
   ========================================== */

.templates-section {
  margin-bottom: 24px;
}

.section-subtitle-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 8px;
  font-weight: normal;
}

.templates-scroll-container {
  overflow-x: auto;
  padding: 10px 4px 16px 4px;
  margin-top: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Custom premium scrollbar for horizontal cards */
.templates-scroll-container::-webkit-scrollbar {
  height: 6px;
}

.templates-scroll-container::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
  border-radius: 4px;
}

.templates-scroll-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
}

.templates-scroll-container::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.templates-flex-row {
  display: flex;
  gap: 16px;
  width: max-content; /* Ensure row elements stay on one line for scroll */
  padding-right: 20px;
}

.template-card {
  position: relative;
  width: 250px;
  padding: 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* Hover glow effect */
.template-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Selected active state */
.template-card.active {
  border-color: #ec4899;
  box-shadow: 0 0 15px rgba(236, 72, 153, 0.4);
}

/* Subtle background glow layer based on card gradient */
.template-glow-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: inherit;
  opacity: 0.15;
  filter: blur(25px);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s ease;
}

.template-card:hover .template-glow-layer {
  opacity: 0.28;
}

.template-emoji {
  font-size: 26px;
  z-index: 1;
}

.template-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}

.template-info h4 {
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.template-meta {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

.template-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tpl-badge {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

/* Fast create button styles */
.template-fast-create-btn {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #ffffff;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 1;
  transition: all 0.2s ease;
}

.template-fast-create-btn svg {
  color: #ffd700;
  filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.5));
}

.template-fast-create-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #ffffff;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.25);
  transform: scale(1.02);
}

.template-fast-create-btn:hover svg {
  color: #000000;
  filter: none;
}

/* Tab 2: Upgraded Lyrics & Prompt Layout */
.track-metadata-summary-card,
.suno-style-prompt-card,
.lyrics-content-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.meta-summary-header h4,
.suno-style-prompt-card h4 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.meta-summary-badges {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.prompt-display-box {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 14px;
  font-family: 'Montserrat', monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #c084fc;
  word-break: break-all;
  text-shadow: 0 0 8px rgba(168, 85, 247, 0.15);
}

.copy-btn-small {
  padding: 6px 12px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border-radius: 6px !important;
}

/* AI Assets Grid layout */
.ai-assets-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 768px) {
  .ai-assets-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================
   18. SONG HISTORY & PAGINATION STYLES
   ========================================== */

/* Active history layout changes (similar to settings) */
body.history-active .app-container {
  grid-template-columns: 260px 1fr !important;
}

.history-filter-card {
  margin-bottom: 8px;
}

.history-grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

.history-track-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-glass);
  position: relative;
  overflow: hidden;
}

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

.history-track-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-active);
  box-shadow: var(--glow-pink), var(--shadow-glass);
}

.history-track-card:hover::before {
  background: var(--grad-pink-purple);
}

.history-card-top {
  display: flex;
  gap: 14px;
  align-items: center;
}

.history-card-cover-wrapper {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

.history-card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.history-track-card:hover .history-card-cover {
  transform: scale(1.1);
}

.history-card-play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  color: #fff;
  transition: var(--transition-smooth);
  cursor: pointer;
}

.history-card-cover-wrapper:hover .history-card-play-overlay,
.history-track-card.playing-active .history-card-play-overlay {
  opacity: 1;
}

.history-play-btn-circle {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad-pink-purple);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--glow-pink);
  transition: transform 0.2s ease;
}

.history-play-btn-circle:hover {
  transform: scale(1.1);
}

.history-card-info {
  flex-grow: 1;
  min-width: 0;
}

.history-card-title {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.badge-genre, .badge-mood {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 6px;
  text-transform: uppercase;
}

.badge-genre {
  background: rgba(6, 182, 212, 0.1);
  color: #22d3ee;
  border: 1px solid rgba(6, 182, 212, 0.2);
}

.badge-mood {
  background: rgba(168, 85, 247, 0.1);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.2);
}

.history-card-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.history-detail-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}

.history-detail-label {
  font-size: 8px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.history-detail-val {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-main);
}

.history-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.history-card-actions button {
  flex: 1;
  padding: 6px 4px;
  font-size: 10px;
  border-radius: 6px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.btn-delete-track {
  border-color: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}

.btn-delete-track:hover {
  background: rgba(239, 68, 68, 0.15) !important;
  border-color: #ef4444 !important;
  color: #ff8787 !important;
}

.history-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px 24px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.history-empty-state svg {
  color: rgba(255, 255, 255, 0.1);
  margin-bottom: 8px;
}
