/* ==========================================================================
   NINECONCEPT 2.0 Studio UI Components
   ========================================================================== */

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: all var(--tr-fast);
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent-red);
  color: #FFFFFF;
  box-shadow: 0 4px 16px var(--accent-red-glow);
}

.btn-primary:hover {
  background: #FF3B30;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(224, 43, 32, 0.4);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-surface-2);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-3);
  border-color: var(--border-medium);
  color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-primary);
  color: var(--text-primary);
}

.btn-success {
  background: var(--accent-emerald);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #F87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: #EF4444;
  color: #FFFFFF;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--radius-xs);
}

.btn-icon {
  padding: 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: var(--bg-surface-3);
  color: var(--text-primary);
}

/* --------------------------------------------------------------------------
   Badges & Tags
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-radius: var(--radius-pill);
  line-height: 1;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Status Badges */
.badge-published {
  background: rgba(16, 185, 129, 0.12);
  color: #34D399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.badge-published .badge-dot { background: #34D399; box-shadow: 0 0 8px #34D399; }

.badge-ready {
  background: rgba(245, 158, 11, 0.12);
  color: #FBBF24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.badge-ready .badge-dot { background: #FBBF24; box-shadow: 0 0 8px #FBBF24; animation: pulse 2s infinite; }

.badge-draft {
  background: rgba(113, 113, 122, 0.15);
  color: #A1A1AA;
  border: 1px solid rgba(113, 113, 122, 0.3);
}
.badge-draft .badge-dot { background: #71717A; }

.badge-private {
  background: rgba(224, 43, 32, 0.1);
  color: #F87171;
  border: 1px solid rgba(224, 43, 32, 0.25);
}
.badge-private .badge-dot { background: #E02B20; }

/* Type Badges */
.badge-work {
  background: rgba(59, 130, 246, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-originals {
  background: rgba(139, 92, 246, 0.15);
  color: #A78BFA;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.badge-lab {
  background: rgba(236, 72, 153, 0.15);
  color: #F472B6;
  border: 1px solid rgba(236, 72, 153, 0.3);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* --------------------------------------------------------------------------
   Filter & Navigation Tabs
   -------------------------------------------------------------------------- */
.filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-surface-1);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: fit-content;
}

.filter-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all var(--tr-fast);
}

.filter-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.filter-tab.active {
  background: var(--bg-surface-3);
  color: #FFFFFF;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Project Cards (Visual Grid)
   -------------------------------------------------------------------------- */
.project-card {
  position: relative;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all var(--tr-base);
}

.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-md);
}

.card-thumbnail-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

.card-thumbnail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--tr-smooth);
}

.project-card:hover .card-thumbnail {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(9, 9, 12, 0.95) 0%, rgba(9, 9, 12, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
}

.card-top-badges {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vimeo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(26, 183, 234, 0.2);
  color: #1AB7EA;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(8px);
}

.card-content {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-client-year {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.card-title-en {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  font-family: var(--font-mono);
}

.card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-role-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  margin-bottom: 16px;
}

.role-tag {
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-subtle);
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* --------------------------------------------------------------------------
   Modal & Drawer (Add / Edit / Preview)
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--tr-base);
}

.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-container {
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px) scale(0.98);
  transition: transform var(--tr-smooth);
}

.modal-backdrop.open .modal-container {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.modal-title {
  font-size: 18px;
  font-weight: 700;
}

.modal-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
}

.modal-body {
  padding: 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-footer {
  padding: 20px 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

/* --------------------------------------------------------------------------
   Form Controls
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.form-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-label .req {
  color: var(--accent-red);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--text-primary);
  transition: all var(--tr-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--accent-red);
  background: var(--bg-surface-3);
  box-shadow: 0 0 0 3px var(--accent-red-glow);
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23A1A1AA' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
  line-height: 1.5;
}

.form-helper {
  font-size: 11px;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   Human Approval Gate Timeline & Alerts
   -------------------------------------------------------------------------- */
.gate-banner {
  background: linear-gradient(135deg, rgba(224, 43, 32, 0.08) 0%, rgba(24, 24, 32, 0.8) 100%);
  border: 1px solid rgba(224, 43, 32, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.gate-banner-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.gate-icon-pulse {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent-red);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px var(--accent-red-glow);
}

.gate-title {
  font-size: 14px;
  font-weight: 700;
  color: #FFFFFF;
}

.gate-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

.workflow-steps {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 20px;
}

.wf-step {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.wf-step.active {
  color: #FFFFFF;
}

.wf-step.completed {
  color: var(--accent-emerald);
}

.wf-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-surface-3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.wf-step.active .wf-num {
  background: var(--accent-red);
  color: #FFFFFF;
}

.wf-step.completed .wf-num {
  background: var(--accent-emerald);
  color: #FFFFFF;
}

.wf-divider {
  width: 24px;
  height: 1px;
  background: var(--border-medium);
}

/* --------------------------------------------------------------------------
   Toast Notifications
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  min-width: 320px;
  max-width: 420px;
  padding: 14px 18px;
  background: var(--bg-surface-1);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 12px;
  transform: translateX(100%);
  opacity: 0;
  transition: all var(--tr-smooth);
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast-success { border-left: 4px solid var(--accent-emerald); }
.toast-error { border-left: 4px solid var(--accent-red); }
.toast-info { border-left: 4px solid var(--accent-blue); }

.toast-icon { font-size: 18px; }
.toast-text { font-size: 13px; font-weight: 500; color: #FFFFFF; }
