@import url('https://fonts.googleapis.com/css2?family=Google+Sans+Flex:wght@100..1000&display=swap');

/* Custom Variables */
:root {
  /* Backgrounds */
  --bg-primary: hsl(220, 20%, 8%);
  /* Deep Slate Dark Gray (#0e1116) */
  --bg-secondary: hsl(220, 16%, 12%);
  /* Deep Card Slate (#171a21) */
  --card-bg: hsl(220, 14%, 16%);
  /* Dark Slate Gray panel (#21252d) */
  --border-subtle: hsl(220, 12%, 22%);
  /* Material 3 Gray border line */

  /* Accents - Google Palette */
  --color-primary: #4285F4;
  /* Google Blue */
  --color-success: #249A41;
  /* Google Green */
  --color-premium: #FBBC04;
  /* Google Orange */
  --color-danger: #EA4335;
  /* Google Red */

  /* Text */
  --text-main: hsl(220, 30%, 96%);
  /* Slate White */
  --text-muted: hsl(220, 12%, 65%);
  /* Slate Gray Text */
  --text-dark-gray: #1F1F1F;
  --text-gray: #444746;

  /* Card shadows */
  --shadow-elevation: 0 4px 20px 0 rgba(0, 0, 0, 0.4);
}

/* Base Settings */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Google Sans Flex', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

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

h1,
h2,
h3,
h4,
.logo-text,
.genre-badge {
  font-family: 'Google Sans Flex', 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;
}

/* App Containers */
.app-container {
  width: 100%;
  max-width: 600px;
  min-height: 100vh;
  padding: 24px 16px 120px 16px;
  position: relative;
  display: flex;
  flex-direction: column;
}

.panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-elevation);
  margin-bottom: 20px;
  overflow: hidden;
}

/* Viewport Sections */
.viewport-section {
  width: 100%;
  animation: fadeInSlide 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hidden {
  display: none !important;
}

@keyframes fadeInSlide {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Header UI */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.logo-area {
  display: flex;
  flex-direction: column;
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.logo-subtext {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--color-primary);
}

.genre-badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 30px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--color-primary);
}

.sub-header {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
}

.header-title {
  font-size: 20px;
  font-weight: 800;
}

/* Now Playing Card */
.now-playing-container {
  padding: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: #FFFFFF;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
  text-transform: uppercase;
}

.now-playing-card {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vinyl-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}

.album-cover-np {
  width: 100%;
  height: 100%;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
  z-index: 2;
  position: relative;
  object-fit: cover;
}

.vinyl-disc {
  display: none;
}

.vinyl-disc.paused {
  animation-play-state: paused;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

.np-info {
  flex-grow: 1;
  overflow: hidden;
}

.np-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-artist {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Progress bar */
.progress-bar-container {
  margin-top: 12px;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: #249A41;
  width: 0%;
  border-radius: 4px;
  transition: width 1s linear;
}

.progress-times {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
}

.no-song-playing {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px;
  width: 100%;
  color: var(--text-muted);
  gap: 12px;
}

/* Queue List */
.queue-container {
  padding: 20px;
}

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

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  transition: all 0.3s ease;
}

.queue-item:hover {
  transform: translateY(-2px) scale(1.01);
  background: rgba(255, 255, 255, 0.05);
}

.queue-item.playing {
  border-color: var(--color-success);
  background: rgba(36, 154, 65, 0.05);
}

.queue-item.pushed {
  border-color: var(--color-primary);
  background: rgba(66, 133, 244, 0.05);
}

.queue-art {
  width: 46px;
  height: 46px;
  border-radius: 6px;
  object-fit: cover;
}

.queue-info {
  flex-grow: 1;
  overflow: hidden;
}

.queue-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-artist {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

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

.badge-skip {
  background: rgba(251, 188, 4, 0.15);
  color: var(--color-premium);
  border: 1px solid var(--color-premium);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
}

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

.empty-queue-message {
  text-align: center;
  color: var(--text-muted);
  padding: 24px 0;
  font-size: 16px;
}

/* Floating Navigation Action Bar */
.bottom-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: 568px;
  z-index: 100;
  display: flex;
  justify-content: center;
}

.bottom-action-bar.flex-row {
  display: flex;
  gap: 12px;
}

.btn-floating {
  width: 100%;
  box-shadow: 0 4px 12px rgba(66, 133, 244, 0.3);
}

/* Search UI */
.search-input-wrapper {
  position: relative;
  margin-bottom: 20px;
}

#search-input {
  width: 100%;
  height: 52px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  padding: 0 48px 0 16px;
  color: var(--text-main);
  font-size: 16px;
  outline: none;
  transition: all 0.3s ease;
}

#search-input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 12px rgba(66, 133, 244, 0.25);
  background: rgba(255, 255, 255, 0.07);
}

.btn-clear {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 24px;
  cursor: pointer;
}

/* Genre Banner */
.genre-banner {
  padding: 24px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
}

.banner-tag {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 2px;
  color: #FFFFFF;
  text-transform: uppercase;
}

.banner-title {
  font-size: 28px;
  font-weight: 800;
  text-transform: uppercase;
  margin: 6px 0;
  letter-spacing: 1px;
}

.banner-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Songs Grid */
.songs-list-container {
  padding: 20px;
  flex-grow: 1;
}

.songs-list-heading {
  font-size: 13px;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-transform: uppercase;
}

.songs-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.song-card-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.03);
  cursor: pointer;
  transition: all 0.2s ease;
}

.song-card-row:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.song-card-row:active {
  transform: translateY(0);
}

.song-art {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  object-fit: cover;
}

/* Buttons */
.btn {
  height: 52px;
  padding: 0 24px;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  color: var(--text-main);
  outline: none;
}

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

.btn-primary:hover {
  box-shadow: 0 0 15px var(--color-primary);
  transform: translateY(-2px) scale(1.02);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.12);
}

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

.btn-success:hover {
  box-shadow: 0 0 15px var(--color-success);
  transform: translateY(-2px) scale(1.02);
}

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

.btn-large {
  width: 100%;
  height: 56px;
  font-size: 18px;
}

.btn-icon-text {
  padding: 0 16px;
  height: 40px;
  font-size: 14px;
}

.flex-grow {
  flex-grow: 1;
}

/* Modal Overlay */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 7, 12, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-content {
  width: 100%;
  max-width: 440px;
  position: relative;
  animation: modalScale 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  padding: 24px;
}

@keyframes modalScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-main);
  font-size: 24px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.modal-album-art {
  width: 180px;
  height: 180px;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
  margin-bottom: 20px;
  object-fit: cover;
}

.modal-song-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 6px;
}

.modal-song-artist {
  font-size: 16px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.modal-song-album {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.3);
  margin-bottom: 24px;
}

/* Cost & Toggle Switch */
.modal-cost-toggle {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}

.toggle-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  gap: 12px;
}

.toggle-input {
  display: none;
}

.custom-toggle {
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  position: relative;
  transition: background 0.3s ease;
  flex-shrink: 0;
}

.custom-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-input:checked+.custom-toggle {
  background: var(--color-premium);
}

.toggle-input:checked+.custom-toggle::after {
  transform: translateX(22px);
}

.toggle-text {
  font-weight: 600;
  color: var(--text-main);
  font-size: 15px;
}

.cost-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.4;
}

.modal-footer {
  width: 100%;
}

.btn-full {
  width: 100%;
}

/* Checkout View */
.checkout-container {
  padding: 20px;
}

.cart-items-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
}

.cart-item-art {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  object-fit: cover;
}

.cart-item-info {
  flex-grow: 1;
  overflow: hidden;
}

.cart-item-title {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-artist {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-order-move {
  background: rgba(255, 255, 255, 0.05);
  border: none;
  color: var(--text-main);
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-order-move:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-remove-cart {
  background: rgba(234, 67, 53, 0.1);
  border: 1px solid rgba(234, 67, 53, 0.2);
  color: var(--color-danger);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

.btn-remove-cart:hover {
  background: var(--color-danger);
  color: white;
}

.cart-item-cost-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.cart-price-tag {
  font-size: 13px;
  font-weight: 600;
}

.cart-toggle-skip {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 2px 6px;
  font-size: 10px;
  color: var(--text-muted);
  cursor: pointer;
}

.cart-toggle-skip.active {
  border-color: var(--color-premium);
  color: var(--color-premium);
  background: rgba(251, 188, 4, 0.1);
}

/* Cart Summary Breakdown */
.cart-summary {
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 14px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: var(--text-muted);
}

.text-premium {
  color: var(--color-premium) !important;
}

.total-row {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 12px;
  margin-top: 4px;
}

/* Payment View UI */
.payment-container {
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.payment-header {
  position: relative;
  margin-bottom: 24px;
}

.success-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(36, 154, 65, 0.25) 0%, transparent 70%);
  z-index: 1;
}

.payment-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--color-success);
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

.order-id-badge {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 8px;
  display: inline-block;
}

.qr-display-area {
  margin: 16px 0 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.qr-code-wrapper {
  background: white;
  padding: 12px;
  border-radius: 16px;
  width: 220px;
  height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
}

.qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-status-message {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(251, 188, 4, 0.1);
  border-top-color: var(--color-premium);
  border-radius: 50%;
  animation: spinner-rot 0.8s linear infinite;
}

@keyframes spinner-rot {
  to {
    transform: rotate(360deg);
  }
}

#payment-status-text {
  font-size: 14px;
  color: var(--color-premium);
  font-weight: 600;
}

.payment-instructions {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.instruction-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 16px;
  text-align: left;
}

.instruction-box h3 {
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.instruction-box p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cash-fallback-box {
  background: rgba(234, 67, 53, 0.05);
  border: 1px solid rgba(234, 67, 53, 0.1);
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.mock-pay-area {
  width: 100%;
  margin-top: 24px;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

/* Toast System */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 320px;
}

.toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  animation: toastSlideIn 0.3s ease-out;
  display: flex;
  align-items: center;
}

@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast.success {
  background: var(--color-success);
}

.toast.error {
  background: var(--color-danger);
}

.toast.info {
  background: var(--color-primary);
}

/* Responsive layout overrides */
@media(max-width: 480px) {
  .app-container {
    padding-bottom: 100px;
  }

  .bottom-action-bar {
    bottom: 12px;
    width: calc(100% - 24px);
  }
}

/* Empty Queue Card Glassmorphism */
.empty-queue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px 20px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px dashed rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  text-align: center;
  margin: 10px 0;
}

.empty-queue-card .empty-icon {
  font-size: 32px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-queue-card .empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 4px;
}

.empty-queue-card .empty-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* Disabled state styling for request buttons */
.btn-floating:disabled,
.btn-floating.disabled {
  background: var(--border-subtle) !important;
  color: var(--text-muted) !important;
  cursor: not-allowed !important;
  box-shadow: none !important;
  transform: none !important;
}