﻿/* ==========================================================================
   TSave Pro - Editorial Downloader Tool & Results Styles
   Warm Ivory, Charcoal, Sand, and Focused Coral Palette
   ========================================================================== */

/* Hero Section */
.hero-downloader {
  padding: 5rem 0 3.5rem;
  background: var(--bg-ivory);
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 1.75rem;
}

.hero-badge i {
  color: var(--color-coral);
  font-size: 0.75rem;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(2.75rem, 5.5vw, 4.25rem);
  font-weight: 500;
  line-height: 1.08;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  letter-spacing: -0.025em;
}

/* Distinctive Editorial Italic Accent */
.hero-title-gradient {
  font-style: italic;
  font-weight: 400;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--color-coral);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.hero-subtitle {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2.5rem;
  line-height: 1.6;
}

/* Downloader Tool Box */
.downloader-box {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem;
  box-shadow: 0 4px 20px rgba(25, 25, 25, 0.05);
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}

.input-wrapper {
  display: flex;
  align-items: center;
  background: var(--bg-ivory);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.5rem;
  transition: var(--transition);
  position: relative;
}

.input-wrapper:focus-within {
  background: #ffffff;
  border-color: var(--text-primary);
  box-shadow: 0 0 0 1px var(--text-primary);
}

.input-icon {
  font-size: 1.15rem;
  color: var(--text-light);
  margin-left: 0.85rem;
  margin-right: 0.5rem;
}

.url-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  color: var(--text-primary);
  padding: 0.85rem 0.5rem;
  outline: none;
  min-width: 120px;
}

.url-input::placeholder {
  color: var(--text-light);
  font-size: 0.95rem;
}

.input-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 0.25rem;
}

.btn-paste, .btn-clear {
  background: #ffffff;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.55rem 0.85rem;
  border-radius: var(--radius-xs);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: var(--transition);
}

.btn-paste:hover, .btn-clear:hover {
  background: var(--bg-card-alt);
  border-color: var(--border-dark);
}

.btn-clear {
  display: none;
  padding: 0.55rem 0.7rem;
}

.btn-download-main {
  background: var(--color-coral);
  color: #ffffff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--color-coral);
  box-shadow: 0 1px 3px rgba(25, 25, 25, 0.08);
}

.btn-download-main:hover {
  background: var(--color-coral-hover);
  border-color: var(--color-coral-hover);
  color: #ffffff;
  transform: translateY(-1px);
}

.downloader-features-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.pill-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
}

.pill-item i {
  color: var(--color-coral);
  font-size: 0.85rem;
}

/* Loading State */
.download-loading {
  display: none;
  text-align: center;
  padding: 3rem 2rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  max-width: 760px;
  margin: 2.5rem auto;
  box-shadow: var(--shadow-sm);
}

.loader-spinner {
  width: 44px;
  height: 44px;
  border: 2px solid var(--border-color);
  border-top-color: var(--color-coral);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
  margin: 0 auto 1.25rem;
}

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

.loading-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.loading-subtext {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Error State */
.download-error {
  display: none;
  align-items: flex-start;
  gap: 1rem;
  background: var(--error-bg);
  border: 1px solid #fecaca;
  border-left: 3px solid var(--error);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  max-width: 760px;
  margin: 2rem auto;
  text-align: left;
}

.error-icon-box {
  color: var(--error);
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}

.error-title {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  color: #991b1b;
  margin-bottom: 0.25rem;
}

.error-desc {
  font-size: 0.9rem;
  color: #b91c1c;
  line-height: 1.5;
}

/* ==========================================================================
   Editorial Results Card
   ========================================================================== */
.download-result {
  display: none;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-width: 820px;
  margin: 2.5rem auto;
  overflow: hidden;
  text-align: left;
}

.result-header {
  padding: 1.25rem 1.75rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-ivory);
}

.author-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.author-avatar-img {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-color);
}

.author-names {
  text-align: left;
}

.author-nickname {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.975rem;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.verified-icon {
  color: var(--color-coral);
  font-size: 0.85rem;
}

.author-handle {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--text-muted);
}

.btn-new-download {
  background: #ffffff;
  border: 1px solid var(--border-color);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-new-download:hover {
  background: var(--bg-card-alt);
  border-color: var(--text-primary);
}

.result-body {
  padding: 2rem;
}

.video-caption-text {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 1.75rem;
  text-align: left;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

/* Result Content Grid */
.result-content-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.result-content-grid > * {
  min-width: 0;
  box-sizing: border-box;
}

.media-preview-box {
  background: #0f172a;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  text-align: center;
}

.media-preview-box video {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  display: block;
}

.media-preview-box video::-internal-media-controls-download-button {
  display: none !important;
}

.media-preview-box img.cover-preview {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.media-type-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(25, 25, 25, 0.85);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-xs);
}

/* Quality & Format Options */
.actions-heading,
.options-list-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.download-actions-wrapper,
.format-options-group {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.75rem;
  width: 100% !important;
  min-width: 0;
  box-sizing: border-box !important;
}

.download-actions-wrapper > *,
.format-options-group > * {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.option-action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding: 0.9rem 1.15rem;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  gap: 0.75rem;
  min-width: 0;
}

.option-action-btn.hidden,
.option-action-btn[style*="display: none"] {
  display: none !important;
}

.option-action-btn:hover {
  background: var(--bg-ivory);
  border-color: var(--text-primary);
  transform: translateY(-1px);
}

/* Featured Download Button in Signature Coral */
.option-action-btn.btn-featured {
  background: var(--color-coral);
  color: #ffffff;
  border: 1px solid var(--color-coral);
  box-shadow: 0 1px 3px rgba(25, 25, 25, 0.08);
}

.option-action-btn.btn-featured:hover {
  background: var(--color-coral-hover);
  border-color: var(--color-coral-hover);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(25, 25, 25, 0.12);
}

.action-btn-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1;
}

.action-btn-left i {
  font-size: 1.1rem;
  flex-shrink: 0;
}

.action-btn-left span:not(.action-badge) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Action Badges like 'Fast' or 'HD' */
.action-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-xs);
  background: var(--bg-sand);
  color: var(--text-primary);
  flex-shrink: 0;
  line-height: 1.2;
}

.option-action-btn.btn-featured .action-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.action-btn-right {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  background: var(--bg-ivory);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
  text-align: center;
}

.option-action-btn.btn-featured .action-btn-right {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

/* Direct download notice */
.download-notice-box {
  margin-top: 1.25rem;
  padding: 0.85rem 1rem;
  background: var(--bg-ivory);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.825rem;
  color: var(--text-muted);
  line-height: 1.5;
  width: 100%;
  box-sizing: border-box;
}

.download-notice-box i {
  color: var(--text-primary);
  font-size: 0.95rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
}

/* Photo Gallery Slideshow Section */
.photo-gallery-container,
.photo-gallery-section {
  display: none;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
  width: 100%;
}

.photo-gallery-header,
.gallery-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-light);
}

.photo-gallery-header h4,
.gallery-header-row h4,
#gallery-count-text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#btn-download-all-photos,
.btn-download-all-photos {
  background: var(--color-coral);
  color: #ffffff;
  border: 1px solid var(--color-coral);
  border-radius: var(--radius-xs);
  padding: 0.65rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: var(--transition);
  box-shadow: 0 1px 3px rgba(25, 25, 25, 0.08);
}

#btn-download-all-photos:hover,
.btn-download-all-photos:hover {
  background: var(--color-coral-hover);
  border-color: var(--color-coral-hover);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(25, 25, 25, 0.12);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Photo Gallery Item Card */
.gallery-item {
  position: relative;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.gallery-item:hover {
  border-color: var(--text-primary);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Portrait Image Frame - preserves 4:5 vertical proportions without cropping */
.gallery-img-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  background: #191919;
  overflow: hidden;
}

.gallery-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-item:hover .gallery-img-wrapper img {
  transform: scale(1.03);
}

/* Badges on the image frame */
.gallery-badge-slide {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(25, 25, 25, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.25rem 0.55rem;
  border-radius: var(--radius-xs);
  letter-spacing: 0.03em;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.gallery-badge-format {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(247, 245, 240, 0.95);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-xs);
  letter-spacing: 0.04em;
  border: 1px solid var(--border-color);
  z-index: 2;
}

/* Card Footer with Details & Download Button */
.gallery-item-footer {
  padding: 0.85rem 1rem;
  background: #ffffff;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.gallery-item-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.gallery-item-name {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-item-res {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.gallery-download-btn {
  background: var(--bg-ivory);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xs);
  padding: 0.45rem 0.85rem;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  flex-shrink: 0;
}

.gallery-download-btn:hover {
  background: var(--color-coral);
  color: #ffffff;
  border-color: var(--color-coral);
  transform: translateY(-1px);
}

/* Download Progress Box */
.download-progress-container {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-ivory);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
}

.progress-track {
  width: 100%;
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-coral);
  border-radius: 2px;
  transition: width 0.2s ease;
}

/* Responsive Breakpoints */
@media (max-width: 880px) {
  .result-content-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
  
  .media-preview-box {
    max-width: 320px;
    margin: 0 auto;
    width: 100%;
  }

  .download-actions-wrapper,
  .format-options-group {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-downloader {
    padding: 3.5rem 0 2.5rem;
  }
  
  .downloader-box {
    padding: 0.5rem;
  }
  
  .input-wrapper {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0.5rem;
  }
  
  .input-icon {
    display: none;
  }
  
  .input-controls {
    justify-content: flex-end;
    margin-right: 0;
  }
  
  .btn-download-main {
    width: 100%;
  }
  
  .result-body {
    padding: 1.5rem;
  }
}

@media (max-width: 600px) {
  .photo-gallery-header,
  .gallery-header-row {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 0.85rem;
  }

  .photo-gallery-header h4,
  .gallery-header-row h4,
  #gallery-count-text {
    justify-content: center;
    font-size: 1.15rem;
  }

  #btn-download-all-photos,
  .btn-download-all-photos {
    width: 100%;
    justify-content: center;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 1.15rem;
  }

  .gallery-item {
    max-width: 360px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  .downloader-box {
    padding: 0.4rem;
  }

  .download-error {
    padding: 1rem 0.85rem;
    gap: 0.65rem;
    margin: 1.25rem auto;
  }

  .downloader-features-pills {
    gap: 0.65rem 1rem;
    margin-top: 1.15rem;
  }

  .result-body {
    padding: 1.25rem 0.85rem;
  }

  .result-header {
    padding: 1rem 0.85rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .actions-heading,
  .options-list-title {
    font-size: 1.15rem;
    text-align: center;
  }

  .download-actions-wrapper,
  .format-options-group {
    width: 100% !important;
  }

  .option-action-btn {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0.75rem 0.85rem;
    font-size: 0.875rem;
    gap: 0.5rem;
    box-sizing: border-box !important;
  }

  .action-btn-left {
    gap: 0.45rem;
    min-width: 0;
  }

  .action-btn-left span:not(.action-badge) {
    font-size: 0.85rem;
    white-space: normal;
    line-height: 1.3;
  }

  .action-badge {
    display: none;
  }

  .action-btn-right {
    font-size: 0.7rem;
    padding: 0.2rem 0.45rem;
  }

  .download-notice-box {
    padding: 0.75rem 0.85rem;
    font-size: 0.775rem;
  }
}
