/**
 * Meenira Video Brand Styles
 * Brand color: #8E5CD9 (purple)
 * Uses shared console.css but overrides for Video brand
 */

/* Video brand color tokens */
:root {
  --video-brand: #8E5CD9;
  --video-brand-light: #a77ee6;
  --video-brand-dark: #6d3cb8;
  --video-brand-50: #f5f0ff;
  --video-brand-100: #ede5ff;
  --video-brand-200: #dec9ff;
  --video-brand-500: #8E5CD9;
  --video-brand-600: #7a4bbd;
  --video-brand-700: #6d3cb8;
  --video-brand-900: #4a297a;
}

/* Override brand colors for Video - Purple Waveform M, no orange gradient */
.sidebar .brand-logo,
.login-brand-logo {
  background: transparent !important;
  width: auto !important;          /* the shared console sizes this box for a square icon */
  height: auto !important;
  border-radius: 0 !important;
}
.login-brand-logo picture img { height: 34px !important; width: auto !important; }
.sidebar .brand-logo picture img { height: 22px !important; width: auto !important; max-width: 190px !important; }

.sidebar .brand-logo svg rect,
.login-brand-logo svg rect {
  fill: #8E5CD9 !important;
}

.nav-item.active {
  background: var(--video-brand-100) !important;
  color: var(--video-brand-700) !important;
}

.nav-item.active svg {
  stroke: var(--video-brand-600) !important;
}

.btn-primary {
  background: var(--video-brand-600) !important;
  border-color: var(--video-brand-600) !important;
}

.btn-primary:hover:not(:disabled) {
  background: var(--video-brand-700) !important;
  border-color: var(--video-brand-700) !important;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--video-brand-600) !important;
  box-shadow: 0 0 0 3px var(--video-brand-100) !important;
}

@media (prefers-color-scheme: dark) {
  .nav-item.active {
    background: var(--video-brand-900) !important;
    color: var(--video-brand-200) !important;
  }

  .nav-item.active svg {
    stroke: var(--video-brand-200) !important;
  }

  .bottom-nav-item.active {
    color: var(--video-brand-500) !important;
  }

  .owner-badge {
    background: var(--video-brand-900) !important;
    color: var(--video-brand-200) !important;
  }

  .input:focus,
  .select:focus,
  .textarea:focus {
    box-shadow: 0 0 0 3px rgba(142, 92, 217, 0.2) !important;
  }
}

/* Video-specific status chips for job states */
.chip-awaiting_approval,
.badge-awaiting_approval {
  background: var(--warning-100);
  color: var(--warning-700);
}

.chip-approved,
.badge-approved {
  background: var(--video-brand-100);
  color: var(--video-brand-700);
}

.chip-making,
.badge-making {
  background: var(--info-100);
  color: var(--info-600);
}

.chip-ready,
.badge-ready {
  background: var(--success-100);
  color: var(--success-600);
}

.chip-failed,
.badge-failed {
  background: var(--error-100);
  color: var(--error-600);
}

.chip-rejected,
.badge-rejected {
  background: var(--gray-200);
  color: var(--gray-600);
}

@media (prefers-color-scheme: dark) {
  .chip-awaiting_approval,
  .badge-awaiting_approval {
    background: rgba(245, 158, 11, 0.2);
    color: #fcd34d;
  }

  .chip-approved,
  .badge-approved {
    background: rgba(142, 92, 217, 0.2);
    color: #c4b5fd;
  }

  .chip-making,
  .badge-making {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
  }

  .chip-ready,
  .badge-ready {
    background: rgba(16, 185, 129, 0.2);
    color: #86efac;
  }

  .chip-failed,
  .badge-failed {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
  }

  .chip-rejected,
  .badge-rejected {
    background: rgba(156, 163, 175, 0.2);
    color: #9ca3af;
  }
  
  /* Active badge for owner dashboard - dark mode */
  .badge {
    background: rgba(142, 92, 217, 0.2) !important;
    color: var(--video-brand-300) !important;
  }
}

/* Tier badges */
.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

.tier-badge.tier-bronze {
  background: #cd7f32;
  color: white;
}

.tier-badge.tier-silver {
  background: #c0c0c0;
  color: var(--gray-900);
}

.tier-badge.tier-gold {
  background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
  color: var(--gray-900);
}

/* Video card specific styles */
.video-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  transition: box-shadow var(--transition-fast);
}

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

.video-card h3 {
  font-size: var(--text-base);
  font-weight: var(--font-medium);
  color: var(--text-primary);
  margin: 0;
}

.video-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.approval-actions {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* Tier selection cards */
.tier-option {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  border: 2px solid var(--border-default);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: all var(--transition-fast);
  background: var(--bg-surface);
}

.tier-option:hover {
  border-color: var(--video-brand-300);
}

.tier-option.selected {
  border-color: var(--video-brand-600);
  background: var(--video-brand-50);
  box-shadow: 0 0 0 3px var(--video-brand-100);
}

@media (prefers-color-scheme: dark) {
  .tier-option {
    background: var(--bg-surface);
    border-color: var(--border-default);
  }
  
  .tier-option:hover {
    border-color: var(--video-brand-500);
  }
  
  .tier-option.selected {
    border-color: var(--video-brand-400);
    background: rgba(142, 92, 217, 0.15);
    box-shadow: 0 0 0 2px rgba(142, 92, 217, 0.3);
  }
  
  .tier-option.selected .tier-name {
    color: var(--video-brand-300);
  }
  
  .tier-option.selected .tier-cost {
    color: var(--video-brand-300);
  }
  
  .tier-option.selected .tier-desc {
    color: var(--text-secondary);
  }
}

.tier-option input[type="radio"] {
  position: absolute;
  opacity: 0;
}

.tier-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-2);
}

.tier-name {
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
  color: var(--text-primary);
}

.tier-cost {
  font-weight: var(--font-bold);
  font-size: var(--text-lg);
  color: var(--video-brand-600);
}

@media (prefers-color-scheme: dark) {
  .tier-cost {
    color: var(--video-brand-400);
  }
}

.tier-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
}

/* Cost estimate display */
.cost-estimate {
  background: var(--video-brand-50);
  border: 1px solid var(--video-brand-200);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  margin: var(--space-4) 0;
}

@media (prefers-color-scheme: dark) {
  .cost-estimate {
    background: rgba(142, 92, 217, 0.1);
    border-color: var(--video-brand-700);
  }
  
  .cost-estimate h3 {
    color: var(--video-brand-300);
  }
  
  .cost-estimate .amount {
    color: var(--text-primary);
  }
  
  .cost-estimate .note {
    color: var(--text-secondary);
  }
}

.cost-estimate h3 {
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  margin: 0 0 var(--space-2) 0;
}

.cost-estimate .amount {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
}

.cost-estimate .inr {
  font-size: var(--text-base);
  color: var(--text-secondary);
}

.cost-estimate .note {
  font-size: var(--text-sm);
  color: var(--text-tertiary);
  margin: var(--space-2) 0 0 0;
}

/* Budget page styles */
.budget-summary {
  margin-bottom: var(--space-4);
}

.budget-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}

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

.budget-item .amount {
  font-weight: var(--font-semibold);
  font-size: var(--text-lg);
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--border-default);
  border-radius: var(--radius-full);
  margin: var(--space-3) 0;
  overflow: hidden;
}

.progress-bar .progress {
  height: 100%;
  background: var(--video-brand-600);
  border-radius: var(--radius-full);
  transition: width 0.3s ease;
}

.progress-text {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  text-align: center;
}

/* Budget paused alert */
.budget-paused {
  background: var(--warning-100);
  border: 1px solid var(--warning-500);
  color: var(--warning-700);
  padding: var(--space-4);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-4);
}

@media (prefers-color-scheme: dark) {
  .budget-paused {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--warning-500);
    color: var(--warning-400);
  }
}

/* List styles for videos */
.videos-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.videos-list .empty-state {
  text-align: center;
  padding: var(--space-10) var(--space-4);
}

.videos-list .empty-state-title {
  font-size: var(--text-xl);
  font-weight: var(--font-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-2);
}

.videos-list .empty-state-desc {
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

/* Loading skeleton */
.skeleton-card {
  height: 100px;
  background: var(--bg-muted);
  border-radius: var(--radius-lg);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* State badge base */
.state-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--font-medium);
}

/* Main layout for Video pages */
.video-app {
  display: flex;
  min-height: 100vh;
}

.video-sidebar {
  position: fixed;
  left: 0;
  top: 0;
  width: 240px;
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-default);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sticky);
}

.video-main {
  flex: 1;
  margin-left: 240px;
  padding: var(--space-6);
  padding-bottom: calc(var(--space-6) + var(--bottom-nav-height));
  min-height: 100vh;
}

.video-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-6);
}

.video-topbar h1 {
  font-size: var(--text-2xl);
  font-weight: var(--font-bold);
  color: var(--text-primary);
  margin: 0;
}

@media (max-width: 767px) {
  .video-sidebar {
    display: none;
  }
  .video-main {
    margin-left: 0;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-6) + var(--bottom-nav-height));
  }
}

/* Video-specific bottom nav styling */
.bottom-nav .bottom-nav-item.active svg,
.bottom-nav .bottom-nav-item.active span {
  color: var(--video-brand-600);
}

.bottom-nav .bottom-nav-item.active svg {
  fill: var(--video-brand-600);
}

@media (prefers-color-scheme: dark) {
  .bottom-nav .bottom-nav-item.active svg,
  .bottom-nav .bottom-nav-item.active span {
    color: var(--video-brand-400);
  }

  .bottom-nav .bottom-nav-item.active svg {
    fill: var(--video-brand-400);
  }
}
