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

:root {
  --bg-color: #fdfbff;
  --surface-color: #f5f3ff;
  --primary-text-color: #2c2a3e;
  --secondary-text-color: #7a798c;
  --accent-gradient: linear-gradient(135deg, #a78bfa, #c4b5fd);
  --accent-color-primary: #8b5cf6;
  --border-color: #e0ddee;
  --shadow-color: rgba(139, 92, 246, 0.05);
  --shadow-color-hover: rgba(139, 92, 246, 0.12);
  --transition-smooth: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --radius-md: 10px;
  --radius-lg: 16px;
  --error: #d9534f;

  --header-height: 65px;
  --max-width: 1100px;
  --radius-main: 16px;
  --radius-small: 12px;
  --shadow-main: 0 4px 15px var(--shadow-color);
  --shadow-hover: 0 8px 25px var(--shadow-color-hover);
  --shadow-focus: 0 0 0 3px rgba(139, 92, 246, 0.2);
  --transition-main: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Poppins', sans-serif;
  -webkit-tap-highlight-color: transparent;
}
*:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-color);
  color: var(--primary-text-color);
  line-height: 1.6;
}

.body-no-scroll {
  overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  line-height: 1.3;
  font-weight: 600;
  color: var(--primary-text-color);
}

img,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  position: fixed;
  width: 100%;
  padding: 1rem 0;
  background: rgba(253, 251, 255, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
  z-index: 1000;
}

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

.logo-link {
  text-decoration: none;
}

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

.logo-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-text-color);
}

.logo-subtitle {
  margin-top: -4px;
  font-size: 0.8rem;
  color: var(--secondary-text-color);
}

.nav {
  display: none;
}

.nav ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--secondary-text-color);
  transition: color 0.3s ease;
}

.nav a:hover {
  color: var(--primary-text-color);
}

.hamburger-menu {
  display: block;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 1200;
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 6px 0;
  background-color: var(--primary-text-color);
  transition: var(--transition-smooth);
}

.mobile-nav-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--bg-color);
  transform: translateY(-100%);
  transition: transform 0.4s cubic-bezier(0.65, 0, 0.35, 1);
  z-index: 1100;
}

.mobile-nav-overlay.active {
  transform: translateY(0);
}

.mobile-nav-close {
  position: absolute;
  top: 1.5rem;
  right: 20px;
  font-size: 3rem;
  background: none;
  border: none;
  color: var(--primary-text-color);
  cursor: pointer;
}

.mobile-nav-menu {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5rem;
}

.mobile-nav-menu a {
  text-decoration: none;
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--primary-text-color);
  transition: color 0.3s ease;
}

.mobile-nav-menu a:hover {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

main {
  padding-top: 65px;
}

section {
  padding: 60px 0;
}

.surface-section {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.section-title {
  margin-bottom: 1rem;
  font-size: 2.5rem;
  text-align: center;
}

.section-subtitle {
  margin-bottom: 3rem;
  text-align: center;
  color: var(--secondary-text-color);
  font-size: 1.1rem;
}

.hero {
  padding-top: 80px;
  padding-bottom: 60px;
  text-align: center;
}

.hero-title {
  margin-bottom: 1rem;
  font-size: clamp(2.5rem, 8vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
}

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

.hero-subtitle {
  max-width: 700px;
  margin: 0 auto 2rem auto;
  font-size: 1.2rem;
  color: var(--secondary-text-color);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 35px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  white-space: nowrap;
}

.btn-block {
  width: 100%;
}

.btn-primary {
  color: white;
  background: var(--accent-gradient);
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.3);
}

.btn-primary:active,
.btn-primary:disabled {
  transform: translateY(0);
  background: var(--accent-color-primary);
  box-shadow: none;
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: wait;
}

.btn-primary > span {
  display: block;
  flex-grow: 1;
  text-align: center;
}

.btn-secondary {
  background: var(--surface-color);
  color: var(--accent-color-primary);
  border: 1px solid var(--border-color);
}
.btn-secondary:hover {
  border-color: var(--accent-color-primary);
  background: var(--surface-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.btn-tertiary {
  background: transparent;
  color: var(--secondary-text-color);
  padding: 8px 12px;
  font-size: 0.875rem;
}
.btn-tertiary:hover {
  color: var(--primary-text-color);
  background: rgba(0, 0, 0, 0.05);
}

.downloader-module {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

#downloader-result-container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
}

#input-form-container,
#downloader-result-container {
  transition:
    opacity 0.4s ease,
    visibility 0.4s;
  opacity: 1;
  visibility: visible;
}

#input-form-container.is-hidden,
#downloader-result-container.is-hidden {
  opacity: 0;
  visibility: hidden;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  transform: none;
}

.input-group {
  position: relative;
  width: 100%;
  max-width: 600px;
  margin: 0 auto 20px auto;
}
.input-icon {
  position: absolute;
  top: 50%;
  left: 20px;
  transform: translateY(-50%);
  font-size: 1.1rem;
  color: var(--secondary-text-color);
  pointer-events: none;
}
#url-input {
  width: 100%;
  border: none;
  outline: none;
  padding: 18px 20px 18px 55px;
  font-size: 1rem;
  background: var(--surface-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-main);
  border: 1px solid var(--border-color);
  transition: var(--transition-main);
  color: var(--primary-text-color);
}
#url-input:focus {
  border-color: var(--accent-color-primary);
  box-shadow: var(--shadow-focus);
}
.input-action-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  background: var(--bg-color);
  border: none;
  border-radius: var(--radius-small);
  color: var(--secondary-text-color);
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
.input-action-btn:hover {
  background: var(--border-color);
  color: var(--primary-text-color);
}
#paste-btn {
  right: 56px;
}
#clear-btn {
  right: 10px;
}

#download-btn {
  max-width: 600px;
  margin: 0 auto;
}

.downloader-stats {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px 25px;
  flex-wrap: wrap;
  margin-top: 30px;
  color: var(--secondary-text-color);
  font-size: 0.875rem;
}
.downloader-stats span {
  display: flex;
  align-items: center;
  gap: 8px;
}
.downloader-stats b {
  color: var(--primary-text-color);
  font-weight: 600;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.platforms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.platform-card {
  padding: 1.5rem 1rem;
  text-align: center;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px var(--shadow-color);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.platform-card.alt-bg {
  background: var(--bg-color);
}

.platform-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-color-hover);
  border-color: var(--accent-color-primary);
}

.platform-icon {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 45px;
  height: 45px;
  margin-bottom: 0.8rem;
  color: white;
  background: var(--accent-gradient);
  border-radius: 50%;
  font-size: 20px;
}

.platform-card h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.platform-card p {
  font-size: 0.75rem;
  color: var(--secondary-text-color);
}

.feature-card {
  padding: 2rem;
  text-align: center;
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 15px var(--shadow-color);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.feature-card.alt-bg {
  background: var(--bg-color);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px var(--shadow-color-hover);
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem auto;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: white;
  font-size: 18px;
}

.feature-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.feature-card p {
  font-size: 0.95rem;
  color: var(--secondary-text-color);
}

.getting-started {
  background-color: var(--bg-color);
}

.steps-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 2rem;
}

.step-card {
  flex-basis: 30%;
  text-align: center;
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem auto;
  background: var(--accent-gradient);
  border-radius: 50%;
  color: white;
  font-size: 18px;
}

.step-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.step-card p {
  font-size: 0.95rem;
  color: var(--secondary-text-color);
}

.step-line {
  flex-grow: 1;
  height: 2px;
  margin-top: 20px;
  background-color: var(--border-color);
}

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

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s ease-out,
    transform 0.6s ease-out;
}
.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

.loading-state,
.error-state {
  text-align: center;
  padding: 40px 25px;
  background: var(--surface-color);
  border-radius: var(--radius-main);
  box-shadow: var(--shadow-main);
  border: 1px solid var(--border-color);
  max-width: 700px;
  margin: 0 auto;
}
.loading-state h2,
.error-state h2 {
  font-size: 1.25rem;
  margin-bottom: 10px;
}
.loading-state p,
.error-state p {
  color: var(--secondary-text-color);
  font-size: 1rem;
}
.loading-spinner {
  font-size: 2.5rem;
  color: var(--accent-color-primary);
  margin-bottom: 20px;
  display: inline-block;
  animation: spin 1s linear infinite;
}
.error-state .placeholder-icon {
  font-size: 2.5rem;
  color: var(--error);
  margin-bottom: 15px;
}

.result-card,
.result-card-new {
  background: var(--surface-color);
  border-radius: var(--radius-main);
  box-shadow: var(--shadow-main);
  border: 1px solid var(--border-color);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.result-preview,
.result-preview-new {
  width: 100%;
  background: #000;
  flex-shrink: 0;
}
.result-preview-new {
  background: var(--border-color);
}
.result-preview video,
.result-preview img,
.result-preview-new video,
.result-preview-new .image-preview {
  width: 100%;
  border-radius: 0;
  background: #000;
  object-fit: contain;
  aspect-ratio: 16 / 9;
  display: block;
}
.audio-preview {
  display: flex;
  align-items: center;
  background-color: var(--bg-color);
  padding: 20px;
  gap: 15px;
}
.audio-preview .audio-thumbnail {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-small);
  object-fit: cover;
  box-shadow: var(--shadow-main);
  flex-shrink: 0;
}
.audio-controls-wrapper {
  flex-grow: 1;
  min-width: 0;
}
.audio-controls-wrapper p {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}
.audio-controls-wrapper span {
  font-size: 0.875rem;
  color: var(--secondary-text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audio-controls-wrapper audio {
  width: 100%;
  margin-top: 10px;
}

.slideshow-container {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  background: #000;
  overflow: hidden;
}
.slideshow-inner {
  width: 100%;
  height: 100%;
}
.slideshow-container img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  background: #000;
}
.slideshow-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.3s ease;
  z-index: 10;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.slideshow-nav:hover {
  background: rgba(0, 0, 0, 0.7);
}
.slideshow-nav.prev {
  left: 10px;
}
.slideshow-nav.next {
  right: 10px;
}
.slideshow-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 10;
}

.result-content,
.result-content-new {
  padding: 25px;
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 25px;
  flex-grow: 1;
}
.result-info h2,
.result-info-new h2 {
  font-size: 1.25rem;
  margin-bottom: 5px;
  line-height: 1.4;
  font-weight: 700;
}
.result-info p,
.result-info-new p {
  font-size: 1rem;
  color: var(--secondary-text-color);
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-actions,
.result-actions-new {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.result-footer,
.result-footer-new {
  text-align: center;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
}

.dropdown-options {
  position: relative;
  width: 100%;
}
.dropdown-options summary {
  list-style: none;
  cursor: pointer;
}
.dropdown-options summary::-webkit-details-marker {
  display: none;
}
.dropdown-options > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  text-decoration: none;
  padding: 14px 24px;
  border-radius: var(--radius-small);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: var(--transition-main);
  font-size: 1rem;
  width: 100%;
  background: var(--surface-color);
  color: var(--accent-color-primary);
}
.dropdown-options > summary:hover {
  border-color: var(--accent-color-primary);
  background: var(--surface-color);
  transform: translateY(-2px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.dropdown-options[open] > summary {
  border-color: var(--accent-color-primary);
}
.dropdown-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 0;
  right: 0;
  width: 100%;
  background: var(--surface-color);
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border-color);
  padding: 10px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 250px;
  overflow-y: auto;
}
.dropdown-options:not([open]) .dropdown-menu {
  display: none;
}
.dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  text-decoration: none;
  color: var(--primary-text-color);
  font-weight: 500;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}
.dropdown-menu a::before {
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  content: '\f019';
  color: var(--secondary-text-color);
}
.dropdown-menu a:hover {
  background-color: var(--bg-color);
  color: var(--accent-color-primary);
}

.download-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.download-group-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--secondary-text-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 8px;
}

.btn-download {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding-left: 15px;
  padding-right: 15px;
}
.btn-download > i {
  margin-right: 5px;
}
.btn-download span:first-of-type {
  flex-grow: 1;
  text-align: left;
  padding-left: 10px;
}
.btn-download .file-size {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--secondary-text-color);
  background: rgba(139, 92, 246, 0.05);
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
}
.btn-primary .file-size {
  color: white;
  background: rgba(255, 255, 255, 0.15);
}

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}
@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    transform: scale(0.95);
  }
}
.toast-item {
  background: var(--surface-color);
  color: var(--primary-text-color);
  padding: 15px 20px;
  border-radius: var(--radius-small);
  box-shadow: var(--shadow-hover);
  border: 1px solid var(--border-color);
  border-left: 5px solid var(--error);
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 0.95rem;
  font-weight: 500;
  animation: slideInRight 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.toast-item.fade-out {
  animation: fadeOut 0.5s ease-out forwards;
}
.toast-item i {
  font-size: 1.25rem;
  color: var(--error);
}

.footer {
  padding: 2.5rem 0;
  font-size: 0.9rem;
  text-align: center;
  color: var(--secondary-text-color);
  border-top: 1px solid var(--border-color);
}

@media (max-width: 768px) {
  .hero-subtitle {
    font-size: 1.1rem;
  }
  .section-title {
    font-size: 2rem;
  }
  .steps-container {
    flex-direction: column;
    align-items: center;
  }
  .step-line {
    display: none;
  }
  .step-card {
    max-width: 350px;
  }
}

@media (min-width: 769px) {
  .nav {
    display: block;
  }
  .hamburger-menu {
    display: none;
  }
  .platforms-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1.5rem;
  }

  .result-card,
  .result-card-new {
    flex-direction: row;
  }
  .result-preview,
  .result-preview-new {
    width: 55%;
    max-width: 500px;
    border-right: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .audio-preview {
    height: 100%;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    gap: 20px;
  }
  .audio-preview .audio-thumbnail {
    width: 150px;
    height: 150px;
  }
  .audio-controls-wrapper {
    width: 100%;
    max-width: 300px;
  }
  .audio-controls-wrapper p,
  .audio-controls-wrapper span {
    text-align: center;
  }

  .result-content,
  .result-content-new {
    width: 45%;
    padding: 30px;
  }
  .result-actions {
    flex-direction: row;
    justify-content: flex-start;
    gap: 15px;
  }
  .result-actions .btn-block,
  .result-actions .dropdown-options {
    width: 100%;
    flex: 1 1 0;
  }
}
