/* ==========================================================================
   Krishan Kunhaida - Smart Link & Privacy Center
   Ultra-High-Fidelity Music Smartlink with Glassmorphism & Animated Sidepanel
   ========================================================================== */

:root {
  --primary-font: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --secondary-font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  
  --card-width: 410px;
  --card-radius: 20px;
  --drawer-width: 460px;
  
  --brand-blue: #0073e6;
  --brand-blue-hover: #0060cc;
  --text-primary: #1e2229;
  --text-secondary: #586174;
  --text-muted: #8c96a8;
  --border-light: #e5e8ee;
  --border-btn: #dce0e8;
  --btn-bg: #ffffff;
  
  --shadow-card: 0 24px 60px -12px rgba(0, 0, 0, 0.45), 0 12px 24px -8px rgba(0, 0, 0, 0.35);
  --shadow-btn: 0 2px 4px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-btn-hover: 0 4px 10px rgba(0, 0, 0, 0.09), 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-drawer: -12px 0 40px rgba(0, 0, 0, 0.3);
}

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

html, body {
  width: 100%;
  min-height: 100vh;
  font-family: var(--primary-font);
  background-color: #0d121c;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --------------------------------------------------------------------------
   Ambient Blurred Background
   -------------------------------------------------------------------------- */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-layer {
  position: absolute;
  inset: -20px;
}

.ambient-artwork {
  background-image: url('assets/artwork.png');
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  transform: scale(1.15);
  filter: blur(55px) saturate(160%) brightness(0.65);
}

.ambient-blur {
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.ambient-overlay {
  background: radial-gradient(circle at 50% 25%, rgba(13, 22, 40, 0.4) 0%, rgba(5, 8, 16, 0.82) 100%);
}

/* --------------------------------------------------------------------------
   Smartlink Page Layout
   -------------------------------------------------------------------------- */
.smartlink-wrapper {
  position: relative;
  z-index: 10;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 32px 16px 48px;
}

.smartlink-card {
  width: 100%;
  max-width: var(--card-width);
  background: #ffffff;
  border-radius: var(--card-radius);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: cardFadeUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes cardFadeUp {
  0% {
    opacity: 0;
    transform: translateY(24px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* --------------------------------------------------------------------------
   Card Header (Translucent Glassmorphism with Artwork)
   -------------------------------------------------------------------------- */
.card-header {
  position: relative;
  padding: 30px 24px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  background: linear-gradient(180deg, rgba(22, 32, 54, 0.78) 0%, rgba(38, 48, 70, 0.85) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-top-left-radius: var(--card-radius);
  border-top-right-radius: var(--card-radius);
  overflow: hidden;
}

/* Background image texture inside header */
.card-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('assets/artwork.png');
  background-position: center top;
  background-size: cover;
  filter: blur(28px) brightness(0.65);
  opacity: 0.6;
  z-index: 0;
  transform: scale(1.1);
}

.card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.35) 0%, rgba(20, 30, 48, 0.75) 100%);
  z-index: 1;
}

.artwork-container {
  position: relative;
  z-index: 2;
  width: 172px;
  height: 172px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45), 0 6px 12px rgba(0, 0, 0, 0.3);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* Non-clickable */
  cursor: default;
}

.artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* Non-clickable */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  -webkit-touch-callout: none;
}

.artwork-glare {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 55%);
  pointer-events: none;
}

.track-meta {
  position: relative;
  z-index: 2;
  max-width: 90%;
}

.artist-name {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.2px;
  margin-bottom: 6px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
  line-height: 1.25;
}

.track-title {
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  letter-spacing: -0.1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* Subtle organic bottom curve divider matching screenshot */
.header-curve-divider {
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  width: 100%;
  height: 18px;
  z-index: 3;
  line-height: 0;
  pointer-events: none;
}

.header-curve-divider svg {
  width: 100%;
  height: 100%;
  display: block;
}

/* --------------------------------------------------------------------------
   Platforms List
   -------------------------------------------------------------------------- */
.card-platforms {
  background: #ffffff;
  padding: 10px 0 6px;
}

.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 28px;
  transition: background-color 0.2s ease;
  position: relative;
}

.platform-row:not(:last-child)::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 28px;
  right: 28px;
  height: 1px;
  background: rgba(0, 0, 0, 0.035);
}

.platform-row:hover {
  background-color: #f9fafb;
}

.platform-brand {
  display: flex;
  align-items: center;
  min-width: 140px;
  pointer-events: none; /* Non-clickable as requested */
  user-select: none;
  cursor: default;
}

.store-logo-img {
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.platform-row:hover .store-logo-img {
  transform: translateX(2px);
}

/* Visually calibrated equal heights for optical harmony */
.logo-spotify {
  height: 24px;
  max-width: 108px;
}

.logo-applemusic {
  height: 22px;
  max-width: 96px;
}

.logo-jiosaavn {
  height: 24px;
  max-width: 100px;
}

.logo-deezer {
  height: 23px;
  max-width: 100px;
}

.logo-ytmusic {
  height: 28px;
  max-width: 106px;
}

.logo-youtube {
  height: 20px;
  max-width: 104px;
}

/* Action Buttons (Pill shape Play / Watch) */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 84px;
  height: 32px;
  padding: 0 20px;
  border-radius: 9999px;
  background-color: var(--btn-bg);
  border: 1px solid var(--border-btn);
  color: #555e6d;
  font-family: var(--primary-font);
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
  text-decoration: none;
  box-shadow: var(--shadow-btn);
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.action-btn:hover {
  color: #111827;
  border-color: #bcc3cf;
  box-shadow: var(--shadow-btn-hover);
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(1px) scale(0.97);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.action-btn.active-click {
  background-color: #f1f4f9;
  border-color: #0073e6;
  color: #0073e6;
}

/* --------------------------------------------------------------------------
   Card Footer (Cookies & Believe Logo)
   -------------------------------------------------------------------------- */
.card-footer {
  background: #ffffff;
  padding: 24px 20px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border-bottom-left-radius: var(--card-radius);
  border-bottom-right-radius: var(--card-radius);
}

.cookie-trigger-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #7b8595;
  font-family: var(--primary-font);
  padding: 6px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
  margin-bottom: 20px;
}

.cookie-trigger-btn:hover {
  color: #2b3240;
  background: rgba(0, 0, 0, 0.04);
}

.braille-icon {
  opacity: 0.65;
  transition: opacity 0.2s ease;
}

.cookie-trigger-btn:hover .braille-icon {
  opacity: 1;
}

.cookie-label {
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.1px;
}

.powered-by-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}

.powered-text {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: #9aa2b1;
  text-transform: uppercase;
}

.studio-branding {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
}

.studio-logo-img {
  height: 28px;
  width: auto;
  object-fit: contain;
  display: block;
  transition: transform 0.2s ease;
}

.studio-branding:hover .studio-logo-img {
  transform: scale(1.05);
}

.studio-brand-text {
  font-size: 19px;
  font-weight: 800;
  color: #0d1117;
  letter-spacing: -0.5px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}

/* --------------------------------------------------------------------------
   Dynamic Sidepanel Drawer & Backdrop Overlay (Screenshot 3)
   -------------------------------------------------------------------------- */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(13, 20, 36, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
}

.drawer-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.cookie-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--drawer-width);
  max-width: 100vw;
  height: 100vh;
  height: 100dvh;
  background: #ffffff;
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform;
}

.cookie-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  padding: 16px 20px 10px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  border-bottom: 1px solid #edf0f5;
  flex-shrink: 0;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #495057;
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background-color: #f1f3f7;
  color: #111827;
  transform: rotate(90deg);
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px 28px;
  -webkit-overflow-scrolling: touch;
}

/* Custom Sleek Scrollbar */
.drawer-body::-webkit-scrollbar {
  width: 6px;
}
.drawer-body::-webkit-scrollbar-track {
  background: transparent;
}
.drawer-body::-webkit-scrollbar-thumb {
  background: #d8dde6;
  border-radius: 3px;
}

.preference-title {
  font-size: 22px;
  font-weight: 700;
  color: #2b2f38;
  margin-bottom: 16px;
  letter-spacing: -0.3px;
}

.preference-desc {
  font-size: 13.5px;
  line-height: 1.62;
  color: #4b5262;
  margin-bottom: 16px;
}

.more-info-link {
  display: inline-block;
  font-size: 14px;
  color: #0066cc;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-bottom: 28px;
  font-weight: 500;
  transition: color 0.2s ease;
}

.more-info-link:hover {
  color: #004499;
}

.consent-heading {
  font-size: 18px;
  font-weight: 700;
  color: #242933;
  margin-bottom: 14px;
  letter-spacing: -0.2px;
}

/* Accordion Elements */
.preferences-accordion {
  border: 1px solid #e2e6ed;
  border-radius: 4px;
  overflow: hidden;
}

.accordion-item {
  border-bottom: 1px solid #e2e6ed;
}

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

.accordion-header {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: #ffffff;
  cursor: pointer;
  user-select: none;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background-color: #f9fbfd;
}

.accordion-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.accordion-icon {
  font-size: 18px;
  font-weight: 700;
  color: #3b4252;
  width: 14px;
  line-height: 1;
  text-align: center;
  transition: transform 0.25s ease;
}

.accordion-item.is-expanded .accordion-icon {
  transform: rotate(45deg);
}

.accordion-title {
  font-size: 15px;
  font-weight: 700;
  color: #2b303c;
  letter-spacing: -0.1px;
}

.status-always-active {
  font-size: 14.5px;
  font-weight: 700;
  color: #0066cc;
  white-space: nowrap;
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s ease;
  background-color: #fbfcfd;
}

.accordion-item.is-expanded .accordion-content {
  max-height: 250px;
  padding: 0 18px 16px 44px;
}

.accordion-content p {
  font-size: 13px;
  line-height: 1.55;
  color: #5e6676;
}

/* --------------------------------------------------------------------------
   iOS-Style Animated Toggle Switch
   -------------------------------------------------------------------------- */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  margin: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #ccd3dd;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 34px;
}

.slider::before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .slider {
  background-color: #3b82f6;
}

.toggle-switch input:focus-visible + .slider {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* --------------------------------------------------------------------------
   Drawer Footer
   -------------------------------------------------------------------------- */
.drawer-footer {
  padding: 18px 28px 24px;
  border-top: 1px solid #edf0f5;
  background-color: #ffffff;
  flex-shrink: 0;
}

.confirm-choices-btn {
  display: block;
  width: 100%;
  max-width: 220px;
  padding: 12px 24px;
  background-color: #0073e6;
  color: #ffffff;
  font-family: var(--primary-font);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 115, 230, 0.25);
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  outline: none;
}

.confirm-choices-btn:hover {
  background-color: #0060cc;
  box-shadow: 0 6px 16px rgba(0, 115, 230, 0.35);
  transform: translateY(-1px);
}

.confirm-choices-btn:active {
  transform: translateY(1px);
  box-shadow: 0 2px 6px rgba(0, 115, 230, 0.2);
}

/* --------------------------------------------------------------------------
   Toast Notification
   -------------------------------------------------------------------------- */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #1e2533;
  color: #ffffff;
  padding: 12px 22px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35);
  z-index: 1001;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background-color: #10b981;
  color: white;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .smartlink-wrapper {
    padding: 16px 12px 32px;
    align-items: flex-start;
  }

  .smartlink-card {
    max-width: 100%;
    border-radius: 18px;
  }

  .card-header {
    padding: 24px 16px 28px;
  }

  .artwork-container {
    width: 150px;
    height: 150px;
    margin-bottom: 16px;
  }

  .artist-name {
    font-size: 20px;
  }

  .track-title {
    font-size: 13.5px;
  }

  .platform-row {
    padding: 14px 20px;
  }

  .action-btn {
    min-width: 72px;
    height: 30px;
    padding: 0 14px;
    font-size: 13px;
  }

  .cookie-drawer {
    width: 100vw;
  }

  .drawer-body {
    padding: 20px 18px;
  }

  .confirm-choices-btn {
    max-width: 100%;
  }
}
