/* ============================================
   PIXELARCHIVE DESIGN SYSTEM
   Version 1.0 - 2026

   This file contains all design tokens, utility
   classes, and reusable component styles.
   ============================================ */

/* ============================================
   1. CSS VARIABLES - Design Tokens
   ============================================ */
:root {
  /* Brand Colors */
  /* One brand colour: indigo (refactor 5.2; was purple here while the rest was indigo) */
  --brand-primary: #4f46e5;
  /* indigo-600 */
  --brand-primary-hover: #4338ca;
  /* indigo-700 */
  --brand-primary-light: #eef2ff;
  /* indigo-50 */
  --brand-secondary: #4f46e5;
  /* indigo-600 */

  /* Tier Colors */
  --tier-free: #6b7280;
  /* gray-500 */
  --tier-basic: #3b82f6;
  /* blue-500 */
  --tier-plus: #a855f7;
  /* purple-500 */
  --tier-pro: #eab308;
  /* yellow-500 */

  /* Tier Light Backgrounds */
  --tier-free-bg: #f9fafb;
  /* gray-50 */
  --tier-basic-bg: #eff6ff;
  /* blue-50 */
  --tier-plus-bg: #faf5ff;
  /* purple-50 */
  --tier-pro-bg: #fefce8;
  /* yellow-50 */

  /* Status Colors */
  --status-success: #10b981;
  /* green-500 */
  --status-warning: #f59e0b;
  /* amber-500 */
  --status-error: #ef4444;
  /* red-500 */
  --status-info: #06b6d4;
  /* cyan-500 */

  /* Text Colors */
  --text-primary: #111827;
  /* gray-900 */
  --text-secondary: #4b5563;
  /* gray-600 */
  --text-tertiary: #6b7280;
  /* gray-500 */
  --text-muted: #9ca3af;
  /* gray-400 */
  --text-inverted: #ffffff;

  /* Background Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f9fafb;
  /* gray-50 */
  --bg-tertiary: #f3f4f6;
  /* gray-100 */
  --bg-dark: #1f2937;
  /* gray-800 */

  /* Border Colors */
  --border-light: #e5e7eb;
  /* gray-200 */
  --border-medium: #d1d5db;
  /* gray-300 */
  --border-dark: #9ca3af;
  /* gray-400 */

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);

  /* Special Shadows */
  --shadow-tier-glow: 0 0 20px rgba(168, 85, 247, 0.3);
  --shadow-success-glow: 0 0 20px rgba(16, 185, 129, 0.3);

  /* Spacing Scale */
  --spacing-0: 0;
  --spacing-1: 0.25rem;
  /* 4px */
  --spacing-2: 0.5rem;
  /* 8px */
  --spacing-3: 0.75rem;
  /* 12px */
  --spacing-4: 1rem;
  /* 16px */
  --spacing-5: 1.25rem;
  /* 20px */
  --spacing-6: 1.5rem;
  /* 24px */
  --spacing-8: 2rem;
  /* 32px */
  --spacing-10: 2.5rem;
  /* 40px */
  --spacing-12: 3rem;
  /* 48px */
  --spacing-16: 4rem;
  /* 64px */

  /* Border Radius */
  --radius-none: 0;
  --radius-sm: 0.375rem;
  /* 6px */
  --radius-md: 0.5rem;
  /* 8px */
  --radius-lg: 0.75rem;
  /* 12px */
  --radius-xl: 1rem;
  /* 16px */
  --radius-2xl: 1.5rem;
  /* 24px */
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 400ms cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Z-Index Scale */
  --z-base: 1;
  --z-dropdown: 10;
  --z-sticky: 20;
  --z-overlay: 30;
  --z-modal: 40;
  --z-popover: 50;
  --z-tooltip: 60;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'SF Mono', Monaco, 'Cascadia Code', Consolas, monospace;
}

/* ============================================
   2. UTILITY CLASSES
   ============================================ */

/* Tier Badge Styles */
.badge-tier {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.badge-tier-free {
  background-color: var(--tier-free-bg);
  color: var(--tier-free);
}

.badge-tier-basic {
  background-color: var(--tier-basic-bg);
  color: var(--tier-basic);
}

.badge-tier-plus {
  background-color: var(--tier-plus-bg);
  color: var(--tier-plus);
}

.badge-tier-pro {
  background-color: var(--tier-pro-bg);
  color: var(--tier-pro);
}

/* Status Badge Styles */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-status-success {
  background-color: #d1fae5;
  /* green-100 */
  color: #065f46;
  /* green-800 */
}

.badge-status-warning {
  background-color: #fef3c7;
  /* amber-100 */
  color: #92400e;
  /* amber-800 */
}

.badge-status-error {
  background-color: #fee2e2;
  /* red-100 */
  color: #991b1b;
  /* red-800 */
}

.badge-status-info {
  background-color: #cffafe;
  /* cyan-100 */
  color: #155e75;
  /* cyan-800 */
}

/* Button Styles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

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

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.btn-md {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-xl {
  padding: 1rem 2rem;
  font-size: 1.125rem;
}

/* Button Variants */
.btn-primary {
  background-color: var(--brand-primary);
  color: var(--text-inverted);
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  border: 2px solid var(--border-medium);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover:not(:disabled) {
  background-color: var(--bg-secondary);
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-primary);
  border: 2px solid var(--brand-primary);
}

.btn-outline:hover:not(:disabled) {
  background-color: var(--brand-primary-light);
  border-color: var(--brand-primary-hover);
  color: var(--brand-primary-hover);
}

.btn-ghost {
  background-color: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.btn-danger {
  background-color: var(--status-error);
  color: var(--text-inverted);
}

.btn-danger:hover:not(:disabled) {
  background-color: #dc2626;
  /* red-600 */
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.btn-success {
  background-color: var(--status-success);
  color: var(--text-inverted);
}

.btn-success:hover:not(:disabled) {
  background-color: #059669;
  /* green-600 */
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

/* Gradient Buttons */
.btn-gradient-purple {
  background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%);
  color: var(--text-inverted);
  box-shadow: var(--shadow-md);
}

.btn-gradient-purple:hover:not(:disabled) {
  background: linear-gradient(135deg, #9333ea 0%, #6d28d9 100%);
  box-shadow: var(--shadow-tier-glow);
  transform: translateY(-2px);
}

/* Card Styles */
.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-highlight {
  border: 3px solid var(--brand-primary);
  position: relative;
}

.card-hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.card-hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.card-gradient {
  background: linear-gradient(135deg, #e9d5ff 0%, #c4b5fd 50%, #ddd6fe 100%);
  /* purple-200 to purple-300 gradient */
  border: 1px solid #c4b5fd;
}

/* Loading States */
.skeleton {
  display: block;
  background: linear-gradient(90deg,
      #f3f4f6 25%,
      #e5e7eb 50%,
      #f3f4f6 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s ease-in-out infinite;
  border-radius: var(--radius-md);
  overflow: hidden;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.spinner {
  display: inline-block;
  width: 1.5rem;
  height: 1.5rem;
  border: 3px solid var(--border-light);
  border-top-color: var(--brand-primary);
  border-radius: var(--radius-full);
  animation: spinner-spin 0.6s linear infinite;
}

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

/* Animations */
.animate-fade-in {
  animation: fade-in var(--transition-normal) ease-in;
}

@keyframes fade-in {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.animate-slide-up {
  animation: slide-up var(--transition-normal) ease-out;
}

@keyframes slide-up {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-pulse-glow {
  animation: pulse-glow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-glow {

  0%,
  100% {
    box-shadow: var(--shadow-md);
  }

  50% {
    box-shadow: var(--shadow-tier-glow);
  }
}

/* Focus States */
.focus-ring {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

.focus-ring:focus {
  outline-color: var(--brand-primary);
  outline-offset: 2px;
}

/* Scrollbar Styling */
.custom-scrollbar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: var(--border-medium);
  border-radius: var(--radius-md);
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: var(--border-dark);
}

/* Responsive Utilities */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .show-mobile-only {
    display: none !important;
  }
}

/* ============================================
   3. COMPONENT-SPECIFIC STYLES
   ============================================ */

/* Tier Comparison Table */
.tier-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-6);
}

.tier-comparison-card {
  position: relative;
  padding: var(--spacing-8);
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-2xl);
  transition: all var(--transition-normal);
}

.tier-comparison-card:hover {
  border-color: var(--border-dark);
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.tier-comparison-card.popular {
  border-color: var(--tier-plus);
  border-width: 4px;
  box-shadow: var(--shadow-tier-glow);
}

.tier-comparison-card.popular::before {
  content: 'MOST POPULAR';
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.375rem 1rem;
  background: linear-gradient(135deg, var(--tier-plus) 0%, #9333ea 100%);
  color: white;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: var(--radius-full);
  letter-spacing: 0.05em;
}

/* Duration Picker Slider */
.duration-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 12px;
  border-radius: var(--radius-full);
  background: var(--bg-tertiary);
  outline: none;
}

.duration-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.duration-slider::-webkit-slider-thumb:hover {
  background: var(--brand-primary-hover);
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

.duration-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--brand-primary);
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-fast);
}

.duration-slider::-moz-range-thumb:hover {
  background: var(--brand-primary-hover);
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* File Tree / Album List Styles */
.file-tree {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.file-tree-item {
  display: flex;
  align-items: center;
  padding: var(--spacing-3) var(--spacing-4);
  border-bottom: 1px solid var(--border-light);
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.file-tree-item:hover {
  background-color: var(--bg-secondary);
}

.file-tree-item:last-child {
  border-bottom: none;
}

.file-tree-item.selected {
  background-color: var(--brand-primary-light);
  border-left: 4px solid var(--brand-primary);
}

.file-tree-item.nested-1 {
  padding-left: calc(var(--spacing-4) + 1.5rem);
}

.file-tree-item.nested-2 {
  padding-left: calc(var(--spacing-4) + 3rem);
}

.file-tree-item.nested-3 {
  padding-left: calc(var(--spacing-4) + 4.5rem);
}

.file-tree-icon {
  font-size: 1.5rem;
  margin-right: var(--spacing-3);
  flex-shrink: 0;
}

.file-tree-content {
  flex: 1;
  min-width: 0;
}

.file-tree-title {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.file-tree-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
}

.file-tree-stats {
  margin-left: auto;
  text-align: right;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.file-tree-expand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-right: var(--spacing-2);
  cursor: pointer;
  color: var(--text-secondary);
  transition: transform var(--transition-fast), color var(--transition-fast);
  flex-shrink: 0;
}

.file-tree-expand:hover {
  color: var(--text-primary);
}

.file-tree-expand.expanded {
  transform: rotate(90deg);
}

.file-tree-item.has-children {
  cursor: pointer;
}

.file-tree-children {
  overflow: hidden;
  transition: max-height var(--transition-normal) ease-out;
}

.file-tree-children.collapsed {
  max-height: 0;
}

/* Depth control - hide items beyond max depth */
.file-tree-item[data-depth] {
  display: flex;
}

.file-tree[data-max-depth="1"] .file-tree-item[data-depth="2"],
.file-tree[data-max-depth="1"] .file-tree-item[data-depth="3"],
.file-tree[data-max-depth="1"] .file-tree-item[data-depth="4"] {
  display: none;
}

.file-tree[data-max-depth="2"] .file-tree-item[data-depth="3"],
.file-tree[data-max-depth="2"] .file-tree-item[data-depth="4"] {
  display: none;
}

.file-tree[data-max-depth="3"] .file-tree-item[data-depth="4"] {
  display: none;
}

/* Grid View for Albums/Files */
.file-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-4);
}

.file-grid-item {
  background: var(--bg-primary);
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.file-grid-item:hover {
  border-color: var(--brand-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.file-grid-item.selected {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-light);
}

.file-grid-thumbnail {
  position: relative;
  width: 100%;
  height: 12rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  margin-bottom: var(--spacing-3);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-grid-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.file-grid-item:hover .file-grid-thumbnail img {
  transform: scale(1.1);
}

.file-grid-thumbnail.no-thumbnail {
  background: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
}

/* Thumbnail overlay */
.file-grid-thumbnail-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.4), transparent);
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.file-grid-item:hover .file-grid-thumbnail-overlay {
  opacity: 1;
}

/* Count badge on thumbnail */
.file-grid-count-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 10;
}

.file-grid-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-2);
}

.file-grid-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-2);
  font-size: 1.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.file-grid-item:hover .file-grid-title {
  color: var(--brand-primary);
}

.file-grid-description {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.file-grid-meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: var(--spacing-2);
}

/* Visibility badges */
.visibility-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-md);
  font-size: 0.75rem;
  font-weight: 500;
}

.visibility-badge.free {
  background-color: #f3f4f6;
  color: #374151;
}

.visibility-badge.basic {
  background-color: #dbeafe;
  color: #1e40af;
}

.visibility-badge.plus {
  background-color: #fef3c7;
  color: #92400e;
}

.visibility-badge.pro {
  background-color: #f3e8ff;
  color: #6b21a8;
}

/* View Toolbar (Sort + View Toggle) */
.view-toolbar {
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  padding: var(--spacing-6);
  box-shadow: var(--shadow-md);
  margin-bottom: var(--spacing-6);
}

.view-toolbar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--spacing-4);
}

.view-toolbar-title h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
}

.view-toolbar-title p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.view-toolbar-controls {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  flex-wrap: wrap;
}

/* Sort Dropdown */
.sort-dropdown {
  position: relative;
}

.sort-dropdown-button {
  display: flex;
  align-items: center;
  gap: var(--spacing-2);
  padding: var(--spacing-2) var(--spacing-4);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sort-dropdown-button:hover {
  background: var(--bg-secondary);
}

.sort-dropdown-button svg {
  width: 1rem;
  height: 1rem;
}

.sort-dropdown-menu {
  position: absolute;
  right: 0;
  margin-top: var(--spacing-2);
  min-width: 12rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 50;
  overflow: hidden;
}

.sort-dropdown-item {
  display: block;
  padding: var(--spacing-2) var(--spacing-4);
  font-size: 0.875rem;
  color: var(--text-primary);
  text-decoration: none;
  transition: background-color var(--transition-fast);
  cursor: pointer;
}

.sort-dropdown-item:hover {
  background: var(--bg-secondary);
}

.sort-dropdown-item.active {
  background: var(--brand-primary-light);
  color: var(--brand-primary);
  font-weight: 600;
}

/* View Toggle Buttons */
.view-toggle {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.view-toggle-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-2) var(--spacing-3);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--bg-primary);
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.view-toggle-button:not(:last-child) {
  border-right: 1px solid var(--border-medium);
}

.view-toggle-button:hover {
  background: var(--bg-secondary);
}

.view-toggle-button.active {
  background: var(--brand-primary);
  color: white;
}

.view-toggle-button svg {
  width: 1rem;
  height: 1rem;
}

/* Photo Upload Widget */
.upload-widget {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-xl);
  padding: var(--spacing-8);
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
}

.upload-widget:hover {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-light);
}

.upload-widget.drag-over {
  border-color: var(--brand-primary);
  background-color: var(--brand-primary-light);
  border-style: solid;
  box-shadow: var(--shadow-tier-glow);
}

.upload-widget-icon {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-4);
}

.upload-widget.drag-over .upload-widget-icon {
  color: var(--brand-primary);
  animation: pulse-glow 1s ease-in-out infinite;
}

.upload-widget-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-2);
}

.upload-widget-subtitle {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-4);
}

.upload-widget-formats {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Upload Progress */
.upload-progress {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-4);
  margin-top: var(--spacing-4);
}

.upload-progress-item {
  display: flex;
  align-items: center;
  gap: var(--spacing-3);
  padding: var(--spacing-3);
  border-bottom: 1px solid var(--border-light);
}

.upload-progress-item:last-child {
  border-bottom: none;
}

.upload-progress-icon {
  font-size: 2rem;
  flex-shrink: 0;
}

.upload-progress-info {
  flex: 1;
  min-width: 0;
}

.upload-progress-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-progress-bar {
  width: 100%;
  height: 4px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--tier-plus) 100%);
  border-radius: var(--radius-full);
  transition: width var(--transition-normal);
}

.upload-progress-status {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.25rem;
}

.upload-progress-size {
  font-size: 0.75rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

/* Privacy Badge */
.privacy-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  padding: 0.125rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
}

.privacy-badge.private {
  background-color: #fef3c7;
  color: #92400e;
}

.privacy-badge.public {
  background-color: #d1fae5;
  color: #065f46;
}

/* Print Styles */
@media print {
  .no-print {
    display: none !important;
  }
}

/* Video Fullscreen — override max-height constraint so videos stretch properly */
.plyr--fullscreen-active video,
.plyr--fullscreen-fallback video,
.plyr:-webkit-full-screen video,
.plyr:fullscreen video {
  max-height: 100vh !important;
  max-height: 100dvh !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.plyr--fullscreen-active .video-player-wrapper,
.plyr--fullscreen-fallback .video-player-wrapper {
  width: 100%;
  height: 100%;
}

/* Also handle when the wrapper itself enters fullscreen */
.video-player-wrapper:fullscreen video,
.video-player-wrapper:-webkit-full-screen video {
  max-height: 100vh !important;
  max-height: 100dvh !important;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
