/* Layout & Modal Styles */

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #FAF5ED 100%);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--color-border-light);
  animation: slideUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-md);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--color-border-light);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.5rem;
  color: hsl(var(--foreground));
}

.modal-body {
  margin-top: var(--spacing-md);
}

.label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: hsl(var(--foreground));
  font-size: 0.9rem;
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal.hidden {
  display: none;
}

/* Collection Modal */
.collection-modal-content {
  max-width: 600px;
}

.collection-list {
  max-height: 400px;
  overflow-y: auto;
  margin: var(--spacing-md) 0;
}

.collection-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  margin-bottom: var(--spacing-xs);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.collection-item:hover {
  background: linear-gradient(135deg, var(--color-sand-light) 0%, var(--color-sand) 100%);
  transform: translateX(4px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.collection-item-info {
  flex: 1;
}

.collection-item-name {
  font-weight: 500;
  color: var(--color-text);
}

.collection-item-meta {
  font-size: 0.85rem;
  color: var(--color-text-light);
  margin-top: 0.25rem;
}

/* Page Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--spacing-lg);
  gap: var(--spacing-md);
}

.page-header-content {
  flex: 1;
}

.page-header-content h1 {
  margin-bottom: var(--spacing-xs);
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-primary-dark);
}

.page-header-content p {
  margin: 0;
  font-size: 1rem;
}

@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  .page-header .btn {
    width: 100%;
  }
}

/* Step Page Layout (and Move Page for backwards compatibility) */
.step-page,
.move-page {
  max-width: 1000px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.step-video-section,
.move-video-section {
  background: linear-gradient(135deg, #ffffff 0%, #FAF5ED 100%);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border-light);
}

.video-clips-section {
  background: linear-gradient(135deg, #ffffff 0%, #FAF5ED 100%);
  padding: var(--spacing-lg);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.06);
  border: 1px solid var(--color-border-light);
}

/* Loading States */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-sand);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: var(--color-white);
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 2000;
  animation: slideIn 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-success {
  background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
}

.toast-error {
  background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .modal-content {
    width: 95%;
    padding: var(--spacing-md);
    max-height: 90vh;
    border-radius: var(--radius-md);
  }
  
  .modal-content .form-group {
    margin-bottom: var(--spacing-md);
  }
  
  .toast {
    right: 1rem;
    left: 1rem;
    bottom: 1rem;
    font-size: 0.9rem;
    padding: var(--spacing-sm);
  }
  
  /* Step Page */
  .step-video-section,
  .move-video-section,
  .video-clips-section {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
  }
  
  .video-clip-item {
    flex-direction: column;
    gap: var(--spacing-sm);
  }
  
  .video-clip-thumbnail {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
  }
}

@media (max-width: 480px) {
  .modal-content {
    width: 100%;
    max-height: 100vh;
    border-radius: 0;
    margin: 0;
    padding: var(--spacing-md) var(--spacing-sm);
  }
  
  .toast {
    right: 0.5rem;
    left: 0.5rem;
    bottom: 0.5rem;
  }
}
