:root {
  --primary: #833ab4;
  --secondary: #e1306c;
  --accent: #f77737;
  --light: #f8f9fa;
  --dark: #121212;
  --darker: #0a0a12;
  --gray: #8e8e8e;
  --success: #4ade80;
  --error: #dc3545;
  --card-bg: rgba(30, 30, 46, 0.85);
  --input-bg: rgba(20, 20, 30, 0.8);
  --transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

body {
  background: linear-gradient(135deg, var(--darker), var(--dark));
  color: var(--light);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
  position: relative;
  overflow-x: hidden;
  line-height: 1.6;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(
      circle at 10% 20%,
      rgba(131, 58, 180, 0.15),
      transparent 30%
    ),
    radial-gradient(
      circle at 90% 80%,
      rgba(225, 48, 108, 0.15),
      transparent 30%
    ),
    linear-gradient(rgba(10, 10, 18, 0.9), rgba(10, 10, 18, 0.9));
  z-index: -1;
}

.container {
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  z-index: 1;
}

header {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem;
  animation: fadeInDown 0.8s ease;
}

.logo-container {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.logo {
  position: relative;
  width: 100px;
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-bg {
  position: absolute;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    45deg,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
  border-radius: 25px;
  transform: rotate(45deg);
  box-shadow: 0 8px 30px rgba(225, 48, 108, 0.5);
  animation: rotateGradient 15s linear infinite;
}

.logo-icon {
  position: relative;
  font-size: 2.8rem;
  z-index: 2;
}

h1 {
  font-size: 2.8rem;
  margin-bottom: 0.8rem;
  background: linear-gradient(
    to right,
    var(--primary),
    var(--secondary),
    var(--accent)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.subtitle {
  color: var(--gray);
  font-size: 1.2rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.app-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

@media (max-width: 768px) {
  .app-container {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  padding: 2rem;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  animation: fadeInUp 0.8s ease;
  margin-bottom: 2rem;
}

.input-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.8rem;
  font-weight: 500;
  color: #e0e0e0;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.url-input-container {
  position: relative;
}

.url-input {
  width: 100%;
  padding: 1.1rem 1.4rem 1.1rem 3rem;
  border-radius: 15px;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: var(--input-bg);
  color: white;
  font-size: 1.05rem;
  transition: var(--transition);
}

.url-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(131, 58, 180, 0.3);
}

.url-input::placeholder {
  color: #6c757d;
}

.url-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--secondary);
  font-size: 1.2rem;
}

.mode-selector {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.mode-btn {
  flex: 1;
  padding: 1.2rem 0.5rem;
  border-radius: 15px;
  background: var(--input-bg);
  border: 2px solid rgba(255, 255, 255, 0.1);
  color: #b0b0b0;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.mode-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  opacity: 0;
  transition: var(--transition);
  z-index: 0;
}

.mode-btn.active::before {
  opacity: 1;
}

.mode-btn span {
  position: relative;
  z-index: 1;
}

.mode-btn i {
  font-size: 1.8rem;
  margin-bottom: 0.8rem;
  z-index: 1;
  transition: var(--transition);
}

.mode-btn.active {
  color: white;
  border-color: transparent;
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(225, 48, 108, 0.4);
}

.mode-btn:hover:not(.active) {
  background: rgba(40, 40, 60, 0.8);
  transform: translateY(-3px);
}

.download-btn {
  width: 100%;
  padding: 1.2rem;
  border-radius: 15px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
  font-weight: 700;
  font-size: 1.15rem;
  border: none;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 7px 20px rgba(225, 48, 108, 0.5);
  position: relative;
  overflow: hidden;
}

.download-btn::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(30deg) translate(-20px, -40px);
  transition: var(--transition);
}

.download-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(225, 48, 108, 0.7);
}

.download-btn:hover::after {
  transform: rotate(30deg) translate(0, 0);
}

.download-btn:active {
  transform: translateY(0);
}

.result-container {
  display: none;
  margin-top: 1.5rem;
  animation: fadeIn 0.5s ease;
  margin-bottom: 2rem;
}

.result-content {
  background: rgba(20, 20, 30, 0.8);
  border-radius: 15px;
  padding: 2rem;
  border-left: 5px solid var(--success);
}

.result-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.result-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  animation: pulse 2s infinite;
}

.result-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-top: 1rem;
  text-align: center;
}

.result-subtitle {
  color: var(--gray);
  font-size: 1.1rem;
  margin-top: 0.5rem;
  text-align: center;
}

.file-info {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.info-badge {
  background: rgba(30, 30, 46, 0.7);
  border-radius: 12px;
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  min-width: 140px;
  transition: var(--transition);
}

.info-badge:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.info-badge i {
  font-size: 1.5rem;
  color: var(--accent);
}

.info-label {
  font-size: 0.9rem;
  color: var(--gray);
}

.info-value {
  font-weight: 600;
  font-size: 1.1rem;
}

.download-btn-2 {
  padding: 1.1rem 2.5rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  border: none;
  border-radius: 15px;
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 1.2rem;
  box-shadow: 0 7px 20px rgba(225, 48, 108, 0.5);
  width: 100%;
  max-width: 300px;
  justify-content: center;
}

.download-btn-2:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 25px rgba(225, 48, 108, 0.7);
}

.loader {
  display: none;
  text-align: center;
  padding: 2rem;
}

.spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top: 6px solid var(--secondary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1.5rem;
}

.loader-text {
  font-size: 1.2rem;
  color: var(--gray);
}

.error-message {
  display: none;
  margin-top: 1.5rem;
  padding: 1.2rem;
  background: rgba(220, 53, 69, 0.25);
  border-radius: 15px;
  border-left: 5px solid var(--error);
  color: #ff6b6b;
  font-weight: 500;
  animation: fadeIn 0.3s ease;
  text-align: center;
}

/* Preview section styles */
.preview-container {
  border-radius: 15px;
  overflow: hidden;
  background: rgba(20, 20, 30, 0.8);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  margin-bottom: 1.5rem;
}

.preview-title {
  padding: 1rem;
  background: rgba(40, 40, 60, 0.8);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  justify-content: center;
}

.video-preview {
  width: 100%;
  max-height: 500px;
  background: #000;
  display: block;
}

.audio-preview {
  width: 100%;
  padding: 1.5rem;
  background: #000;
  display: block;
}

.no-preview {
  padding: 3rem 1rem;
  text-align: center;
  color: var(--gray);
  font-size: 1.1rem;
}

.instructions {
  background: rgba(30, 30, 46, 0.7);
  border-radius: 18px;
  padding: 1.8rem;
  margin-bottom: 2rem;
  border-left: 5px solid var(--accent);
}

.instructions h2 {
  margin-bottom: 1.2rem;
  color: var(--accent);
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.step {
  background: rgba(20, 20, 30, 0.6);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.step:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.step-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  color: white;
  font-weight: bold;
  margin: 0 auto 1rem;
}

.step-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}

.step-desc {
  color: var(--gray);
  font-size: 0.95rem;
}

footer {
  margin-top: auto;
  padding: 2rem 0 1.5rem;
  text-align: center;
  color: var(--gray);
  font-size: 0.95rem;
  width: 100%;
}

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.feature {
  background: rgba(30, 30, 46, 0.6);
  border-radius: 15px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.feature:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

.feature i {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.feature-title {
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.feature-desc {
  color: var(--gray);
  font-size: 1rem;
}

.btn-container {
  display: flex;
  justify-content: center;
  margin-top: 1.5rem;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes rotateGradient {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  h1 {
    font-size: 2.3rem;
  }

  .subtitle {
    font-size: 1.05rem;
  }

  .card {
    padding: 1.5rem;
  }

  .mode-selector {
    flex-direction: column;
  }

  .file-info {
    flex-direction: column;
    align-items: center;
  }

  .info-badge {
    width: 100%;
    max-width: 220px;
  }

  .video-preview {
    max-height: 300px;
  }
}
