/* Dashboard Styles */
.dashboard-main {
  position: relative;
  z-index: 1;
  padding: 100px 1.5rem 1.5rem;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
}

/* Grid Background */
.dashboard-main::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -2;
}

/* Colored Glows */
.dashboard-main::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(ellipse 600px 400px at 20% 20%, rgba(139, 92, 246, 0.12), transparent 70%),
    radial-gradient(ellipse 500px 350px at 80% 30%, rgba(59, 130, 246, 0.1), transparent 70%),
    radial-gradient(ellipse 600px 400px at 70% 80%, rgba(16, 185, 129, 0.08), transparent 70%),
    radial-gradient(ellipse 400px 300px at 10% 70%, rgba(245, 158, 11, 0.06), transparent 70%);
  pointer-events: none;
  z-index: -1;
}

.dashboard-container {
  max-width: 900px;
  width: 70%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  grid-template-areas:
    "left options"
    "videos videos";
  align-items: stretch;
}

.dashboard-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-align: left;
  grid-area: title;
}

.dashboard-section {
  background: rgba(15, 18, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
}

/* Left column - upload + generate stacked */
.dashboard-left {
  grid-area: left;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-section {
  position: relative;
  flex: 1;
  min-height: 200px;
  justify-content: center;
  overflow: hidden;
}

.generate-section {
  padding: 1rem 1.25rem;
  flex-shrink: 0;
}

.options-section {
  grid-area: options;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: transparent !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: none !important;
  padding: 0 !important;
}

.videos-section {
  grid-area: videos;
}

/* View More Button */
.btn-view-more {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding: 0.875rem 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-view-more:hover {
  background: rgba(139, 92, 246, 0.2);
  border-color: rgba(139, 92, 246, 0.4);
  color: white;
}

.btn-view-more:active {
  transform: scale(0.98);
}

/* Upload Area */
.upload-area {
  border: 2px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  justify-content: center;
}

.upload-area:hover {
  border-color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.02);
}

.upload-area.drag-over {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.15);
  transform: scale(1.02);
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.3);
}

.upload-area.drag-over .upload-icon {
  transform: scale(1.1);
  color: #8b5cf6;
}

.upload-area.drag-over .upload-title {
  color: #a78bfa;
}

/* Page-wide drop overlay */
.drop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(139, 92, 246, 0.1);
  backdrop-filter: blur(4px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.drop-overlay.active {
  display: flex;
}

.drop-overlay-content {
  background: rgba(26, 26, 46, 0.95);
  border: 3px dashed #8b5cf6;
  border-radius: 24px;
  padding: 4rem;
  text-align: center;
  animation: pulse-border 1.5s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% { border-color: #8b5cf6; box-shadow: 0 0 20px rgba(139, 92, 246, 0.3); }
  50% { border-color: #a78bfa; box-shadow: 0 0 40px rgba(139, 92, 246, 0.5); }
}

.drop-overlay-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 1.5rem;
  color: #8b5cf6;
}

.drop-overlay-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: white;
  margin-bottom: 0.5rem;
}

.drop-overlay-subtext {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.6);
}

.upload-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
}

.upload-icon svg {
  width: 32px;
  height: 32px;
}

.upload-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.upload-info {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}

.upload-shortcut {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.upload-preview {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  overflow: hidden;
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: rgba(0, 0, 0, 0.3);
}

.remove-image {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.remove-image:hover {
  background: rgba(0, 0, 0, 0.9);
  transform: scale(1.1);
}

/* Option Groups */
.option-group {
  margin-bottom: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: rgba(15, 18, 25, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.option-group:last-child {
  margin-bottom: 0;
}

.option-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.option-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.option-icon svg {
  width: 20px;
  height: 20px;
}

.option-title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.option-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
}

.option-subtitle {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

/* Category Colors */
.option-purple {
  border-color: rgba(139, 92, 246, 0.2);
}
.option-purple .option-icon {
  background: rgba(139, 92, 246, 0.15);
  color: #a78bfa;
}

.option-amber {
  border-color: rgba(245, 158, 11, 0.2);
}
.option-amber .option-icon {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.option-green {
  border-color: rgba(16, 185, 129, 0.2);
}
.option-green .option-icon {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.radio-group {
  display: flex;
  flex-direction: row;
  gap: 0.625rem;
  flex-wrap: wrap;
}

.radio-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 0.75rem 2.5rem 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex: 1;
  min-width: 0;
}

.radio-option input[type="radio"] {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 18px;
  height: 18px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
  transition: all 0.2s ease;
}

.radio-option input[type="radio"]:checked {
  border-color: var(--primary);
  background: var(--primary);
}

.radio-option input[type="radio"]:checked::after {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  background: white;
  border-radius: 50%;
  margin: 4px;
}

.option-name {
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.option-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Purple category options */
.option-purple .radio-option {
  background: rgba(139, 92, 246, 0.05);
  border-color: rgba(139, 92, 246, 0.15);
}
.option-purple .radio-option:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
}
.option-purple .radio-option.checked {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
}
.option-purple .radio-option.checked .option-name {
  color: #a78bfa;
}
.option-purple .radio-option input[type="radio"]:checked {
  border-color: #a78bfa;
  background: #a78bfa;
}

/* Amber category options */
.option-amber .radio-option {
  background: rgba(245, 158, 11, 0.05);
  border-color: rgba(245, 158, 11, 0.15);
}
.option-amber .radio-option:hover {
  background: rgba(245, 158, 11, 0.1);
  border-color: rgba(245, 158, 11, 0.3);
}
.option-amber .radio-option.checked {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.5);
}
.option-amber .radio-option.checked .option-name {
  color: #fbbf24;
}
.option-amber .radio-option input[type="radio"]:checked {
  border-color: #fbbf24;
  background: #fbbf24;
}

/* Green category options */
.option-green .radio-option {
  background: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.15);
}
.option-green .radio-option:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}
.option-green .radio-option.checked {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.5);
}
.option-green .radio-option.checked .option-name {
  color: #34d399;
}
.option-green .radio-option input[type="radio"]:checked {
  border-color: #34d399;
  background: #34d399;
}

/* Disabled state */
.radio-option.radio-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.radio-option.radio-disabled:hover {
  transform: none;
}

.coming-soon {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
}

.credit-badge {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.25rem;
}

.option-green .radio-option.checked .credit-badge {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}

/* Credits Info */
.credits-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 8px;
}

.credits-text {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.credits-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: opacity 0.3s ease;
}

.credits-link:hover {
  opacity: 0.8;
}

.btn-generate {
  width: 100%;
  padding: 0.875rem;
  font-size: 1rem;
  font-weight: 600;
}

.btn-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* My Videos Section */
.section-heading {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 1rem;
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

.video-placeholder {
  grid-column: 1 / -1;
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.video-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: var(--bg-secondary);
  aspect-ratio: 1;
}

.video-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Video Cards */
.video-card {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(15, 18, 25, 0.9);
  border: 1px solid var(--border-color);
}

.video-card-preview {
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.3);
}

.video-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.video-card-preview:hover .video-overlay {
  opacity: 1;
}

.play-btn {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #1a1a2e;
  transition: transform 0.2s ease;
}

.play-btn:hover {
  transform: scale(1.1);
}

.video-card-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  gap: 0.5rem;
}

.video-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}

.status-processing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
}

.status-complete {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
}

.status-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.video-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: var(--text-primary);
}

.download-btn-small {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: auto;
}

.download-btn-small:hover {
  background: rgba(167, 139, 250, 0.3);
  color: var(--primary);
}

/* Loading States */
.video-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
}

.loading-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 1rem 0 0.25rem;
}

.loading-eta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0;
}

.loading-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
  margin-right: 8px;
}

.loading-spinner-large {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(139, 92, 246, 0.2);
  border-top-color: #a78bfa;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Failed State */
.video-failed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1.5rem;
  text-align: center;
  color: #f87171;
}

.video-failed svg {
  opacity: 0.6;
}

.video-failed p {
  font-size: 0.8125rem;
  margin: 0.75rem 0 0;
  color: var(--text-muted);
}

/* Responsive */
@media (max-width: 1024px) {
  .dashboard-container {
    width: 90%;
    max-width: 600px;
    grid-template-columns: 1fr;
    grid-template-areas:
      "left"
      "options"
      "videos";
  }

  .dashboard-left {
    gap: 1rem;
  }
  
  .videos-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .dashboard-main {
    padding: 100px 1rem 1rem;
    max-height: none;
  }

  .dashboard-container {
    width: 95%;
  }

  .dashboard-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  .dashboard-section {
    padding: 1.25rem;
  }

  .upload-area {
    padding: 1.5rem;
    min-height: 180px;
  }

  .videos-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .video-card {
    max-width: 100%;
  }
  
  .btn-view-more {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }

  .radio-option {
    padding: 0.625rem 2.25rem 0.625rem 0.75rem;
  }

  .option-name {
    font-size: 0.8125rem;
  }

  .option-desc {
    font-size: 0.6875rem;
  }

  .radio-option input[type="radio"] {
    top: 0.625rem;
    right: 0.5rem;
    width: 16px;
    height: 16px;
  }

  .radio-option input[type="radio"]:checked::after {
    width: 5px;
    height: 5px;
    margin: 3.5px;
  }
}

/* Generation Progress Bar */
.generation-progress {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  border: 1px solid rgba(139, 92, 246, 0.2);
}

.progress-bar-container {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.75rem;
}

.progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8b5cf6, #a78bfa);
  border-radius: 4px;
  transition: width 0.3s ease;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.progress-percent {
  font-size: 1.25rem;
  font-weight: 700;
  color: #a78bfa;
}

.progress-text {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Video Preview */
.video-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  overflow: hidden;
  background: #1a1a2e;
}

.video-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.download-btn-overlay {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  text-decoration: none;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  padding: 0;
}

.download-btn-overlay:hover {
  background: rgba(139, 92, 246, 0.8);
  transform: scale(1.05);
}

.download-btn-overlay:active {
  transform: scale(0.95);
}

/* Video Controls */
.video-controls {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 8px;
}

.video-controls .download-btn-overlay {
  position: relative;
  top: auto;
  right: auto;
}

/* Play Button Overlay */
.play-btn-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.2);
  padding: 0;
  z-index: 10;
}

.play-btn-overlay:hover {
  background: rgba(139, 92, 246, 0.8);
  transform: translate(-50%, -50%) scale(1.1);
  border-color: rgba(139, 92, 246, 0.5);
}

.play-btn-overlay:active {
  transform: translate(-50%, -50%) scale(0.95);
}

.play-btn-overlay.playing {
  opacity: 0;
  pointer-events: none;
}

.video-preview:hover .play-btn-overlay.playing {
  opacity: 1;
  pointer-events: auto;
}

.play-btn-overlay .play-icon {
  margin-left: 4px;
}

/* Sound Toggle Button */
.sound-toggle {
  width: 40px;
  height: 40px;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0;
}

.sound-toggle:hover {
  background: rgba(139, 92, 246, 0.8);
  transform: scale(1.05);
}

.sound-toggle:active {
  transform: scale(0.95);
}

.sound-toggle.muted {
  color: rgba(255, 255, 255, 0.5);
}

/* Make Another Video button style */
.btn-generate.btn-another {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-generate.btn-another:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
}
