/* ==========================================
 * UTILITY CLASSES - DESIGN TOKEN BASED
 * ==========================================
 * Semantic single-purpose utility classes
 * Replaces common inline styles while maintaining site identity
 */

/* ==========================================
 * DISPLAY & VISIBILITY
 * ==========================================*/

.hidden,
.display-none {
  display: none;
}

.show {
  display: block;
}

.display-flex {
  display: flex;
}

.display-inline {
  display: inline;
}

.display-inline-flex {
  display: inline-flex;
}

.display-grid {
  display: grid;
}

/* ==========================================
 * FLEXBOX UTILITIES
 * ==========================================*/

.flex-1 {
  flex: 1;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-start {
  display: flex;
  align-items: flex-start;
}

.flex-column {
  flex-direction: column;
}

.align-center {
  align-items: center;
}

.align-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-2 {
  gap: 4px;
}

.gap-4 {
  gap: 8px;
}

.gap-6 {
  gap: 12px;
}

.gap-md {
  gap: var(--spacing-md);
}

.gap-lg {
  gap: var(--spacing-lg);
}

.gap-xl {
  gap: var(--spacing-xl);
}

.flex-wrap {
  flex-wrap: wrap;
}

/* ==========================================
 * SPACING - MARGINS
 * ==========================================*/

.m-0 {
  margin: 0;
}

.ms-1 {
  margin-left: var(--spacing-xs);
}

.ms-2 {
  margin-left: 2px;
}

.mb-0 {
  margin-bottom: 0;
}

.mb-2 {
  margin-bottom: var(--spacing-xs);
}

.mb-4 {
  margin-bottom: var(--spacing-sm);
}

.mb-8 {
  margin-bottom: var(--spacing-md);
}

.mb-16 {
  margin-bottom: var(--spacing-lg);
}

.mb-20 {
  margin-bottom: 20px;
}

.mt-0 {
  margin-top: 0;
}

.mt-1 {
  margin-top: var(--spacing-xs);
}

.mt-2 {
  margin-top: 2px;
}

.mt-4 {
  margin-top: var(--spacing-sm);
}

.mt-8 {
  margin-top: var(--spacing-md);
}

.mt-10 {
  margin-top: 10px;
}

.mr-2 {
  margin-right: var(--spacing-xs);
}

.mr-4 {
  margin-right: 4px;
}

.mr-8 {
  margin-right: 8px;
}

.mr-16 {
  margin-right: 16px;
}

.ms-5 {
  margin-left: 20px;
}

.ml-2 {
  margin-left: var(--spacing-xs);
}

.ml-4 {
  margin-left: 4px;
}

.my-2 {
  margin-top: 2px;
  margin-bottom: 2px;
}

/* ==========================================
 * SPACING - PADDING
 * ==========================================*/

.p-0 {
  padding: 0;
}

.p-2 {
  padding: var(--spacing-xs);
}

.p-4 {
  padding: var(--spacing-sm);
}

.p-6 {
  padding: var(--spacing-md);
}

.p-8 {
  padding: 8px;
}

.px-2 {
  padding-left: var(--spacing-xs);
  padding-right: var(--spacing-xs);
}

.px-4 {
  padding-left: var(--spacing-sm);
  padding-right: var(--spacing-sm);
}

.px-6 {
  padding-left: var(--spacing-md);
  padding-right: var(--spacing-md);
}

.ps-5 {
  padding-left: 20px;
}

.py-2 {
  padding-top: var(--spacing-xs);
  padding-bottom: var(--spacing-xs);
}

.py-4 {
  padding-top: var(--spacing-sm);
  padding-bottom: var(--spacing-sm);
}

.py-5 {
  padding-top: var(--spacing-md);
  padding-bottom: var(--spacing-md);
}

.pt-1 {
  padding-top: var(--spacing-xs);
}

.pb-4 {
  padding-bottom: var(--spacing-sm);
}

.pb-2 {
  padding-bottom: var(--spacing-xs);
}

/* ==========================================
 * BORDER UTILITIES
 * ==========================================*/

.border-bottom-success {
  border-bottom: 2px solid var(--color-success);
}

body.dark-mode .border-bottom-success {
  border-bottom: 2px solid var(--dark-success);
}

/* ==========================================
 * TYPOGRAPHY
 * ==========================================*/

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.font-bold {
  font-weight: var(--font-weight-bold);
}

.font-semibold {
  font-weight: var(--font-weight-semibold);
}

.font-medium {
  font-weight: var(--font-weight-medium);
}

.font-500 {
  font-weight: 500;
}

.font-600 {
  font-weight: 600;
}

.font-700 {
  font-weight: 700;
}

.font-italic {
  font-style: italic;
}

.line-height-tight {
  line-height: 1;
}

.text-xs {
  font-size: var(--font-size-xs);
}

.text-sm {
  font-size: var(--font-size-sm);
}

.text-base {
  font-size: var(--font-size-base);
}

.text-lg {
  font-size: var(--font-size-lg);
}

.text-xl {
  font-size: var(--font-size-xl);
}

.text-2xl {
  font-size: var(--font-size-2xl);
}

.text-3xl {
  font-size: var(--font-size-3xl);
}

.text-4xl {
  font-size: 4rem;
}

.text-65 {
  font-size: 0.65rem;
}

.text-70 {
  font-size: 0.7rem;
}

.text-75 {
  font-size: 0.75rem;
}

.text-85 {
  font-size: 0.85rem;
}

.text-90 {
  font-size: 0.9rem;
}

.text-uppercase {
  text-transform: uppercase;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.truncate {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-300 {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-break {
  word-break: break-word;
}

.line-clamp-1 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.line-clamp-2 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.line-clamp-3 {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

/* ==========================================
 * COLORS - TEXT
 * ==========================================*/

.text-primary {
  color: var(--text-primary);
}

.text-secondary {
  color: var(--text-secondary);
}

.text-muted {
  color: var(--text-muted);
}

.text-success {
  color: var(--color-success);
}

.text-danger {
  color: var(--color-danger);
}

.text-warning {
  color: var(--color-warning);
}

.text-info {
  color: var(--color-info);
}

.text-gold {
  color: #ffd700;
}

.text-purple {
  color: var(--brand-secondary);
}

.text-gray {
  color: #718096;
}

/* Dark mode text colors */
body.dark-mode .text-primary {
  color: var(--dark-text-primary);
}

body.dark-mode .text-secondary {
  color: var(--dark-text-secondary);
}

body.dark-mode .text-muted {
  color: var(--dark-text-muted);
}

/* ==========================================
 * COLORS - BACKGROUNDS
 * ==========================================*/

.bg-light {
  background: var(--color-background-alt);
}

.bg-light-success {
  background: var(--color-success-light);
}

.bg-info-light {
  background: var(--color-info-light);
}

.bg-transparent {
  background: transparent;
}

.bg-purple {
  background-color: var(--brand-secondary);
}

.bg-gradient-purple {
  background: linear-gradient(
    135deg,
    var(--brand-primary) 0%,
    var(--brand-secondary) 100%
  );
}

.bg-gradient-success {
  background: var(--gradient-success);
}

.bg-gradient-danger {
  background: var(--gradient-danger);
}

.bg-gradient-info {
  background: linear-gradient(135deg, var(--color-info) 0%, #3b82f6 100%);
}

.bg-gradient-warning {
  background: var(--gradient-warning);
}

.bg-gradient-indigo {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.bg-gradient-pink {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.bg-gradient-cyan {
  background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.bg-gradient-golden {
  background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
}

.bg-gradient-danger-orange {
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.bg-gradient-purple-pink {
  background: linear-gradient(135deg, #8b5cf6, #ec4899);
}

.bg-gradient-cyan-blue {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

/* Dark mode backgrounds */
body.dark-mode .bg-light {
  background: var(--dark-bg-secondary);
}

body.dark-mode .bg-light-success {
  background: rgba(76, 175, 80, 0.1);
}

body.dark-mode .bg-info-light {
  background: var(--surface-secondary);
}

/* ==========================================
 * BORDERS & RADIUS
 * ==========================================*/

.border-none {
  border: none;
}

.border {
  border: 1px solid var(--border-primary);
}

.border-rounded {
  border-radius: var(--radius-lg);
}

.rounded {
  border-radius: var(--radius-md);
}

.rounded-lg {
  border-radius: var(--radius-lg);
}

.rounded-xl {
  border-radius: var(--radius-xl);
}

.rounded-pill {
  border-radius: var(--radius-pill);
}

/* ==========================================
 * SIZING
 * ==========================================*/

.w-100 {
  width: 100%;
}

.w-200 {
  width: 200px;
}

.w-70 {
  width: 70px;
}

.w-80 {
  width: 80px;
}

.w-100px {
  width: 100px;
}

.w-auto {
  width: auto;
}

.min-w-70 {
  min-width: 70px;
}

.min-w-100 {
  min-width: 100px;
}

.min-w-180 {
  min-width: 180px;
}

.min-w-200 {
  min-width: 200px;
}

.min-w-300 {
  min-width: 300px;
}

.max-w-85 {
  max-width: 85px;
}

.max-w-300 {
  max-width: 300px;
}

.max-w-720 {
  max-width: 720px;
}

.max-h-120 {
  max-height: 120px;
}

.max-h-200 {
  max-height: 200px;
}

.max-h-300 {
  max-height: 300px;
}

.max-h-400 {
  max-height: 400px;
}

.max-h-600 {
  max-height: 600px;
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-y-auto {
  overflow-y: auto;
}

.h-100 {
  height: 100%;
}

.h-40 {
  height: 40px;
}

.min-h-300 {
  min-height: 300px;
}

.h-auto {
  height: auto;
}

.h-300 {
  height: 300px;
}

/* ==========================================
 * OPACITY & VISIBILITY
 * ==========================================*/

.opacity-70 {
  opacity: 0.7;
}

.opacity-80 {
  opacity: 0.8;
}

.opacity-90 {
  opacity: 0.9;
}

/* ==========================================
 * POSITION & LAYOUT
 * ==========================================*/

.position-relative {
  position: relative;
}

.position-absolute {
  position: absolute;
}

.position-sticky {
  position: sticky;
}

.sticky-bottom-100 {
  position: sticky;
  bottom: 100px;
}

.sticky-top {
  top: 0;
  position: sticky;
}

.cursor-pointer {
  cursor: pointer;
}

.cursor-default {
  cursor: default;
}

.readonly-input {
  background-color: var(--surface-secondary);
}

body.dark-mode .readonly-input {
  background-color: var(--dark-bg-tertiary);
}

.z-100 {
  z-index: 100;
}

.z-999 {
  z-index: 999;
}

.transition-normal {
  transition: all var(--transition-normal);
}

.transition-fast {
  transition: all var(--transition-fast);
}

/* ==========================================
 * ANIMATION & EFFECTS
 * ==========================================*/

.user-select-none {
  user-select: none;
}

.drop-shadow {
  box-shadow: var(--shadow-md);
}

.drop-shadow-lg {
  box-shadow: var(--shadow-lg);
}

/* ==========================================
 * RESPONSIVE GRID
 * ==========================================*/

.grid-auto-fit-250 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-md);
}

.grid-auto-fit-300 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.grid-cols-1 {
  display: grid;
  grid-template-columns: 1fr;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.grid-span-full {
  grid-column: 1 / -1;
}

/* ==========================================
 * TABLE UTILITIES
 * ==========================================*/

.table-width-5 {
  width: 5%;
}

.table-width-8 {
  width: 8%;
}

.table-width-10 {
  width: 10%;
}

.table-width-11 {
  width: 11%;
}

.table-width-12 {
  width: 12%;
}

.table-width-13 {
  width: 13%;
}

.table-width-14 {
  width: 14%;
}

.table-width-16 {
  width: 16%;
}

.text-purple {
  color: var(--brand-secondary, #9c27b0);
}

body.dark-mode .text-purple {
  color: var(--dark-brand-secondary, #b366cc);
}

/* ==========================================
 * BACKGROUND COLOR UTILITIES (Extended)
 * ==========================================*/

.bg-purple {
  background-color: var(--brand-secondary, #9c27b0);
}

body.dark-mode .bg-purple {
  background-color: var(--dark-brand-secondary, #b366cc);
}

.bg-light-gray {
  background: #f8f9fa;
}

body.dark-mode .bg-light-gray {
  background: var(--dark-bg-tertiary);
}

/* ==========================================
 * BADGE UTILITIES
 * ==========================================*/

.badge-inline {
  display: inline;
}

.badge-sm {
  font-size: 0.65rem;
  padding: 2px 6px;
}

.badge-important {
  margin-left: var(--spacing-xs);
  font-size: 0.7rem;
}

/* ==========================================
 * SPECIAL EFFECTS
 * ==========================================*/

.text-gradient-success {
  background: linear-gradient(
    135deg,
    var(--status-success) 0%,
    var(--status-success-dark) 100%
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pull-right {
  float: right;
}

.clear-both {
  clear: both;
}

/* ==========================================
 * VISIBILITY UTILITIES
 * ==========================================*/

.hide-when-empty:empty {
  display: none;
}

@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }

  .show-mobile {
    display: block !important;
  }
}

@media (min-width: 769px) {
  .show-mobile {
    display: none !important;
  }

  .hide-desktop {
    display: none !important;
  }
}

/* ==========================================
 * LEGEND INDICATORS - Design Token Based
 * ==========================================*/

.legend-indicator {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  display: inline-block;
}

.legend-mission {
  background: linear-gradient(
    135deg,
    var(--status-error) 0,
    var(--status-error) 10px,
    white 10px
  );
}

.legend-holiday {
  background: linear-gradient(
    135deg,
    var(--color-info) 0,
    var(--color-info) 10px,
    white 10px
  );
}

.legend-public-holiday {
  background: linear-gradient(
    135deg,
    var(--color-warning) 0,
    var(--color-warning) 10px,
    white 10px
  );
}

.legend-existing {
  border: 2px solid var(--color-warning);
  background: white;
}

.legend-checkmark {
  position: absolute;
  top: -2px;
  right: 0;
  font-size: 0.6rem;
  font-weight: bold;
  color: var(--color-warning);
}

/* Dark mode legend indicators */
body.dark-mode .legend-indicator {
  border: 1px solid var(--dark-border-primary);
}
