:root {
  --white: #ffffff;
  --navy: #1f2a7f;
  --purple: #ab2fc1;
  --orange: #f4a83b;
  --gray: #898989;
  --disabled: #cccccc;
  --ice: #d9dfff;
  --soft-end: #f8f9fa;
  --divider: rgba(31, 42, 127, 0.2);
  --prompt-shadow: rgba(31, 42, 127, 0.12);

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;
  --space-4xl: 96px;

  --font-family: "Noto Naskh Arabic", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--navy);
  font-family: var(--font-family);
  direction: rtl;
}

body {
  min-height: 100vh;
  line-height: 1.6;
}

img {
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.page,
.app,
.app-shell,
.page-shell {
  width: min(100%, 1200px);
  margin: 0 auto;
  padding: var(--space-3xl);
  background: var(--white);
}

.screen-page,
.screen-content {
  min-height: calc(100vh - 128px);
}

.section-title {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
}

.subtitle {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--navy);
}

.track-meta {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--gray);
}

.logo {
  display: block;
  object-fit: contain;
}

.logo-landing {
  height: 48px;
  margin: 80px auto 0;
}

.logo-header {
  height: 32px;
}

.logo-small {
  height: 24px;
}

.landing-page {
  background:
    radial-gradient(circle at 25% 20%, #2838a2 0%, rgba(40, 56, 162, 0.08) 34%, transparent 62%),
    radial-gradient(circle at 78% 74%, #101a5d 0%, rgba(16, 26, 93, 0.08) 36%, transparent 64%),
    radial-gradient(circle at 50% 40%, #11153c 0%, #070911 70%, #040508 100%);
}

.page-landing {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.landing-canvas {
  width: min(100%, 980px);
  min-height: calc(100vh - 128px);
  display: grid;
  grid-template-rows: 1fr auto auto;
  align-items: center;
  justify-items: center;
  gap: var(--space-xl);
  position: relative;
}

.landing-canvas::before,
.landing-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.landing-canvas::before {
  background:
    radial-gradient(90% 38% at 10% 70%, rgba(101, 91, 236, 0.18), transparent 68%),
    radial-gradient(92% 40% at 85% 30%, rgba(67, 139, 255, 0.16), transparent 70%);
}

.landing-canvas::after {
  background:
    linear-gradient(165deg, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(190deg, transparent 58%, rgba(255, 255, 255, 0.04) 72%, transparent 88%);
  mix-blend-mode: screen;
}

.logo-stage {
  display: grid;
  place-items: center;
}

.premium-logo {
  width: 168px;
  height: 168px;
  border-radius: 44px;
  position: relative;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.7), rgba(196, 204, 255, 0.08) 48%, rgba(98, 109, 185, 0.55) 82%),
    radial-gradient(circle at 28% 24%, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0) 56%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow:
    0 22px 80px rgba(74, 88, 255, 0.36),
    inset 0 2px 10px rgba(255, 255, 255, 0.44),
    inset 0 -12px 24px rgba(20, 27, 66, 0.46);
  transform: rotate(-12deg);
}

.premium-logo::before {
  content: "";
  position: absolute;
  inset: 30px 34px;
  border-radius: 28px;
  border: 14px solid rgba(25, 32, 70, 0.78);
  box-shadow:
    inset 0 2px 10px rgba(255, 255, 255, 0.24),
    0 0 30px rgba(130, 109, 255, 0.55);
}

.premium-logo::after {
  content: "";
  position: absolute;
  width: 50px;
  height: 50px;
  right: 14px;
  top: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0) 72%);
  opacity: 0.65;
}

.premium-logo-core {
  position: absolute;
  inset: -18px;
  border-radius: 48px;
  border: 1px solid rgba(186, 171, 255, 0.4);
  filter: blur(0.2px);
  box-shadow:
    0 0 34px rgba(171, 47, 193, 0.68),
    0 0 90px rgba(71, 97, 255, 0.42);
}

.premium-prompt {
  width: min(100%, 900px);
  min-height: 84px;
  border-radius: 999px;
  border: 1px solid rgba(201, 211, 255, 0.36);
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.06)),
    rgba(12, 18, 47, 0.44);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow:
    0 14px 44px rgba(5, 10, 36, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.28),
    inset 0 -1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px rgba(119, 145, 255, 0.18);
  display: flex;
  align-items: center;
  position: relative;
  padding-inline: 26px 14px;
  gap: 18px;
  z-index: 1;
}

.premium-prompt:focus-within {
  border-color: rgba(189, 141, 255, 0.82);
  box-shadow:
    0 18px 48px rgba(5, 10, 36, 0.66),
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    0 0 0 1px rgba(174, 124, 255, 0.42),
    0 0 36px rgba(171, 47, 193, 0.35);
}

.premium-input {
  flex: 1;
  border: 0;
  background: transparent;
  color: rgba(244, 247, 255, 0.98);
  font-family: "Inter", "Noto Naskh Arabic", sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  padding: 0;
  text-align: left;
}

.premium-input::placeholder {
  color: rgba(210, 219, 255, 0.62);
}

.premium-input:focus {
  outline: none;
}

.prompt-caret {
  width: 2px;
  height: 28px;
  background: #b389ff;
  box-shadow: 0 0 18px rgba(179, 137, 255, 0.92);
  border-radius: 999px;
  animation: caretPulse 1.2s ease-in-out infinite;
}

.prompt-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-icon,
.create-chip {
  border: 1px solid rgba(203, 214, 255, 0.24);
  color: rgba(236, 241, 255, 0.92);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  min-width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.tool-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool-icon:hover,
.create-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(193, 147, 255, 0.72);
  background: rgba(171, 47, 193, 0.22);
  color: #f2e8ff;
}

.create-chip {
  min-width: 86px;
  padding-inline: 18px;
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.typing-only {
  opacity: 0;
  transform: translateX(6px);
  pointer-events: none;
}

.premium-prompt.is-typing .typing-only {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.trending-styles {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  color: rgba(203, 216, 255, 0.42);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
}

.trending-styles li {
  position: relative;
}

.trending-styles li + li::before {
  content: "•";
  position: absolute;
  right: calc(100% + 9px);
  top: 50%;
  transform: translateY(-52%);
  color: rgba(204, 191, 255, 0.42);
}

.text-button,
.text-btn,
.icon-button,
.icon-btn,
.filter-btn {
  color: var(--navy);
  background: transparent;
  border: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 18px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.text-button:hover,
.text-btn:hover,
.icon-button:hover,
.icon-btn:hover,
.filter-btn:hover {
  color: var(--purple);
}

.text-button:focus-visible,
.text-btn:focus-visible,
.icon-button:focus-visible,
.icon-btn:focus-visible,
.filter-btn:focus-visible,
.top-nav a:focus-visible,
.text-nav a:focus-visible,
.prompt-input:focus-visible,
.tool-icon:focus-visible,
.create-chip:focus-visible,
.premium-input:focus-visible {
  outline: 2px solid var(--purple);
  outline-offset: 2px;
}

.icon-button,
.icon-btn {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
}

.icon-button svg,
.icon-btn svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.bordered-btn {
  border: 1px solid var(--navy);
  border-radius: 24px;
  padding: 12px 24px;
}

.bordered-btn:hover {
  color: var(--purple);
  border-color: var(--purple);
}

.page-header,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.top-nav,
.text-nav {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
}

.top-nav a,
.text-nav a {
  font-size: 18px;
  color: var(--navy);
}

.top-nav a:hover,
.text-nav a:hover,
.top-nav .is-active,
.text-nav .is-active {
  color: var(--purple);
}

.track-list {
  display: grid;
  gap: var(--space-md);
  margin-bottom: 128px;
}

.track-list.is-empty::before {
  content: "Your generated tracks will appear here.";
  color: var(--gray);
  font-size: 18px;
  font-family: "Inter", "Noto Naskh Arabic", sans-serif;
  border: 1px dashed rgba(31, 42, 127, 0.35);
  border-radius: 16px;
  padding: 20px;
}

.chat-context {
  margin: 0 0 var(--space-md);
  font-size: 14px;
  color: var(--gray);
}

.track-card {
  background: var(--white);
  border: 1px solid var(--navy);
  border-radius: 16px;
  padding: 20px;
  transition: border-color 0.2s ease;
}

.track-card:hover {
  border-color: var(--purple);
}

.track-title {
  margin: 0 0 var(--space-sm);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--navy);
}

.waveform {
  width: 100%;
  height: 56px;
  margin-bottom: var(--space-md);
}

.waveform polyline,
.waveform path {
  fill: none;
  stroke: var(--purple);
  stroke-width: 2;
  transform-origin: center;
  animation: waveformPulse 3.2s ease-in-out infinite;
}

.inline-actions,
.centered-actions {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  flex-wrap: wrap;
}

.text-btn-small {
  font-size: 18px;
  font-weight: 500;
}

.chat-prompt {
  width: 100%;
  margin-top: auto;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: min(calc(100% - 128px), 1200px);
  z-index: 5;
}

.chat-prompt .prompt-pill {
  width: 100%;
}

.player-center {
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
}

.album-frame {
  width: min(100%, 380px);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--navy);
  border-radius: 16px;
  background: var(--white);
  display: grid;
  place-items: center;
  color: var(--gray);
  font-size: 18px;
}

.progress-track {
  width: min(100%, 560px);
  height: 2px;
  background: var(--gray);
  position: relative;
}

.progress-fill {
  position: absolute;
  inset: 0 0 0 auto;
  width: 46%;
  background: var(--purple);
}

.transport-controls {
  display: flex;
  gap: var(--space-xl);
  align-items: center;
}

.transport-btn {
  width: 28px;
  height: 28px;
}

.transport-btn svg {
  width: 28px;
  height: 28px;
}

.play-btn svg path {
  fill: none;
}

.filters {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
  margin: var(--space-lg) 0 var(--space-xl);
}

.filter-btn {
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}

.filter-btn.is-active,
.filter-btn[aria-selected="true"] {
  color: var(--purple);
  border-bottom-color: var(--purple);
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.library-card {
  background: var(--white);
  border: 1px solid var(--navy);
  border-radius: 16px;
  padding: 20px;
  min-height: 150px;
  transition: border-color 0.2s ease;
}

.library-card:hover {
  border-color: var(--purple);
}

.library-title {
  margin: 0 0 var(--space-sm);
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
}

.settings-page {
  max-width: 760px;
}

.settings-group {
  margin-top: var(--space-lg);
}

.settings-subtitle {
  margin: 0 0 var(--space-md);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

.choice {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--navy);
  font-size: 18px;
  cursor: pointer;
}

.choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice span {
  position: relative;
  display: inline-block;
  padding-inline-start: 30px;
}

.choice span::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  border: 1px solid var(--navy);
  background: var(--white);
}

.radio-choice span::before {
  border-radius: 50%;
}

.checkbox-choice span::before {
  border-radius: 4px;
}

.radio-choice input:checked + span::before,
.checkbox-choice input:checked + span::before {
  background: var(--purple);
  border-color: var(--purple);
}

.checkbox-choice input:checked + span::after {
  content: "";
  position: absolute;
  inset-inline-start: 5px;
  top: 50%;
  width: 8px;
  height: 4px;
  border: 2px solid var(--white);
  border-top: 0;
  border-right: 0;
  transform: translateY(-55%) rotate(-45deg);
}

.divider {
  border: 0;
  height: 1px;
  background: var(--divider);
  margin: 24px 0;
}

@keyframes waveformPulse {
  0%,
  100% {
    opacity: 0.78;
    transform: scaleY(0.96);
  }
  50% {
    opacity: 1;
    transform: scaleY(1.04);
  }
}

@keyframes caretPulse {
  0%,
  100% {
    opacity: 0.35;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .page,
  .app,
  .app-shell,
  .page-shell {
    padding: var(--space-xl);
  }

  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chat-prompt {
    width: min(calc(100% - 64px), 1200px);
  }
}

@media (max-width: 768px) {
  .page,
  .app,
  .app-shell,
  .page-shell {
    padding: var(--space-md);
  }

  .landing-canvas {
    gap: var(--space-lg);
    min-height: calc(100vh - 32px);
  }

  .premium-logo {
    width: 132px;
    height: 132px;
    border-radius: 34px;
  }

  .premium-logo::before {
    inset: 24px 27px;
    border-width: 11px;
    border-radius: 20px;
  }

  .premium-prompt {
    min-height: 72px;
    padding-inline: 18px 10px;
    gap: 10px;
  }

  .premium-input {
    font-size: 16px;
  }

  .tool-icon,
  .create-chip {
    min-width: 36px;
    height: 36px;
  }

  .create-chip {
    min-width: 72px;
    font-size: 11px;
  }

  .chat-prompt {
    width: calc(100% - 32px);
    bottom: 16px;
  }

  .prompt-pill,
  .prompt-input {
    min-height: 56px;
  }

  .library-grid {
    grid-template-columns: 1fr;
  }

}
