@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* --- DESIGN SYSTEM & CSS VARIABLES --- */
:root {
  --primary-color: #ff0055; /* Default fallback - updated dynamically */
  --primary-glow: rgba(255, 0, 85, 0.15);
  --primary-glow-hover: rgba(255, 0, 85, 0.3);
  
  --bg-dark: #0a0a0c;
  --card-bg: rgba(18, 18, 22, 0.65);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #ffffff;
  --text-secondary: #a0a0ab;
  --text-muted: #6f6f76;
  
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.08);
  
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease;
  
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* --- BASE & SCROLLBARS --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  position: relative;
  line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: var(--text-muted);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-color);
}

/* --- DYNAMIC BLURRED BACKGROUND --- */
.bg-blur-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  overflow: hidden;
  background-color: var(--bg-dark);
}

.bg-blur-image {
  position: absolute;
  top: -10%;
  left: -10%;
  width: 120%;
  height: 120%;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.35) contrast(1.15) saturate(1.2);
  transition: background-image 0.8s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bg-gradient-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: linear-gradient(
    180deg,
    rgba(10, 10, 12, 0.4) 0%,
    rgba(10, 10, 12, 0.7) 40%,
    rgba(10, 10, 12, 0.95) 100%
  );
}

/* --- PUBLIC CARD CONTAINER --- */
.container {
  width: 100%;
  max-width: 480px;
  padding: 40px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.music-card {
  width: 100%;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 32px 24px;
  box-shadow: 
    0 24px 64px -16px rgba(0, 0, 0, 0.85),
    0 0 50px -10px var(--primary-glow);
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: box-shadow 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}

/* Decorative top light beam */
.music-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

/* --- ARTWORK & INFO --- */
.cover-wrapper {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: 0 16px 36px -12px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transition: var(--transition-smooth);
}

.cover-wrapper:hover {
  transform: scale(1.03);
  box-shadow: 
    0 20px 48px -12px rgba(0, 0, 0, 0.9),
    0 0 25px -5px var(--primary-color);
}

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

.release-info {
  text-align: center;
  margin-bottom: 24px;
  width: 100%;
}

.artist-name {
  font-size: 1.15rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 6px;
  word-wrap: break-word;
}

.release-title {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  word-wrap: break-word;
}

/* --- RELEASE COUNTDOWN --- */
.countdown {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 10px 28px -18px var(--primary-color);
  backdrop-filter: blur(18px);
}

.countdown-item {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.countdown-number {
  width: 100%;
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  margin-top: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.countdown-separator {
  width: 1px;
  height: 46px;
  background: rgba(255, 255, 255, 0.28);
}

/* --- YOUTUBE VIDEO PREVIEW CARD --- */
.youtube-preview-card {
  display: block;
  width: 100%;
  margin-bottom: 28px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 
    0 12px 32px -12px rgba(0, 0, 0, 0.9),
    0 0 20px -8px var(--primary-glow);
  background: rgba(0, 0, 0, 0.2);
  transition: var(--transition-smooth);
  position: relative;
  cursor: pointer;
}

.youtube-preview-card:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 20px 40px -10px rgba(0, 0, 0, 0.95),
    0 0 30px -4px var(--primary-glow-hover);
}

.youtube-thumbnail-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  background-image: url('https://img.youtube.com/vi/5MJqHN1L3vs/maxresdefault.jpg');
  background-size: cover;
  background-position: center;
  overflow: hidden;
}

#youtube-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  pointer-events: none; /* Ignora eventos de mouse para manter o loop sem interrupções */
  transform: scale(1.05); /* Zoom sutil para ocultar marcas d'água e barras de controle do player */
  transition: transform 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.youtube-preview-card:hover #youtube-player {
  transform: scale(1.1);
}

.youtube-video-link-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  cursor: pointer;
}

.youtube-container {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 28px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow: 0 8px 24px -10px rgba(0, 0, 0, 0.7);
  background: #000;
  aspect-ratio: 16 / 9;
  position: relative;
}

.youtube-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* --- PLATFORMS LIST --- */
.platforms-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}

.platform-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  text-decoration: none;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.platform-row::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.02), transparent);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.platform-row:hover::before {
  transform: translateX(100%);
}

.platform-row:hover {
  background: var(--glass-hover);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.5);
}

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

.platform-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.platform-logo,
.platform-logo-mask {
  width: 24px;
  height: 24px;
  transition: var(--transition-fast);
}

.platform-logo {
  fill: currentColor;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.platform-logo-mask {
  display: inline-block;
  background-color: var(--text-primary);
  -webkit-mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-size: contain;
  mask-repeat: no-repeat;
  mask-position: center;
}

.platform-row:hover .platform-logo {
  color: var(--primary-color);
  transform: scale(1.1);
}

.platform-row:hover .platform-logo-mask {
  background-color: var(--primary-color);
  transform: scale(1.1);
}

.platform-name {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
}

.action-btn {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: var(--transition-smooth);
}

.platform-row:hover .action-btn {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
  box-shadow: 0 0 16px -2px var(--primary-color);
}

/* --- FOOTER & SHARE --- */
.footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
}

.social-link {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.social-link:hover {
  color: var(--primary-color);
}

.share-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition-fast);
}

.share-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.share-btn:hover {
  color: var(--primary-color);
  transform: scale(1.02);
}

/* --- ADMIN VIEW --- */
.admin-card {
  width: 100%;
  max-width: 720px;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.85);
  margin-top: 40px;
  margin-bottom: 40px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 20px;
}

.admin-title-group h1 {
  font-size: 1.8rem;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.admin-title-group p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-fast);
}

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

/* Login Card styling */
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--card-bg);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 40px 32px;
  box-shadow: 0 24px 64px -16px rgba(0, 0, 0, 0.85);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.login-header {
  text-align: center;
}

.login-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 4px;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Forms general */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: var(--transition-fast);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 12px var(--primary-glow);
  background: rgba(0, 0, 0, 0.45);
}

/* Special cover image upload input */
.cover-upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition-fast);
  background: rgba(0, 0, 0, 0.15);
  text-align: center;
  position: relative;
  overflow: hidden;
}

.cover-upload-area:hover {
  border-color: var(--primary-color);
  background: rgba(255, 0, 85, 0.02);
}

.cover-upload-area svg {
  width: 36px;
  height: 36px;
  color: var(--text-muted);
  transition: var(--transition-fast);
}

.cover-upload-area:hover svg {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.upload-preview {
  width: 90px;
  height: 90px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

/* Color picker row */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 16px;
}

.color-input-preview {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(255, 255, 255, 0.15);
  cursor: pointer;
  padding: 0;
  background: none;
  overflow: hidden;
}

.color-input-preview::-webkit-color-swatch-wrapper {
  padding: 0;
}
.color-input-preview::-webkit-color-swatch {
  border: none;
}

/* Platforms settings */
.platforms-settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
  margin-bottom: 24px;
}

.platform-config-item {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.platform-config-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1rem;
}

/* Modern Switch Toggle */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 24px;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: .3s;
  border-radius: 24px;
}

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

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(24px);
}

/* Save Actions */
.btn-primary {
  width: 100%;
  background: var(--primary-color);
  color: #fff;
  border: none;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 8px 24px -6px var(--primary-glow-hover);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 12px 32px -4px var(--primary-glow-hover);
  transform: translateY(-1px);
}

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

.btn-primary:disabled {
  background: var(--text-muted);
  box-shadow: none;
  cursor: not-allowed;
  filter: none;
}

/* Progress bar inside upload */
.upload-progress-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
  display: none;
}

.upload-progress-fill {
  height: 100%;
  background: var(--primary-color);
  width: 0%;
  transition: width 0.2s ease;
}

/* --- TOAST NOTIFICATIONS (POPUP FEEDBACK) --- */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  pointer-events: none;
}

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

.toast {
  background: rgba(18, 18, 22, 0.9);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 12px 24px;
  border-radius: 50px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  font-weight: 500;
  font-size: 0.95rem;
}

.toast-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.toast-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.toast-icon svg {
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon {
  color: #10b981;
}

.toast-error .toast-icon {
  color: #ef4444;
}

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

/* --- LOADING SPINNER --- */
.loader-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-dark);
  z-index: 10000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.5s ease, visibility 0.5s;
}

.loader-wrapper.hidden {
  opacity: 0;
  visibility: hidden;
}

.pulse-loader {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary-color);
  animation: pulse 1.5s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
  box-shadow: 0 0 40px var(--primary-color);
}

@keyframes pulse {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
  50% {
    opacity: 0.8;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* --- RESPONSIVE ADJUSTMENTS --- */
@media (max-width: 480px) {
  .container {
    padding: 20px 16px;
  }
  .music-card {
    padding: 24px 16px;
    border-radius: var(--radius-lg);
  }
  .cover-wrapper {
    width: 180px;
    height: 180px;
  }
  .release-title {
    font-size: 1.65rem;
  }
  .countdown {
    gap: 8px;
    padding: 16px 12px;
  }
  .countdown-number {
    font-size: 1.75rem;
  }
  .countdown-label {
    font-size: 0.68rem;
  }
  .countdown-separator {
    height: 38px;
  }
  .platform-row {
    padding: 12px 14px;
  }
  .platform-name {
    font-size: 0.95rem;
  }
  .action-btn {
    padding: 6px 14px;
    font-size: 0.8rem;
  }
  .admin-card {
    padding: 20px 16px;
    margin-top: 20px;
    border-radius: var(--radius-lg);
  }
}
