/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  color: #333;
  line-height: 1.6;
  font-display: swap;
  scroll-behavior: smooth;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  position: relative;
  overflow: visible;
}

/* Header */
.header {
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  z-index: 10;
}

.header-content {
  background: rgba(255, 255, 255, 0.98);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  position: relative;
  overflow: visible;
  z-index: 10;
  transition: all 0.3s ease;
}

.header-content:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.subtitle {
  font-size: 1.1rem;
  color: #5a6b7d;
  margin: 0;
  font-weight: 500;
  opacity: 0.9;
  letter-spacing: 0.3px;
}

/* Main Content */
.main {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

/* Download Section */
.download-section {
  background: rgba(255, 255, 255, 0.98);
  padding: 1rem;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.download-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  z-index: 1;
}

.download-section:hover {
  transform: translateY(-2px);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.2);
}

.input-group {
  display: flex;
  gap: 15px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.url-input-container {
  position: relative;
  flex: 1;
  min-width: 300px;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  z-index: 2;
  font-size: 18px;
}

.url-input {
  width: 100%;
  padding: 1rem 3.5rem 1rem 3.5rem;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.url-input:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15), 0 8px 24px rgba(0, 0, 0, 0.1);
  outline: none;
  background: rgba(255, 255, 255, 1);
  transform: translateY(-1px);
}

.paste-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: #667eea;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.paste-btn:hover {
  background: #5a67d8;
  transform: translateY(-50%) scale(1.1);
}

.download-btn {
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 16px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 220px;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.download-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.download-btn:hover::before {
  left: 100%;
}

.download-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(102, 126, 234, 0.5);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.download-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

/* Enhanced Download Success Styles */
.download-success {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.success-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 2px solid #e9ecef;
}

.success-icon-large {
  width: 90px;
  height: 90px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 3rem;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  animation: successPulse 2s ease-in-out infinite;
}

.download-ready-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.download-ready-subtitle {
  font-size: 1.1rem;
  color: #6b7280;
  margin: 0;
  font-weight: 500;
}

/* Primary Download Button */
.primary-download-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: white !important;
  padding: 15px 30px !important;
  font-size: 1.1rem !important;
  font-weight: 700 !important;
  border-radius: 12px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.3s ease !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3) !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
  position: relative !important;
  overflow: hidden !important;
  margin: 20px auto !important;
  max-width: 300px !important;
  width: 100% !important;
}

.primary-download-btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s;
}

.primary-download-btn:hover::before {
  left: 100%;
}

.primary-download-btn:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4) !important;
  background: linear-gradient(135deg, #f59e0b, #b45309) !important;
}

.primary-download-btn:active {
  transform: translateY(-1px) !important;
}

.primary-download-btn i {
  font-size: 1.2rem;
  animation: downloadBounce 2s ease-in-out infinite;
}

/* Download Actions Container */
.download-actions {
  text-align: center;
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

/* Animations */
@keyframes successPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 12px 35px rgba(16, 185, 129, 0.4);
  }
}

@keyframes downloadBounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-3px);
  }
  60% {
    transform: translateY(-1px);
  }
}

/* Advanced Options */
.options-section {
  margin-top: 20px;
}

.toggle-advanced {
  width: 100%;
  padding: 15px 20px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: #495057;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.toggle-advanced:hover {
  background: linear-gradient(135deg, #e9ecef, #dee2e6);
  border-color: #667eea;
  transform: translateY(-1px);
}

.toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-advanced.active .toggle-icon {
  transform: rotate(180deg);
}

.advanced-options {
  background: rgba(248, 249, 250, 0.9);
  border-radius: 12px;
  padding: 20px;
  border: 2px solid #e1e5e9;
  animation: slideDown 0.3s ease;
}

.option-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.option-row:last-child {
  margin-bottom: 0;
}

.option-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
}

.option-label {
  color: #1a202c !important;
  font-weight: 700 !important;
  font-size: 15px !important;
  margin-bottom: 10px !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
}

.option-label .label-text {
  font-weight: 700 !important;
  color: #1a202c !important;
  font-size: 14px !important;
}

.option-label .label-desc {
  font-size: 12px !important;
  color: #4a5568 !important;
  font-weight: 500 !important;
  margin-left: 4px;
}

.radio-group {
  display: flex;
  gap: 15px;
}

.radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.radio-label:hover {
  background: rgba(102, 126, 234, 0.1);
}

.option-select {
  padding: 10px 15px;
  border: 2px solid #e1e5e9;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: all 0.3s ease;
}

.option-select:focus {
  border-color: #667eea;
  outline: none;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.checkbox-label:hover {
  background: rgba(102, 126, 234, 0.1);
}

.checkbox-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.checkbox-content .label-text {
  font-weight: 700 !important;
  color: #1a202c !important;
  font-size: 14px !important;
}

.checkbox-content .label-desc {
  font-size: 11px !important;
  color: #4a5568 !important;
  font-weight: 500 !important;
}

/* Watermark option enhancements */
.checkbox-label input[type="checkbox"]:checked + .checkbox-content .fa-magic {
  color: #8b5cf6;
  animation: watermarkPulse 2s infinite;
}

@keyframes watermarkPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
}

.checkbox-label .label-desc {
  font-size: 0.75rem;
  color: #6b7280;
  margin-top: 2px;
  transition: color 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-content .label-desc {
  color: #8b5cf6;
  font-weight: 500;
}

/* Platform-specific watermark indicator */
.checkbox-label.platform-supported .label-desc {
  color: #10b981;
}

.checkbox-label.platform-not-supported .label-desc {
  color: #f59e0b;
}

.checkbox-label.platform-recommended .label-desc {
  color: #8b5cf6;
  font-weight: 600;
}

/* Platforms Section */
.platforms-section {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
  overflow: hidden;
}

.platforms-header {
  padding: 30px 30px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.3s ease;
  flex-wrap: wrap;
  gap: 10px;
}

.platforms-header:hover {
  background: rgba(102, 126, 234, 0.05);
}

.section-title {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.platform-count {
  font-size: 1rem;
  color: #667eea;
  font-weight: 600;
  white-space: nowrap;
}

.collapse-btn {
  background: rgba(102, 126, 234, 0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #667eea;
}

.collapse-btn:hover {
  background: rgba(102, 126, 234, 0.2);
  transform: scale(1.1);
}

/* Platforms Grid - 5 per row layout */
.platforms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  padding: 30px;
  transition: all 0.5s ease;
  overflow: hidden;
}

.platforms-grid.expanded {
  max-height: none;
  opacity: 1;
}

.platforms-grid.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* Platform Cards */
.platform-card {
  background: rgba(255, 255, 255, 0.95);
  border-radius: 15px;
  padding: 20px;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  /* Ensure proper text wrapping on all devices */
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.platform-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(135deg, #667eea, #764ba2);
}

.platform-card:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.platform-icon {
  width: 50px;
  height: 50px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: 50%;
  transition: all 0.3s ease;
}

.platform-card:hover .platform-icon {
  background: linear-gradient(135deg, #667eea, #764ba2);
  transform: scale(1.1);
}

.platform-emoji {
  font-size: 24px;
  transition: all 0.3s ease;
}

.platform-card:hover .platform-emoji {
  transform: scale(1.1);
}

.platform-info {
  margin-bottom: 10px;
  flex-grow: 1;
}

.platform-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 5px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
}

.platform-example {
  font-size: 0.7rem;
  color: #718096;
  font-style: italic;
  word-break: break-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
}

.platform-features {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: auto;
  padding-top: 8px;
}

.feature-tag {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  padding: 3px 6px;
  border-radius: 10px;
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

/* Info Section */
.info-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 40px 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.info-header {
  text-align: center;
  margin-bottom: 40px;
}

.info-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.info-card {
  background: linear-gradient(135deg, #f8f9fa, #ffffff);
  padding: 30px;
  border-radius: 15px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.info-card:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 15px 35px rgba(102, 126, 234, 0.1);
}

.card-icon {
  width: 70px;
  height: 70px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  transition: all 0.3s ease;
}

.info-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

.info-card h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 15px;
}

.info-card p {
  color: #666;
  line-height: 1.6;
}

/* Info Grid and Items */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.info-item {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  border-left: 4px solid #667eea;
  transition: all 0.3s ease;
}

.info-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-label {
  display: inline-block;
  font-weight: 700;
  color: #667eea;
  font-size: 0.75rem;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.1),
    rgba(118, 75, 162, 0.1)
  );
  padding: 6px 12px;
  border-radius: 20px;
  border: 1px solid rgba(102, 126, 234, 0.2);
  box-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
  transition: all 0.3s ease;
}

.info-label:hover {
  background: linear-gradient(
    135deg,
    rgba(102, 126, 234, 0.15),
    rgba(118, 75, 162, 0.15)
  );
  border-color: rgba(102, 126, 234, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(102, 126, 234, 0.2);
}

.info-value {
  color: #4a5568;
  font-size: 0.95rem;
  font-weight: 400;
  font-style: italic;
  font-family: "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont,
    sans-serif;
  word-break: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  max-width: 100%;
  line-height: 1.5;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7),
    rgba(248, 250, 252, 0.6)
  );
  padding: 10px 14px;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.info-value:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.8)
  );
  transform: translateY(-1px);
}

/* Download Info specific styles */
.download-info {
  margin: 1.5rem 0;
  text-align: left;
}

.download-info .info-item {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.9)
  );
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-left: 5px solid #667eea;
  backdrop-filter: blur(15px);
  padding: 1.25rem;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.download-info .info-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
  border-left-color: #764ba2;
}

.download-info .info-label {
  display: inline-block;
  color: #4f46e5;
  background: linear-gradient(135deg, #e0e7ff, #c7d2fe);
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  margin-bottom: 0.75rem;
  border: 1px solid rgba(79, 70, 229, 0.2);
  text-shadow: none;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
  transition: all 0.3s ease;
}

.download-info .info-label:hover {
  background: linear-gradient(135deg, #c7d2fe, #a5b4fc);
  transform: scale(1.02);
}

.download-info .info-value {
  color: #4a5568;
  font-weight: 400;
  font-size: 0.95rem;
  font-style: italic;
  line-height: 1.5;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.7),
    rgba(248, 250, 252, 0.6)
  );
  padding: 10px 14px;
  border-radius: 8px;
  font-family: "SF Pro Display", "Inter", -apple-system, BlinkMacSystemFont,
    sans-serif;
  word-break: break-word;
  overflow-wrap: break-word;
  transition: all 0.3s ease;
}

.download-info .info-value:hover {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.9),
    rgba(248, 250, 252, 0.8)
  );
  transform: translateY(-1px);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(5px);
}

.loading-spinner {
  text-align: center;
  color: white;
}

/* Loading message styles */
#loadingMessage {
  transition: color 0.3s ease;
  font-weight: 500;
  margin-bottom: 15px;
}

/* Error state for loading message */
.loading-spinner.error-state #loadingMessage {
  color: #ef4444 !important;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top: 4px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* TikTok Slideshow Styles */
.tiktok-slideshow {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.slideshow-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.slideshow-header .success-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 2.5rem;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.slideshow-header h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 10px;
}

.slideshow-info {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

/* Download Options */
.download-options {
  margin-bottom: 30px;
}

.option-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
}

.download-option-btn {
  padding: 12px 20px;
  border: 2px solid #e1e5e9;
  border-radius: 12px;
  background: white;
  color: #495057;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.download-option-btn:hover {
  border-color: #667eea;
  background: rgba(102, 126, 234, 0.05);
  transform: translateY(-2px);
}

.download-option-btn.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border-color: #667eea;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* Section Headers */
.section-header {
  margin-bottom: 20px;
  text-align: center;
}

.section-header h4 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.section-description {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
}

/* Images Grid */
.images-section {
  margin-bottom: 30px;
}

.images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.image-item {
  background: white;
  border-radius: 15px;
  padding: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.image-item:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.image-preview {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f8f9fa;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.image-preview:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.image-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.3s ease;
}

.image-preview:hover img {
  transform: scale(1.05);
}

.image-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: #666;
  font-size: 0.9rem;
}

.image-loader .spinner {
  width: 30px;
  height: 30px;
  border: 3px solid #e9ecef;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.image-error {
  text-align: center;
  color: #666;
  padding: 20px;
}

/* Image overlay for click indication */
.image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  opacity: 0;
  pointer-events: none;
}

.image-overlay .preview-btn {
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: #667eea;
  cursor: pointer;
  transform: scale(0.8);
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.image-overlay .preview-btn:hover {
  background: white;
  color: #764ba2;
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.image-preview:hover .image-overlay {
  opacity: 1;
  background: rgba(0, 0, 0, 0.4);
  pointer-events: all;
}

.image-preview:hover .preview-btn {
  transform: scale(1);
}

.image-info {
  margin-bottom: 15px;
}

.image-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 5px;
}

.image-size {
  font-size: 0.8rem;
  color: #666;
}

.individual-download-btn {
  width: 100%;
  padding: 10px 15px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.individual-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Audio Section */
.audio-section {
  margin-bottom: 30px;
}

.audio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.audio-item {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.audio-item:hover {
  transform: translateY(-5px);
  border-color: #667eea;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.audio-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
}

.audio-icon {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
}

.audio-info h5 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #2d3748;
  margin-bottom: 5px;
}

.audio-info .audio-duration,
.audio-info .audio-size {
  font-size: 0.8rem;
  color: #666;
}

/* Result Area */
.result-area {
  margin-top: 30px;
  transition: all 0.3s ease;
}

.result-area.show {
  animation: slideDown 0.3s ease;
}

/* Success and Error Messages */
.success-message {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.error-message {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  padding: 20px;
  border-radius: 15px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.message-icon {
  font-size: 24px;
  min-width: 24px;
}

.message-content h4 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 5px;
}

.message-content p {
  margin: 0;
  opacity: 0.9;
}

/* Download Results */
.download-result {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
}

.result-header {
  text-align: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid #e9ecef;
}

.result-header .result-icon {
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  color: white;
  font-size: 2.5rem;
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.result-header h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 10px;
}

.result-info {
  color: #666;
  font-size: 1.1rem;
  margin: 0;
}

/* Download Actions */
.download-actions {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.download-action-btn {
  padding: 12px 25px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.download-action-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.download-action-btn.secondary {
  background: linear-gradient(135deg, #6b7280, #4b5563);
}

.download-action-btn.secondary:hover {
  box-shadow: 0 6px 20px rgba(107, 114, 128, 0.4);
}

/* Remove Watermark option visibility */
.option-group {
  transition: all 0.3s ease;
  opacity: 1;
  max-height: 200px;
  overflow: hidden;
}

.option-group.option-hidden {
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  pointer-events: none;
}

/* Footer Styles */
.footer {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.95),
    rgba(248, 250, 252, 0.9)
  );
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(102, 126, 234, 0.1);
  margin-top: 60px;
  padding: 40px 0 20px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-main {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  margin-bottom: 30px;
}

.footer-brand {
  display: flex;
  align-items: flex-start;
  gap: 15px;
}

.footer-logo {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

.footer-brand-text h3 {
  font-size: 1.3rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 5px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.footer-brand-text p {
  color: #666;
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.4;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: 700;
  color: #2d3748;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-column h4::before {
  content: "";
  width: 3px;
  height: 16px;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 2px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: #4a5568;
  font-size: 0.85rem;
  line-height: 1.4;
}

.footer-column li i {
  color: #667eea;
  font-size: 0.8rem;
  width: 12px;
  text-align: center;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid rgba(102, 126, 234, 0.1);
  flex-wrap: wrap;
  gap: 15px;
}

.footer-copyright p,
.footer-credits p {
  margin: 0;
  font-size: 0.8rem;
  color: #666;
}

.footer-credits a {
  color: #667eea;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.footer-credits a:hover {
  color: #764ba2;
  transform: translateY(-1px);
}

/* Footer Responsive Design */
@media (max-width: 1024px) {
  .footer-main {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }
}

@media (max-width: 768px) {
  .footer {
    margin-top: 40px;
    padding: 30px 0 15px;
  }

  .footer-main {
    gap: 25px;
    margin-bottom: 25px;
  }

  .footer-links {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-brand {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  .footer-column h4 {
    font-size: 0.95rem;
  }

  .footer-column li {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .footer-content {
    padding: 0 15px;
  }

  .footer {
    padding: 25px 0 15px;
  }

  .footer-brand-text h3 {
    font-size: 1.1rem;
  }

  .footer-brand-text p {
    font-size: 0.85rem;
  }
}

/* Dark mode footer */
@media (prefers-color-scheme: dark) {
  .footer {
    background: linear-gradient(
      135deg,
      rgba(26, 32, 44, 0.95),
      rgba(45, 55, 72, 0.9)
    );
    border-top-color: rgba(167, 139, 250, 0.2);
  }

  .footer-brand-text h3 {
    color: #e2e8f0;
  }

  .footer-brand-text p {
    color: #a0aec0;
  }

  .footer-column h4 {
    color: #e2e8f0;
  }

  .footer-column li {
    color: #a0aec0;
  }

  .footer-copyright p,
  .footer-credits p {
    color: #a0aec0;
  }

  .footer-bottom {
    border-top-color: rgba(167, 139, 250, 0.2);
  }
}

/* Responsive Design for Platforms and General Layout */
/* Large screens (Desktop) - 5 columns */
@media (min-width: 1201px) {
  .platforms-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 30px;
  }
}

/* Desktop/Large tablets - 4 columns */
@media (max-width: 1200px) {
  .platforms-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    padding: 25px;
  }
}

/* Tablets - 3 columns */
@media (max-width: 1024px) {
  .platforms-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    padding: 20px;
  }

  .platform-card {
    min-height: 140px;
    padding: 16px;
  }

  .platform-icon {
    width: 45px;
    height: 45px;
  }

  .platform-emoji {
    font-size: 22px;
  }
}

/* Medium tablets - still 3 columns but smaller */
@media (max-width: 900px) {
  .platforms-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 18px;
  }

  .platform-card {
    min-height: 130px;
    padding: 15px;
  }

  .platform-icon {
    width: 42px;
    height: 42px;
  }

  .platform-emoji {
    font-size: 20px;
  }

  .platform-name {
    font-size: 0.88rem;
  }

  .platform-example {
    font-size: 0.65rem;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
  }

  .title {
    font-size: 2rem;
  }

  .input-group {
    flex-direction: column;
  }

  .url-input-container {
    min-width: auto;
  }

  .option-row {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  /* Platforms responsive for tablet - keep 3 columns but adjust sizing */
  .platforms-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 18px;
  }

  .platform-card {
    padding: 14px;
    min-height: 125px;
  }

  .platform-icon {
    width: 38px;
    height: 38px;
  }

  .platform-emoji {
    font-size: 19px;
  }

  .platform-name {
    font-size: 0.82rem;
  }

  .platform-example {
    font-size: 0.62rem;
  }

  /* Info value mobile responsiveness */
  .info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .info-item {
    padding: 0.75rem;
  }

  .info-value {
    font-size: 1rem;
    word-break: break-all;
    overflow-wrap: anywhere;
  }

  .radio-group {
    flex-direction: column;
    gap: 10px;
  }

  .info-cards {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .tiktok-slideshow {
    padding: 20px;
  }

  .slideshow-header .success-icon {
    width: 60px;
    height: 60px;
    font-size: 2rem;
  }

  .slideshow-header h3 {
    font-size: 1.5rem;
  }

  .option-group {
    flex-direction: column;
    align-items: center;
  }

  .download-option-btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .images-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
  }

  .image-preview {
    height: 150px;
  }

  .audio-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  /* Mobile - 2 columns with better spacing */
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    padding: 16px;
  }

  .platform-card {
    min-height: 115px;
    padding: 12px;
  }

  .platform-icon {
    width: 32px;
    height: 32px;
    margin-bottom: 6px;
  }

  .platform-emoji {
    font-size: 16px;
  }

  .platform-name {
    font-size: 0.78rem;
    margin-bottom: 3px;
    line-height: 1.2;
  }

  .platform-example {
    font-size: 0.58rem;
    -webkit-line-clamp: 1;
    line-clamp: 1;
  }

  .feature-tag {
    padding: 2px 4px;
    font-size: 0.52rem;
  }

  .platforms-header {
    padding: 18px 16px 12px;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .platform-count {
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  /* Small mobile - 2 columns with tighter layout */
  .platforms-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 14px;
  }

  .platform-card {
    padding: 10px;
    min-height: 105px;
  }

  .platform-icon {
    width: 28px;
    height: 28px;
    margin-bottom: 5px;
  }

  /* Info value small mobile responsiveness */
  .info-value {
    font-size: 0.9rem;
  }

  .platform-emoji {
    font-size: 15px;
  }

  .platform-name {
    font-size: 0.72rem;
    margin-bottom: 2px;
    line-height: 1.1;
  }

  .platform-example {
    font-size: 0.52rem;
  }

  .feature-tag {
    padding: 1px 3px;
    font-size: 0.48rem;
  }

  .images-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .image-preview {
    height: 200px;
  }

  .slideshow-header h3 {
    font-size: 1.3rem;
  }

  .slideshow-info {
    font-size: 1rem;
  }

  /* Platform header mobile */
  .platforms-header {
    padding: 16px 14px 10px;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .platform-count {
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  /* Very small screens - 1 column with horizontal card layout */
  .platforms-grid {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 12px;
  }

  .platform-card {
    min-height: 80px;
    padding: 12px;
    display: flex;
    flex-direction: row;
    align-items: center;
    text-align: left;
    gap: 12px;
  }

  .platform-icon {
    width: 36px;
    height: 36px;
    margin: 0;
    flex-shrink: 0;
  }

  .platform-emoji {
    font-size: 18px;
  }

  .platform-info {
    flex: 1;
    margin-bottom: 0;
  }

  .platform-features {
    justify-content: flex-start;
    margin-top: 4px;
  }

  .platform-name {
    font-size: 0.75rem;
    margin-bottom: 2px;
    font-weight: 600;
  }

  .platform-example {
    font-size: 0.55rem;
    margin-bottom: 4px;
    color: #6a7280;
  }

  .feature-tag {
    padding: 1px 4px;
    font-size: 0.45rem;
  }

  .platforms-header {
    padding: 14px 12px 8px;
  }

  .section-title {
    font-size: 1.2rem;
  }

  .platform-count {
    font-size: 0.75rem;
  }
}

/* Image Preview Modal - Centered on Screen */
.image-preview-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-out;
}

.modal-overlay {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: white;
  border-radius: 15px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

.modal-header {
  padding: 20px 25px 15px;
  border-bottom: 1px solid #e1e5e9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8f9fa;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #2d3748;
  display: flex;
  align-items: center;
  gap: 10px;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-btn:hover {
  background: #f0f0f0;
  color: #333;
  transform: scale(1.1);
}

.modal-body {
  padding: 0;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  max-height: 70vh;
  overflow: hidden;
}

.modal-body img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0;
}

/* Modal Image Container */
.modal-body .image-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.modal-body .loading-indicator {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  color: #666;
  z-index: 1;
}

.modal-body .loading-indicator .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e9ecef;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.modal-body .preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: opacity 0.3s ease;
  border-radius: 8px;
}

.modal-body .image-container.loaded .loading-indicator {
  display: none;
}

.modal-body .preview-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  padding: 20px;
}

.modal-footer {
  padding: 15px 25px 20px;
  border-top: 1px solid #e1e5e9;
  display: flex;
  gap: 10px;
  justify-content: center;
  background: #f8f9fa;
}

.download-preview-btn,
.proxy-download-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.download-preview-btn:hover,
.proxy-download-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
  color: white;
  text-decoration: none;
}

.proxy-download-btn {
  background: linear-gradient(135deg, #48bb78, #38a169);
}

.proxy-download-btn:hover {
  box-shadow: 0 8px 25px rgba(72, 187, 120, 0.3);
}

/* Modal Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Prevent body scroll when modal is open */
body.modal-open {
  overflow: hidden;
}

/* Ensure modal is on top of everything */
.image-preview-modal {
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* Keyboard focus styles for modal */
.modal-content:focus {
  outline: none;
}

.close-btn:focus,
.download-preview-btn:focus,
.proxy-download-btn:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

/* Loading state for modal image */
.modal-body .image-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 300px;
  color: #666;
}

.modal-body .image-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e9ecef;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error state for modal image */
.modal-body .image-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 300px;
  color: #666;
  text-align: center;
  padding: 20px;
}

/* Download Notifications */
.download-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(10px);
  z-index: 99999;
  max-width: 400px;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: slideInRight 0.3s ease-out;
  border-left: 4px solid;
  word-wrap: break-word;
}

.download-notification i {
  font-size: 16px;
  flex-shrink: 0;
}

.download-notification .notification-message {
  flex: 1;
  line-height: 1.4;
}

/* Notification Types */
.download-notification.success {
  background: rgba(34, 197, 94, 0.95);
  color: white;
  border-left-color: #16a34a;
}

.download-notification.error {
  background: rgba(239, 68, 68, 0.95);
  color: white;
  border-left-color: #dc2626;
}

.download-notification.warning {
  background: rgba(245, 158, 11, 0.95);
  color: white;
  border-left-color: #d97706;
}

.download-notification.info {
  background: rgba(59, 130, 246, 0.95);
  color: white;
  border-left-color: #2563eb;
}

/* Notification Animations */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

/* Dark mode notification adjustments */
@media (prefers-color-scheme: dark) {
  .download-notification {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  }
}

/* Mobile responsive notifications */
@media (max-width: 768px) {
  .download-notification {
    top: 10px;
    right: 10px;
    left: 10px;
    max-width: none;
    font-size: 13px;
    padding: 14px 16px;
  }
}

/* Notification close button (optional enhancement) */
.download-notification .close-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.2s ease;
}

.download-notification .close-btn:hover {
  opacity: 1;
}

/* Loading Error State */
.loading-error {
  margin-top: 20px;
  text-align: center;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 12px;
  padding: 20px;
  max-width: 400px;
  animation: slideDown 0.3s ease-out;
}

.loading-error i {
  font-size: 2rem;
  color: #ef4444;
  margin-bottom: 10px;
  display: block;
}

.loading-error #errorMessage {
  display: block;
  margin-bottom: 15px;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1.4;
}

.loading-error .retry-btn,
.loading-error .cancel-btn {
  background: transparent;
  border: 1px solid;
  border-radius: 8px;
  padding: 8px 16px;
  margin: 0 5px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.loading-error .retry-btn {
  border-color: #22c55e;
  color: #22c55e;
}

.loading-error .retry-btn:hover {
  background: #22c55e;
  color: white;
}

.loading-error .cancel-btn {
  border-color: #64748b;
  color: #64748b;
}

.loading-error .cancel-btn:hover {
  background: #64748b;
  color: white;
}

/* Loading spinner states */
.loading-spinner.error-state .spinner {
  border-top-color: #ef4444;
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* Processing Status Styles */
.processing-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  margin: 20px 0;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

/* Default processing status (loading) */
.processing-status:not(.error) {
  background: linear-gradient(135deg, #e0f2fe, #b3e5fc);
  border: 2px solid #03a9f4;
  color: #01579b;
  box-shadow: 0 4px 12px rgba(3, 169, 244, 0.2);
}

.processing-status .spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #bbdefb;
  border-top: 2px solid #03a9f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* Error state for processing status */
.processing-status.error {
  background: linear-gradient(135deg, #ffebee, #ffcdd2);
  border: 2px solid #f44336;
  color: #b71c1c;

  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.25);
  animation: errorPulse 2s ease-in-out infinite;
}

.processing-status.error .error-icon {
  font-size: 1.5rem;
  color: #f44336;
  text-shadow: 0 2px 4px rgba(244, 67, 54, 0.3);
  animation: errorShake 0.5s ease-in-out;
}

.processing-status.error span {
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(183, 28, 28, 0.1);
}

/* Enhanced Media Info Container */
.media-info {
  background: rgba(255, 255, 255, 0.98);
  border-radius: 20px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.media-info h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: #2d3748;
  text-align: center;
}

/* Error-only media info (when no info-grid is shown) */
.media-info:has(.processing-status.error) {
  background: linear-gradient(135deg, #fef2f2, #fee2e2);
  border: 2px solid #fca5a5;
  box-shadow: 0 10px 30px rgba(248, 113, 113, 0.15);
}

/* Animations */
@keyframes errorPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.25);
  }
  50% {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(244, 67, 54, 0.35);
  }
}

@keyframes errorShake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-2px);
  }
  75% {
    transform: translateX(2px);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Accessibility */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus Management */
*:focus {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #667eea;
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 6px;
  background: #667eea;
  color: white;
  padding: 8px;
  border-radius: 4px;
  text-decoration: none;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 6px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High Contrast */
@media (prefers-contrast: high) {
  .header-content,
  .download-section,
  .platforms-section,
  .info-section {
    border: 2px solid #000;
  }

  .download-btn,
  .lang-toggle {
    border: 2px solid #000;
  }
}

/* Dark Mode Preference */
@media (prefers-color-scheme: dark) {
  body {
    background: linear-gradient(135deg, #1a202c 0%, #2d3748 100%);
  }
}

/* Language Selector */
.language-selector {
  position: relative;
  z-index: 9999;
  isolation: isolate;
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  background: linear-gradient(135deg, #667eea, #764ba2);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 0.6rem;
  color: white;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  min-width: 140px;
  justify-content: space-between;
  position: relative;
  z-index: 9999;
}

.lang-toggle:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #5a67d8, #6b46c1);
}

.lang-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.6rem;
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
  z-index: 99999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.lang-dropdown.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  z-index: 99999;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  color: #374151;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid #f3f4f6;
  position: relative;
}

.lang-option:first-child {
  border-top-left-radius: 0.6rem;
  border-top-right-radius: 0.6rem;
}

.lang-option:last-child {
  border-bottom: none;
  border-bottom-left-radius: 0.6rem;
  border-bottom-right-radius: 0.6rem;
}

.lang-option:hover {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  color: #1e293b;
}

.lang-option.active {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
}

.flag-img {
  width: 24px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}

.lang-option:hover .flag-img {
  transform: scale(1.05);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.4);
}

.lang-option.active .flag-img {
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.3);
}

.lang-toggle .flag-img {
  border: 1px solid rgba(255, 255, 255, 0.6);
}

.lang-name {
  font-weight: 500;
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
  margin-left: 0.25rem;
}

/* Ensure language selector is always on top */
.language-selector,
.language-selector *,
.lang-toggle,
.lang-dropdown {
  z-index: 99999 !important;
  position: relative;
}

.lang-dropdown {
  position: absolute !important;
}

/* Header responsive for language selector */
@media (max-width: 768px) {
  .header-content {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .header-left {
    text-align: center;
  }

  .language-selector {
    align-self: center;
    width: fit-content;
    margin: 0 auto;
  }

  .lang-dropdown {
    right: 0;
    left: auto;
    max-width: 90vw;
    width: max-content;
    min-width: 200px;
    z-index: 999999;
    position: absolute;
    top: calc(100% + 0.5rem);
    transform: translateY(-10px);
  }

  .lang-dropdown.show {
    transform: translateY(0);
    z-index: 999999;
  }
}

@media (max-width: 480px) {
  .language-selector {
    position: relative;
    width: 100%;
    max-width: 200px;
    margin: 0 auto;
  }

  .lang-dropdown {
    position: fixed !important;
    top: auto !important;
    bottom: auto !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) translateY(-10px) !important;
    max-height: 60vh;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15), 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .lang-dropdown.show {
    transform: translateX(-50%) translateY(0) !important;
  }

  /* Ensure dropdown appears above the toggle */
  .lang-toggle {
    position: relative;
    z-index: 1;
  }
}

/* Tablet adjustments */
@media (max-width: 768px) and (min-width: 481px) {
  .lang-dropdown {
    max-width: 250px;
    min-width: 200px;
  }
}
