/* DMA Portal - Unified Styles */

/* ============================================
   ROOT VARIABLES
   ============================================ */
:root {
  /* Brand Colors */
  --brand-primary: #2563eb;
  --brand-secondary: #0ea5e9;
  --brand-accent: #3b82f6;
  
  /* Status Colors */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-error: #ef4444;
  --status-info: #3b82f6;
  
  /* Service Status Colors */
  --service-planned: #64748b;
  --service-active: #3b82f6;
  --service-completed: #10b981;
  --service-cancelled: #ef4444;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
  --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
}

/* ============================================
   BASE STYLES
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   TYPOGRAPHY
   ============================================ */
.tracking-tighter {
  letter-spacing: -0.05em;
}

.tracking-widest {
  letter-spacing: 0.15em;
}

/* ============================================
   NAVIGATION COMPONENTS
   ============================================ */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand-primary {
  color: var(--brand-primary);
  font-weight: 900;
  font-size: 1.875rem;
  letter-spacing: -0.05em;
}

.nav-brand-secondary {
  color: rgb(30 41 59);
  font-weight: 300;
  font-size: 1.875rem;
  letter-spacing: -0.05em;
}

/* Sidebar Navigation */
.sidebar-nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2rem;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: all 0.2s ease;
  border-right: 4px solid transparent;
}

.sidebar-nav-item:hover {
  background-color: rgba(30, 41, 59, 0.5);
  color: rgb(226 232 240);
}

.sidebar-nav-item.active {
  background-color: var(--brand-primary);
  color: white;
  border-right-color: white;
}

/* ============================================
   BUTTON COMPONENTS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  cursor: pointer;
  border: 2px solid transparent;
}

.btn-primary {
  background-color: var(--brand-primary);
  color: white;
}

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

.btn-secondary {
  background-color: white;
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-secondary:hover {
  background-color: rgb(239 246 255);
}

.btn-ghost {
  background-color: transparent;
  color: rgb(100 116 139);
  border-color: rgb(226 232 240);
}

.btn-ghost:hover {
  background-color: rgb(248 250 252);
  color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.75rem;
}

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

/* ============================================
   CARD COMPONENTS
   ============================================ */
.card {
  background-color: white;
  border-radius: 1.5rem;
  box-shadow: var(--shadow-md);
  border: 1px solid rgb(241 245 249);
  overflow: hidden;
}

.card-hover {
  transition: all 0.3s ease;
}

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

.card-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid rgb(241 245 249);
  background-color: rgb(248 250 252);
}

.card-body {
  padding: 2rem;
}

.card-footer {
  padding: 1.5rem 2rem;
  border-top: 1px solid rgb(241 245 249);
  background-color: rgb(248 250 252);
}

/* Stat Cards */
.stat-card {
  background-color: white;
  padding: 2rem;
  border-radius: 2rem;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgb(241 245 249);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.stat-label {
  font-size: 0.625rem;
  font-weight: 900;
  color: rgb(148 163 184);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 900;
  color: rgb(15 23 42);
  letter-spacing: -0.025em;
}

.stat-footer {
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  margin-top: 1.5rem;
}

/* ============================================
   FORM COMPONENTS
   ============================================ */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: rgb(51 65 85);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  border: 2px solid rgb(226 232 240);
  border-radius: 0.75rem;
  transition: all 0.2s ease;
  background-color: white;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-input:disabled,
.form-select:disabled,
.form-textarea:disabled {
  background-color: rgb(248 250 252);
  color: rgb(148 163 184);
  cursor: not-allowed;
}

.form-error {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--status-error);
}

.form-help {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: rgb(100 116 139);
}

/* Checkbox and Radio */
.form-checkbox,
.form-radio {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgb(226 232 240);
  border-radius: 0.375rem;
  transition: all 0.2s ease;
}

.form-checkbox:checked,
.form-radio:checked {
  background-color: var(--brand-primary);
  border-color: var(--brand-primary);
}

.form-radio {
  border-radius: 50%;
}

/* ============================================
   TABLE COMPONENTS
   ============================================ */
.table-container {
  background-color: white;
  border-radius: 3rem;
  box-shadow: var(--shadow-2xl);
  border: 1px solid rgb(226 232 240);
  overflow: hidden;
}

.table {
  width: 100%;
  text-align: left;
  font-size: 0.75rem;
}

.table thead {
  background-color: rgb(15 23 42);
  color: white;
}

.table th {
  padding: 2rem 2.5rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.625rem;
}

.table tbody {
  background-color: white;
}

.table tbody tr {
  border-bottom: 1px solid rgb(241 245 249);
  transition: all 0.2s ease;
}

.table tbody tr:hover {
  background-color: rgba(239, 246, 255, 0.5);
}

.table td {
  padding: 1.5rem 2.5rem;
}

/* ============================================
   BADGE COMPONENTS
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.375rem 0.875rem;
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border-radius: 0.75rem;
  border: 1px solid;
}

.badge-success {
  background-color: rgb(240 253 244);
  color: rgb(22 163 74);
  border-color: rgb(187 247 208);
}

.badge-warning {
  background-color: rgb(254 252 232);
  color: rgb(202 138 4);
  border-color: rgb(254 240 138);
}

.badge-error {
  background-color: rgb(254 242 242);
  color: rgb(220 38 38);
  border-color: rgb(254 202 202);
}

.badge-info {
  background-color: rgb(239 246 255);
  color: rgb(37 99 235);
  border-color: rgb(191 219 254);
}

.badge-neutral {
  background-color: rgb(248 250 252);
  color: rgb(71 85 105);
  border-color: rgb(226 232 240);
}

/* Service Status Badges */
.badge-planned {
  background-color: rgb(248 250 252);
  color: rgb(71 85 105);
  border-color: rgb(226 232 240);
}

.badge-active {
  background-color: rgb(239 246 255);
  color: rgb(37 99 235);
  border-color: rgb(191 219 254);
}

.badge-completed {
  background-color: rgb(240 253 244);
  color: rgb(22 163 74);
  border-color: rgb(187 247 208);
}

.badge-cancelled {
  background-color: rgb(254 242 242);
  color: rgb(220 38 38);
  border-color: rgb(254 202 202);
}

/* ============================================
   PROGRESS BAR
   ============================================ */
.progress {
  width: 100%;
  height: 0.5rem;
  background-color: rgb(226 232 240);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: var(--brand-primary);
  transition: width 0.3s ease;
}

/* ============================================
   TOAST/ALERT COMPONENTS
   ============================================ */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  border: 1px solid;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background-color: rgb(240 253 244);
  color: rgb(22 101 52);
  border-color: rgb(187 247 208);
}

.alert-warning {
  background-color: rgb(254 252 232);
  color: rgb(133 77 14);
  border-color: rgb(254 240 138);
}

.alert-error {
  background-color: rgb(254 242 242);
  color: rgb(153 27 27);
  border-color: rgb(254 202 202);
}

.alert-info {
  background-color: rgb(239 246 255);
  color: rgb(30 64 175);
  border-color: rgb(191 219 254);
}

/* ============================================
   MODAL/DIALOG
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.2s ease-in-out;
}

.modal-content {
  background-color: white;
  border-radius: 1.5rem;
  padding: 2rem;
  max-width: 32rem;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-2xl);
  animation: slideIn 0.3s ease-out;
}

.modal-header {
  margin-bottom: 1.5rem;
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: rgb(15 23 42);
}

.modal-body {
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
}

/* ============================================
   SIDEBAR LAYOUT
   ============================================ */
.sidebar {
  width: 18rem;
  background-color: rgb(15 23 42);
  color: white;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2xl);
}

.sidebar-header {
  padding: 2rem;
  border-bottom: 1px solid rgb(30 41 59);
}

.sidebar-nav {
  flex: 1;
  margin-top: 2rem;
}

.sidebar-footer {
  padding: 2rem;
  border-top: 1px solid rgb(30 41 59);
  background-color: rgba(15, 23, 42, 0.5);
}

/* ============================================
   GRADIENT UTILITIES
   ============================================ */
.gradient-primary {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 50%, #2563eb 100%);
}

.gradient-bar {
  background: linear-gradient(90deg, #60a5fa 0%, #22d3ee 50%, #3b82f6 100%);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateY(-10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-in-out;
}

.animate-slideIn {
  animation: slideIn 0.3s ease-out;
}

.animate-slideUp {
  animation: slideUp 0.3s ease-out;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-uppercase {
  text-transform: uppercase;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hover-lift {
  transition: transform 0.2s ease;
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.shadow-hover {
  transition: box-shadow 0.2s ease;
}

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

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    height: auto;
  }
  
  .stat-card {
    padding: 1.5rem;
  }
  
  .stat-value {
    font-size: 1.875rem;
  }
  
  .table th,
  .table td {
    padding: 1rem 1.5rem;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
  .sidebar,
  .nav,
  .btn,
  button {
    display: none !important;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
