/* ==========================================================================
   Ask The DJ - Mobile-First Nightlife Glassmorphism Design System
   ========================================================================== */

:root {
  --bg-dark: #0a0b10;
  --bg-card: rgba(22, 25, 38, 0.65);
  --bg-card-hover: rgba(35, 40, 60, 0.85);
  --bg-card-selected: rgba(0, 242, 254, 0.12);
  --bg-modal: rgba(18, 20, 32, 0.95);
  
  --accent-cyan: #00f2fe;
  --accent-pink: #ff007f;
  --accent-purple: #7928ca;
  --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #7928ca 100%);
  --button-gradient: linear-gradient(135deg, #ff007f 0%, #7928ca 100%);
  
  --text-main: #ffffff;
  --text-muted: #a0a5b5;
  --text-dim: #62677b;

  --border-glass: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(0, 242, 254, 0.5);
  --border-selected: #00f2fe;
  
  --shadow-glow: 0 8px 32px 0 rgba(0, 242, 254, 0.15);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.4);
  
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  
  --font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-family);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  display: flex;
  justify-content: center;
}

/* Ambient Background Glow Blobs */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.45;
}

.blob-1 {
  width: 320px;
  height: 320px;
  background: var(--accent-purple);
  top: -80px;
  left: -80px;
}

.blob-2 {
  width: 280px;
  height: 280px;
  background: var(--accent-cyan);
  bottom: 10%;
  right: -60px;
}

.blob-3 {
  width: 220px;
  height: 220px;
  background: var(--accent-pink);
  top: 40%;
  left: 30%;
}

/* App Container */
.app-container {
  width: 100%;
  max-width: 500px;
  padding: 16px 20px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Top Utility Bar (Custom Flag Icon Dropdown Component) */
.top-utility-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.lang-custom-dropdown {
  position: relative;
  z-index: 50;
}

.lang-trigger {
  background: rgba(22, 25, 38, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 30px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
}

.lang-trigger:hover, .lang-trigger.open {
  border-color: var(--accent-cyan);
  background: rgba(30, 35, 55, 0.95);
  box-shadow: 0 0 14px rgba(0, 242, 254, 0.3);
}

.flag-img {
  width: 18px;
  height: 14px;
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  background-size: cover;
  display: inline-block;
}

.dropdown-arrow {
  font-size: 0.65rem;
  color: var(--accent-cyan);
  margin-left: 2px;
  transition: transform 0.2s ease;
}

.lang-trigger.open .dropdown-arrow {
  transform: rotate(180deg);
}

.lang-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 105px;
  background: rgba(18, 20, 32, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: fadeIn 0.2s ease forwards;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.lang-option:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
}

.lang-option.active {
  background: rgba(0, 242, 254, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 242, 254, 0.3);
}

/* Header */
.app-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding-top: 2px;
}

.app-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.dj-name-highlight {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-icon {
  display: inline-block;
  color: var(--accent-cyan);
  font-size: 1.5rem;
  margin-left: 6px;
  vertical-align: middle;
  filter: drop-shadow(0 0 10px rgba(0, 242, 254, 0.7));
  animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(8deg); }
}

.app-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
  max-width: 320px;
  line-height: 1.3;
}

/* Name Input Section (Above Song Search) */
.name-section {
  width: 100%;
}

.input-field-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(22, 25, 38, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 2px 14px;
  transition: all 0.25s ease;
}

.input-field-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.input-icon {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-right: 10px;
}

.input-field-wrapper input {
  width: 100%;
  height: 46px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 0.95rem;
  font-weight: 500;
}

.input-field-wrapper input::placeholder {
  color: var(--text-dim);
}

/* Search Section */
.search-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: sticky;
  top: 12px;
  z-index: 10;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: rgba(22, 25, 38, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 4px 16px;
  box-shadow: var(--shadow-card);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-input-wrapper:focus-within {
  border-color: var(--border-focus);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.25);
  transform: translateY(-2px);
}

.search-icon {
  color: var(--accent-cyan);
  font-size: 1.1rem;
  margin-right: 12px;
}

.search-input-wrapper input {
  width: 100%;
  height: 52px;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 500;
}

.search-input-wrapper input::placeholder {
  color: var(--text-dim);
}

/* Clear Button for Search Field (Pure Icon, Absolutely NO Background) */
.clear-btn, #clearSearchBtn {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--text-muted) !important;
  font-size: 1.25rem !important;
  padding: 4px 8px !important;
  width: auto !important;
  height: auto !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
}

.clear-btn:hover, #clearSearchBtn:hover {
  background: none !important;
  background-color: transparent !important;
  color: var(--accent-cyan) !important;
  transform: scale(1.15);
}

/* Disable native WebKit search clear icon */
input::-webkit-search-cancel-button,
input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.search-meta {
  display: none;
}

.provider-tag {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

.provider-tag i {
  color: var(--accent-cyan);
}

/* Selected Track Summary Badge */
.selected-track-badge {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 242, 254, 0.1);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1.5px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  animation: fadeIn 0.3s ease forwards;
}

.badge-cover {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.badge-info {
  flex: 1;
  min-width: 0;
}

.badge-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-artist {
  font-size: 0.8rem;
  color: var(--accent-cyan);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge-deselect-btn {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  color: var(--text-muted) !important;
  font-size: 1.1rem !important;
  padding: 4px 8px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  flex-shrink: 0;
}

.badge-deselect-btn:hover {
  background: none !important;
  background-color: transparent !important;
  color: var(--accent-pink) !important;
  transform: scale(1.15);
}

/* Results Section */
.results-section {
  min-height: 0;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Song Item Card */
.track-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.25s ease;
  animation: fadeIn 0.3s ease forwards;
}

.track-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Selected Track State */
.track-card.selected {
  background: var(--bg-card-selected);
  border: 1.5px solid var(--border-selected);
  box-shadow: 0 0 20px rgba(0, 242, 254, 0.3);
}

.track-card.selected .request-action-icon {
  background: var(--accent-cyan);
  color: #0a0b10;
  box-shadow: 0 0 14px var(--accent-cyan);
}

.track-cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background-color: rgba(255, 255, 255, 0.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.track-details {
  flex: 1;
  min-width: 0;
}

.track-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 3px;
}

.track-artist {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.track-meta {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.request-action-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 0, 127, 0.15);
  border: 1px solid rgba(255, 0, 127, 0.3);
  color: var(--accent-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: all 0.2s;
}

/* Empty State */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
  gap: 12px;
}

.icon-circle {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--accent-cyan);
  margin-bottom: 6px;
}

.empty-state h3 {
  font-size: 1.2rem;
  color: var(--text-main);
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--text-dim);
  max-width: 260px;
}

/* Loading Spinner */
.spinner-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px;
  gap: 16px;
  color: var(--text-muted);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Bottom Submit Bar */
.submit-bar-container {
  display: flex;
  justify-content: center;
  padding: 0;
  z-index: 80;
  pointer-events: none;
}

.submit-btn {
  pointer-events: auto;
  width: 100%;
  max-width: 460px;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  outline: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Disabled State (Ausgegraut) */
.submit-btn.disabled {
  background: rgba(30, 35, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.35);
  cursor: not-allowed;
  opacity: 0.6;
  box-shadow: none;
  filter: grayscale(100%);
}

/* Active State (Glow Gradient) */
.submit-btn.active {
  background: var(--button-gradient);
  border: none;
  color: #ffffff;
  cursor: pointer;
  opacity: 1;
  filter: grayscale(0%);
  box-shadow: 0 8px 25px rgba(255, 0, 127, 0.5);
  transform: translateY(-2px);
  animation: pulseButton 2s infinite;
}

@keyframes pulseButton {
  0% { box-shadow: 0 8px 25px rgba(255, 0, 127, 0.5); }
  50% { box-shadow: 0 8px 35px rgba(0, 242, 254, 0.7); }
  100% { box-shadow: 0 8px 25px rgba(255, 0, 127, 0.5); }
}

.submit-btn.active:active {
  transform: translateY(0) scale(0.98);
}

/* Toast Notifications */
.toast-notification {
  display: none;
}

/* Success Page */
.success-page {
  width: 100%;
  min-height: 100vh;
  background-color: var(--bg-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
}

.success-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  max-width: 400px;
  text-align: center;
}

.success-icon {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(0, 242, 254, 0.1);
  border: 2px solid var(--accent-cyan);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--accent-cyan);
  animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

.success-page h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
}

.success-page p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.suggest-another-btn {
  background: var(--button-gradient);
  border: none;
  color: #ffffff;
  padding: 16px 32px;
  border-radius: var(--radius-md);
  font-family: var(--font-family);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  outline: none;
  box-shadow: 0 8px 25px rgba(255, 0, 127, 0.5);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  margin-top: 16px;
}

.suggest-another-btn:hover {
  box-shadow: 0 8px 35px rgba(0, 242, 254, 0.7);
  transform: translateY(-2px);
}

.suggest-another-btn:active {
  transform: translateY(0) scale(0.98);
}

/* Main Content Switching */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.search-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.success-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

/* Helpers & Animations */
.hidden {
  display: none !important;
}

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

@keyframes slideUp {
  from { transform: translate(-50%, 40px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

.fa-spin-slow {
  animation: spin 8s linear infinite;
}
