:root {
  --silver-robot: #C0C0C0;
  --silver-light: #E0E0E0;
  --gray: #808080;
  --gray-dark: #4A4A4A;
  --egg-green: #8FBC8F;
  --egg-green-dark: #7AAB7A;
  --black: #0a0a0a;
  --black-light: #1a1a1a;
  --white: #ffffff;
  --bg-dark: #070707;
  --bg-card: #0f0f0f;
  --glass: rgba(255, 255, 255, 0.05);
  --radius: 16px;
  --radius-sm: 10px;
  --max-width: 100%;
  --gap: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background: linear-gradient(135deg, var(--bg-dark) 0%, #111111 100%);
  color: var(--silver-robot);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  min-height: 100vh;
  padding: 12px;
  line-height: 1.5;
}

.app {
  width: 100%;
  max-width: 480px;
  min-height: calc(100vh - 24px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: 24px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.app::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--egg-green), transparent);
  z-index: 1;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 12px;
  margin-bottom: 8px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.logo {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.1), rgba(128, 128, 128, 0.05));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-text .title {
  font-weight: 700;
  color: var(--white);
  font-size: 18px;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-text .subtitle {
  font-size: 11px;
  color: var(--egg-green);
  font-weight: 500;
  letter-spacing: 0.3px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--silver-robot);
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.btn-icon:hover, .btn-icon:active {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.container {
  padding: 8px 4px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.hero {
  padding: 8px 4px 16px;
}

.main-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--white);
  line-height: 1.3;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.main-title .highlight {
  color: var(--egg-green);
  background: linear-gradient(135deg, var(--egg-green), #A8D5A8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.desc {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.5;
}

.form {
  margin: 8px 0;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.input-group input[type="url"] {
  width: 100%;
  padding: 18px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(15, 15, 15, 0.8);
  color: var(--silver-light);
  font-size: 16px;
  font-family: var(--font-main);
  outline: none;
  transition: all 0.3s ease;
}

.input-group input[type="url"]:focus {
  border-color: var(--egg-green);
  background: rgba(15, 15, 15, 0.9);
  box-shadow: 0 0 0 2px rgba(143, 188, 143, 0.2);
}

.input-group input[type="url"]::placeholder {
  color: var(--gray);
}

.btn-primary {
  background: linear-gradient(135deg, var(--egg-green), var(--egg-green-dark));
  color: var(--black);
  border: none;
  padding: 18px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.3s ease;
  letter-spacing: 0.3px;
}

.btn-primary:hover, .btn-primary:active {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(143, 188, 143, 0.3);
}

.result {
  margin: 16px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.1) 100%);
  border-radius: var(--radius);
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
}

.quality-badge {
  background: rgba(143, 188, 143, 0.15);
  color: var(--egg-green);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(143, 188, 143, 0.3);
}

.result-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.video-preview {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: linear-gradient(135deg, #1a1a1a, #0f0f0f);
}

.thumb {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.play-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-preview:hover .play-overlay {
  opacity: 1;
}

.video-info {
  padding: 8px 4px;
}

.info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 14px;
}

.info-label {
  color: var(--gray);
  font-weight: 500;
  min-width: 70px;
}

.info-value {
  color: var(--silver-light);
  font-weight: 400;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--white);
  line-height: 1.4;
  margin-top: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.download-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.download-btn {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  gap: 14px;
  text-align: left;
}

.download-btn:hover, .download-btn:active {
  transform: translateY(-2px);
}

.btn-nowm {
  background: linear-gradient(135deg, rgba(143, 188, 143, 0.15), rgba(143, 188, 143, 0.05));
  border: 1px solid rgba(143, 188, 143, 0.2);
  color: var(--egg-green);
}

.btn-hd {
  background: linear-gradient(135deg, rgba(192, 192, 192, 0.15), rgba(128, 128, 128, 0.05));
  border: 1px solid rgba(192, 192, 192, 0.2);
  color: var(--silver-light);
}

.btn-audio {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-other {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--gray);
  justify-content: center;
  margin-top: 8px;
}

.btn-icon {
  background: transparent;
  border: none;
  width: 24px;
  height: 24px;
  padding: 0;
  flex-shrink: 0;
}

.btn-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.btn-title {
  font-weight: 600;
  font-size: 16px;
}

.btn-sub {
  font-size: 12px;
  opacity: 0.8;
  font-weight: 400;
}

.ad-indicator {
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: #000;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}

.loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  gap: 20px;
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(143, 188, 143, 0.1);
  border-top: 3px solid var(--egg-green);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loader-text {
  color: var(--gray);
  font-size: 14px;
  font-weight: 500;
}

.error {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: rgba(255, 100, 100, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 100, 100, 0.2);
  color: #FF6B6B;
}

.error-text {
  flex: 1;
  font-size: 14px;
}

.info-text {
  margin: 24px 0 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--gray);
}

.info-item svg {
  color: var(--egg-green);
}

.site-footer {
  margin-top: 24px;
  padding: 20px 16px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, rgba(0, 0, 0, 0.1) 100%);
  border: 1px solid rgba(255, 255, 255, 0.03);
  text-align: center;
}

.footer-content {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  color: var(--white);
  font-weight: 600;
}

.footer-separator {
  color: var(--egg-green);
}

.footer-disclaimer {
  font-size: 12px;
  color: var(--gray);
  line-height: 1.5;
  max-width: 400px;
  margin: 0 auto;
}

.footer-version {
  font-size: 11px;
  color: var(--gray-dark);
  letter-spacing: 0.5px;
  margin-top: 4px;
}

.hide {
  display: none !important;
}

.download-message {
  margin-top: 16px;
  padding: 12px;
  background: rgba(143, 188, 143, 0.1);
  border-radius: var(--radius-sm);
  color: var(--egg-green);
  font-size: 13px;
  text-align: center;
}

body.theme-light {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  color: var(--black-light);
}

body.theme-light .app {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9) 0%, rgba(240, 242, 245, 0.9) 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

body.theme-light .brand-text .title {
  color: var(--black-light);
}

body.theme-light .brand-text .subtitle {
  color: var(--egg-green-dark);
}

body.theme-light .btn-icon {
  background: rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: var(--gray);
}

body.theme-light .main-title {
  color: var(--black-light);
}

body.theme-light .desc {
  color: var(--gray-dark);
}

body.theme-light .input-group input[type="url"] {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--black-light);
}

body.theme-light .result {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 242, 245, 0.7) 100%);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .result-header h3 {
  color: var(--black-light);
}

body.theme-light .video-title {
  color: var(--black-light);
}

body.theme-light .info-label {
  color: var(--gray-dark);
}

body.theme-light .info-value {
  color: var(--black-light);
}

body.theme-light .site-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7) 0%, rgba(240, 242, 245, 0.7) 100%);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

body.theme-light .info-text {
  background: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.03);
}

@media (max-width: 480px) {
  .app {
    padding: 12px;
    border-radius: 20px;
  }

  .main-title {
    font-size: 22px;
  }

  .info-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .download-btn {
    padding: 14px 16px;
  }

  .btn-title {
    font-size: 15px;
  }
}

@media (max-width: 360px) {
  .app {
    padding: 10px;
  }

  .navbar {
    padding: 6px 2px 10px;
  }

  .logo {
    width: 36px;
    height: 36px;
  }

  .brand-text .title {
    font-size: 16px;
  }

  .main-title {
    font-size: 20px;
  }

  .input-group input[type="url"] {
    padding: 16px 14px;
  }

  .btn-primary {
    padding: 16px 20px;
  }
}