/* ===== Minimalist Design - Clean & Simple ===== */
:root {
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;

  --bg-main: #0f172a;
  --bg-card: #1e293b;
  --bg-input: #334155;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --border: #334155;
  --border-focus: #6366f1;

  --font-main: 'Noto Sans Georgian', -apple-system, BlinkMacSystemFont,
    sans-serif;
  --radius: 12px;
  --radius-lg: 16px;
}

/* ===== Reset ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 18px;
}

body {
  font-family: var(--font-main);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ===== Layout ===== */
.app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  padding: 2rem 1rem;
}

.container {
  max-width: 600px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== Header ===== */
.app-header {
  background: var(--bg-card);
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  transition: opacity 0.2s;
}

.logo:hover {
  opacity: 0.8;
  color: var(--text-primary);
}

.logo-icon {
  font-size: 1.5rem;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Legacy navbar support */
.navbar {
  display: none;
}

/* ===== Footer ===== */
.app-footer {
  background: var(--bg-card);
  padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
}

.app-footer p {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* ===== Main Page ===== */
.converter-container {
  max-width: 560px;
  margin: 0 auto;
}

/* Hero - Simple & Clear */
.hero-section {
  text-align: center;
  margin-bottom: 2rem;
  padding: 1rem 0;
}

.floating-notes {
  display: none;
}

.hero-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.title-icon {
  font-size: 1.75rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 400;
}

/* Card - Clean White Box */
.converter-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
}

.card-glow {
  display: none;
}

/* Input - Large & Easy to Use */
.input-section {
  margin-bottom: 1.5rem;
}

.input-label {
  display: block;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--text-primary);
}

.label-icon {
  display: none;
}

.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #ff0000;
}

.url-input {
  width: 100%;
  padding: 1rem 1rem 1rem 3rem;
  font-size: 1rem;
  font-family: var(--font-main);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.url-input::placeholder {
  color: var(--text-muted);
}

.url-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-shine {
  display: none;
}

.url-input.shake {
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

/* Video Preview - Simple Card */
.video-preview {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-main);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.video-preview.hidden {
  display: none;
}

.preview-thumbnail {
  position: relative;
  flex-shrink: 0;
  width: 120px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-input);
}

.preview-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.duration-badge {
  position: absolute;
  bottom: 4px;
  right: 4px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  font-size: 0.75rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

.preview-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.preview-title {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preview-author {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Messages */
.message {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.message-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}

.success-message {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: #6ee7b7;
}

/* Big Button - Easy to Click */
.convert-btn {
  width: 100%;
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-main);
  background: var(--primary);
  border: none;
  border-radius: var(--radius);
  color: white;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}

.convert-btn:hover {
  background: var(--primary-hover);
}

.convert-btn:active {
  transform: scale(0.98);
}

.btn-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.btn-icon {
  font-size: 1.25rem;
}

.btn-loading {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.convert-btn.loading .btn-content {
  display: none;
}

.convert-btn.loading .btn-loading {
  display: flex;
}

.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-ripple {
  display: none;
}

/* Features - Simple Icons */
.features-section {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.feature {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
}

.feature-icon {
  font-size: 1rem;
}

/* Instructions - Clear Steps */
.instructions-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-top: 1.5rem;
  border: 1px solid var(--border);
}

.instructions-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.title-decoration {
  font-size: 1.1rem;
}

.steps-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-main);
  border-radius: var(--radius);
}

.step:hover {
  background: var(--bg-input);
}

.step-number {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.step-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== Download Page Styles ===== */
.download-container {
  max-width: 500px;
  margin: 0 auto;
}

.download-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 2rem;
  border: 1px solid var(--border);
  text-align: center;
}

/* Video Info Header */
.video-info-header {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.video-thumbnail {
  flex-shrink: 0;
  width: 120px;
  height: 68px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-input);
}

.video-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-details {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.video-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-author {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Quality Selector */
.quality-selector {
  margin-bottom: 1.5rem;
}

.quality-label {
  display: block;
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.quality-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-family: var(--font-main);
  background: var(--bg-input);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
}

.quality-select:focus {
  outline: none;
  border-color: var(--primary);
}

/* Action Buttons */
.action-section {
  padding: 1rem 0;
}

.section-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.hint-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 1rem;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1.25rem;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: var(--font-main);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.prepare-btn {
  background: var(--primary);
  color: white;
}

.prepare-btn:hover {
  background: var(--primary-hover);
}

.download-btn {
  background: var(--success);
  color: white;
}

.download-btn:hover {
  background: #059669;
  color: white;
}

.cancel-btn {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-top: 0.75rem;
}

.cancel-btn:hover {
  background: var(--bg-input);
}

.btn-icon {
  font-size: 1.25rem;
}

/* Progress Section */
.progress-section {
  padding: 1.5rem 0;
}

.progress-section.hidden,
.action-section.hidden {
  display: none;
}

.status-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.spinning-icon {
  display: inline-block;
  animation: spin 1.5s linear infinite;
}

.status-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.status-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.progress-bar-container {
  position: relative;
  height: 12px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 100px;
  transition: width 0.3s ease;
}

.progress-bar.downloading {
  background: var(--warning);
}

.progress-bar.converting {
  background: var(--primary);
}

.progress-bar.complete {
  background: var(--success);
}

.progress-percent {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Progress Phases */
.progress-phases {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.phase {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.phase.active {
  color: var(--primary);
}

.phase.completed {
  color: var(--success);
}

.phase-icon {
  font-size: 1rem;
}

/* Success/Error States */
.success-section,
.error-section {
  padding: 1.5rem 0;
}

.success-section.hidden,
.error-section.hidden {
  display: none;
}

.result-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.result-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.file-size {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.error-text {
  color: #fca5a5;
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
}

.retry-btn {
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.retry-btn:hover {
  background: var(--border);
}

/* Back Link */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
  transition: color 0.2s;
}

.back-link:hover {
  color: var(--text-primary);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .converter-card,
  .download-card {
    padding: 1.5rem;
  }

  .video-preview,
  .video-info-header {
    flex-direction: column;
  }

  .preview-thumbnail,
  .video-thumbnail {
    width: 100%;
    height: 140px;
  }

  .features-section {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
  }

  .progress-phases {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* ===== Accessibility ===== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary);
  color: white;
}
