/* ==========================================================================
   KEZENCIA — COMPONENT INVENTORY
   Reusable, Accessible, High-Craft UI Elements
   ========================================================================== */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-normal);
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--text-primary);
  color: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

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

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

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-default);
  box-shadow: var(--shadow-xs);
}

.btn-secondary:hover {
  background-color: var(--bg-subtle);
  border-color: var(--border-strong);
}

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

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

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

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

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

.btn-accent:hover {
  background-color: #9A3412;
}

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

.btn-lg {
  padding: 14px 28px;
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.btn-full {
  width: 100%;
}

.btn-group {
  display: inline-flex;
  gap: var(--space-2);
}

/* --- Badges & Pills --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.badge-neutral {
  background-color: var(--bg-muted);
  color: var(--text-secondary);
}

.badge-warm {
  background-color: var(--accent-warm-light);
  color: var(--accent-warm);
  border: 1px solid var(--accent-warm-border);
}

.badge-success {
  background-color: var(--status-success-bg);
  color: var(--status-success);
  border: 1px solid var(--status-success-border);
}

.badge-warning {
  background-color: var(--status-warning-bg);
  color: var(--status-warning);
  border: 1px solid var(--status-warning-border);
}

.badge-info {
  background-color: var(--status-info-bg);
  color: var(--status-info);
  border: 1px solid var(--status-info-border);
}

/* --- Cards --- */
.card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

.card-hoverable:hover {
  border-color: var(--border-default);
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}

/* --- Form Elements --- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: var(--text-sm);
  color: var(--text-primary);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(24, 23, 22, 0.08);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-subtle);
}

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

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 4px;
  border: 1.5px solid var(--border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
  flex-shrink: 0;
  background-color: var(--bg-surface);
}

input[type="checkbox"]:checked + .checkbox-label .checkbox-custom,
.checkbox-custom.checked {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-surface);
}

/* --- Drag & Drop Upload Zone --- */
.upload-zone {
  border: 2px dashed var(--border-default);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  background-color: var(--bg-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent-warm);
  background-color: var(--accent-warm-subtle);
}

.upload-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto var(--space-3);
  color: var(--text-muted);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-prompt-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  margin-bottom: var(--space-1);
}

.upload-prompt-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.upload-preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.upload-preview-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  aspect-ratio: 1;
  background: var(--bg-surface);
}

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

.upload-preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(24, 23, 22, 0.75);
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-size: 11px;
}

/* --- Stepper Indicator --- */
.stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  margin-bottom: var(--space-10);
  padding: 0 var(--space-4);
}

.stepper::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 36px;
  right: 36px;
  height: 2px;
  background-color: var(--border-subtle);
  z-index: 1;
}

.step-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  position: relative;
  z-index: 2;
  background-color: var(--bg-primary);
  padding: 0 var(--space-2);
}

.step-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: var(--bg-surface);
  border: 2px solid var(--border-default);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.step-item.active .step-circle {
  background-color: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-surface);
  box-shadow: 0 0 0 4px rgba(24, 23, 22, 0.1);
}

.step-item.completed .step-circle {
  background-color: var(--status-success);
  border-color: var(--status-success);
  color: #FFFFFF;
}

.step-label {
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
}

.step-item.active .step-label {
  color: var(--text-primary);
}

/* --- Concept Card --- */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
}

.concept-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.concept-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.concept-card.is-selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--text-primary), var(--shadow-lg);
}

.concept-preview {
  aspect-ratio: 16/10;
  width: 100%;
  background: var(--bg-subtle);
  overflow: hidden;
  position: relative;
}

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

.concept-card:hover .concept-preview img {
  transform: scale(1.03);
}

.concept-content {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex: 1;
}

.concept-title {
  font-size: var(--text-lg);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.concept-desc {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.5;
}

.concept-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: auto;
  padding-top: var(--space-3);
}

/* --- Creative Brief Card --- */
.brief-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
}

.brief-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-6);
}

.brief-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.brief-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.brief-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-wider);
  color: var(--text-muted);
}

.brief-value {
  font-size: var(--text-sm);
  color: var(--text-primary);
  font-weight: var(--fw-medium);
}

/* --- Photo Board & Shot Cards --- */
.shot-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-6);
}

.shot-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  display: flex;
  flex-direction: column;
}

.shot-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-default);
}

.shot-img-wrapper {
  aspect-ratio: 4/5;
  background: var(--bg-subtle);
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

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

.shot-card:hover .shot-img-wrapper img {
  transform: scale(1.02);
}

.shot-overlay-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
}

.shot-version-tag {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(24, 23, 22, 0.7);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: var(--fw-bold);
  padding: 3px 8px;
  border-radius: var(--radius-xs);
  backdrop-filter: blur(4px);
}

.shot-footer {
  padding: var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.shot-title {
  font-size: var(--text-sm);
  font-weight: var(--fw-semibold);
}

.shot-actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

/* --- Modals --- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(24, 23, 22, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: var(--z-modal-backdrop);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  transform: scale(0.96) translateY(8px);
  transition: transform var(--transition-normal);
  display: flex;
  flex-direction: column;
}

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

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

.modal-title {
  font-size: var(--text-xl);
  font-weight: var(--fw-bold);
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  font-size: var(--text-xl);
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-xs);
}

.modal-close:hover {
  color: var(--text-primary);
  background-color: var(--bg-subtle);
}

.modal-body {
  padding: var(--space-8);
}

.modal-footer {
  padding: var(--space-6) var(--space-8);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  background: var(--bg-subtle);
  border-bottom-left-radius: var(--radius-xl);
  border-bottom-right-radius: var(--radius-xl);
}

/* --- Accordions / FAQ --- */
.accordion {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.accordion-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.accordion-item.is-open {
  border-color: var(--border-default);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  color: var(--text-primary);
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
}

.accordion-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}

.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
  padding: 0 var(--space-6);
  color: var(--text-secondary);
  font-size: var(--text-sm);
  line-height: 1.6;
}

.accordion-item.is-open .accordion-content {
  padding-bottom: var(--space-6);
  max-height: 300px;
}

/* --- Alerts --- */
.alert {
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.alert-info {
  background-color: var(--status-info-bg);
  border: 1px solid var(--status-info-border);
  color: var(--status-info);
}

.alert-warning {
  background-color: var(--status-warning-bg);
  border: 1px solid var(--status-warning-border);
  color: var(--status-warning);
}

.alert-success {
  background-color: var(--status-success-bg);
  border: 1px solid var(--status-success-border);
  color: var(--status-success);
}

/* --- Toast Container --- */
.toast-container {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  background: var(--text-primary);
  color: #FFFFFF;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--fw-medium);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  pointer-events: auto;
  animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Skeleton Loading --- */
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg-muted) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: skeletonWave 1.5s infinite;
  border-radius: var(--radius-xs);
}

@keyframes skeletonWave {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-text {
  height: 14px;
  margin-bottom: 8px;
}

.skeleton-card {
  height: 240px;
  border-radius: var(--radius-md);
}
