/* Downloads and downloading pages styles */

/* ===== DOWNLOADS PAGE ===== */

.downloads-section {
  padding: 0 24px 80px;
}

.downloads-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: var(--container-max);
  margin: 0 auto;
}

.download-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 40px 28px 32px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text-primary);
  transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              box-shadow 0.3s cubic-bezier(0.25, 0.1, 0.25, 1),
              border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}

.download-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.download-card-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  transition: transform 0.3s ease;
}

.download-card-icon svg {
  width: 36px;
  height: 36px;
}

.download-card-icon i {
  font-size: 36px;
}

.download-card:hover .download-card-icon {
  transform: scale(1.1);
}

.download-card-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.download-card-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
}

.download-card-action {
  margin-top: auto;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.download-btn i {
  font-size: 12px;
  transition: transform 0.2s ease;
}

.download-card:hover .download-btn i {
  transform: translateX(3px);
}

/* Platform: iOS */
.download-card--ios .download-card-icon {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

.download-card--ios .download-btn {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

.download-card--ios:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Platform: Android */
.download-card--android .download-card-icon {
  background: rgba(61, 220, 132, 0.1);
  color: #3DDC84;
}

.download-card--android .download-btn {
  background: rgba(61, 220, 132, 0.1);
  color: #2da866;
}

.download-card--android:hover {
  border-color: rgba(61, 220, 132, 0.4);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(61, 220, 132, 0.15);
}

/* Platform: macOS */
.download-card--macos .download-card-icon {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

.download-card--macos .download-btn {
  background: rgba(0, 0, 0, 0.06);
  color: #1d1d1f;
}

.download-card--macos:hover {
  border-color: rgba(0, 0, 0, 0.2);
}

/* Platform: Windows */
.download-card--windows .download-card-icon {
  background: rgba(0, 120, 212, 0.1);
  color: #0078D4;
}

.download-card--windows .download-btn {
  background: rgba(0, 120, 212, 0.1);
  color: #0078D4;
}

.download-card--windows:hover {
  border-color: rgba(0, 120, 212, 0.4);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 120, 212, 0.15);
}

/* Platform: Linux */
.download-card--linux .download-card-icon {
  background: rgba(233, 84, 32, 0.1);
  color: #E95420;
}

.download-card--linux .download-btn {
  background: rgba(233, 84, 32, 0.1);
  color: #E95420;
}

.download-card--linux:hover {
  border-color: rgba(233, 84, 32, 0.4);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(233, 84, 32, 0.15);
}

/* Platform: Web */
.download-card--web .download-card-icon {
  background: rgba(0, 119, 237, 0.1);
  color: var(--blue);
}

.download-card--web .download-btn {
  background: rgba(0, 119, 237, 0.1);
  color: var(--blue);
}

.download-card--web:hover {
  border-color: rgba(0, 119, 237, 0.4);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 119, 237, 0.15);
}

/* Disabled download card */
.download-card--disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

.download-btn--disabled {
  background: var(--bg-tertiary) !important;
  color: var(--text-tertiary) !important;
}

/* Dark mode: Apple cards */
[data-theme="dark"] .download-card--ios .download-card-icon,
[data-theme="dark"] .download-card--macos .download-card-icon {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

[data-theme="dark"] .download-card--ios .download-btn,
[data-theme="dark"] .download-card--macos .download-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #f5f5f7;
}

[data-theme="dark"] .download-card--ios:hover,
[data-theme="dark"] .download-card--macos:hover {
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: var(--shadow-lg), 0 0 20px rgba(255, 255, 255, 0.08);
}

/* Sync section */
.downloads-sync {
  padding: 0 24px 80px;
}

.sync-box {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 32px 40px;
  background: var(--bg-secondary);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  max-width: var(--container-max);
  margin: 0 auto;
}

.sync-icon {
  width: 56px;
  height: 56px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.sync-text h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 6px;
}

.sync-text p {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Downloads responsive */
@media (max-width: 1024px) {
  .downloads-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .downloads-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .download-card {
    padding: 28px 20px 24px;
  }

  .sync-box {
    flex-direction: column;
    text-align: center;
    padding: 28px 24px;
  }
}

@media (max-width: 480px) {
  .downloads-grid {
    grid-template-columns: 1fr;
  }
}


/* ===== DOWNLOADING PAGE ===== */

.downloading-page {
  padding: 160px 24px 120px;
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.downloading-card {
  max-width: 520px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
  padding: 60px 40px;
  background: var(--bg-card);
  border-radius: 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
}

/* States */
.downloading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: fadeInUp 0.6s cubic-bezier(0.25, 0.1, 0.25, 1) forwards;
}

.downloading-state--success {
  display: none;
}

/* Platform icon */
.downloading-icon {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
}

.downloading-icon svg {
  width: 44px;
  height: 44px;
}

.downloading-card--macos .downloading-icon {
  background: #1d1d1f;
}

.downloading-card--macos .downloading-icon svg {
  width: 38px;
  height: 38px;
}

.downloading-card--windows .downloading-icon {
  background: rgba(0, 120, 212, 0.1);
  color: #0078D4;
}

.downloading-card--linux .downloading-icon {
  background: rgba(233, 84, 32, 0.08);
}

.downloading-card--linux .downloading-icon svg {
  width: 48px;
  height: 48px;
}

[data-theme="dark"] .downloading-card--macos .downloading-icon {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .downloading-card--windows .downloading-icon {
  background: rgba(0, 120, 212, 0.15);
}

[data-theme="dark"] .downloading-card--linux .downloading-icon {
  background: rgba(233, 84, 32, 0.12);
}

/* Spinner */
.downloading-spinner {
  margin-bottom: 32px;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spinnerRotate 1s linear infinite;
}

@keyframes spinnerRotate {
  to { transform: rotate(360deg); }
}

.downloading-card--windows .spinner-ring {
  border-top-color: #0078D4;
}

.downloading-card--linux .spinner-ring {
  border-top-color: #E95420;
}

/* Typography */
.downloading-card h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.downloading-subtitle {
  font-size: 17px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

/* Animated checkmark */
.downloading-checkmark {
  width: 72px;
  height: 72px;
  margin-bottom: 32px;
}

.checkmark-svg {
  width: 72px;
  height: 72px;
}

.checkmark-circle {
  stroke: var(--green);
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: checkmarkCircle 0.6s ease-in-out forwards;
}

.checkmark-path {
  stroke: var(--green);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: checkmarkDraw 0.4s 0.4s ease-in-out forwards;
}

@keyframes checkmarkCircle {
  to { stroke-dashoffset: 0; }
}

@keyframes checkmarkDraw {
  to { stroke-dashoffset: 0; }
}

/* Instructions box */
.downloading-instructions {
  margin-top: 32px;
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: 14px;
  text-align: left;
  width: 100%;
}

.downloading-instructions p {
  font-weight: 600;
  margin-bottom: 12px;
  font-size: 15px;
  color: var(--text-primary);
}

.downloading-instructions ol {
  list-style: decimal;
  padding-left: 20px;
  margin: 0;
}

.downloading-instructions li {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.9;
}

/* Action buttons */
.downloading-actions {
  margin-top: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.downloading-actions .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.downloading-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color var(--transition);
}

.downloading-retry:hover {
  color: var(--text-primary);
}

.downloading-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-tertiary);
  text-decoration: none;
  transition: color var(--transition);
}

.downloading-link:hover {
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 600px) {
  .downloading-page {
    padding: 120px 16px 80px;
  }

  .downloading-card {
    padding: 40px 24px;
  }

  .downloading-card h1 {
    font-size: 22px;
  }

  .downloading-subtitle {
    font-size: 15px;
  }
}
