/* ========================================
   Mission Fed Standard UI Theme
   Version: 1.0
   Last Updated: February 2026
   
   This stylesheet contains the standard styling
   used across all Mission Fed web applications.
   
   Applications using this theme:
   - LettersApp
   - CAB Portal
======================================== */

/* ========================================
   Global Styles
======================================== */
html {
  font-size: 14px;
}
@media (min-width: 768px) {
  html { font-size: 16px; }
}

body {
  background-color: #e9ecef; /* light grey background */
}

html { position: relative; min-height: 100%; }

/* Accent bars (header/footer) */
.accent-bar-blue { height: 5px; background: #76C6E4; }
.accent-bar-red { height: 5px; background: #CF1B23; }
.accent-bar-yellow { height: 5px; background: #F9DC4A; }
.accent-bar-orange { height: 5px; background: #EC5D2A; }

/* ========================================
   Page Header Component
======================================== */
.page-header {
  background-color: #f8f9fc;
  border: 1px solid #dee2e6;
  border-radius: .25rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}
.page-header h5 {
  margin: 0;
  font-weight: 600;
  font-size: 1.15rem;
  color: #212529;
}
.page-header .small {
  font-size: .85rem;
  color: #6c757d;
}

/* ========================================
   Buttons
======================================== */
.btn:focus, .btn:active:focus, 
.btn-link.nav-link:focus, 
.form-control:focus, 
.form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.btn-xs {
  padding: .20rem .55rem;
  font-size: .8rem;
  border-radius: .25rem;
  line-height: 1.3;
}

.btn-sm-downloadfile,
.btn-sm-viewfile {
  padding: .25rem .5rem;
  font-size: .7rem;
  border-radius: .2rem;
  min-width: 70px;
  text-align: center;
}

/* ========================================
   Cards / Modals
======================================== */
.card-body.compact { padding: .75rem 1rem; }
.card-header { letter-spacing: .5px; }
.table-responsive {
    overflow-x: hidden !important;
}
.modal-body.bg-light { background-color:#f8f9fa; }
.modal-content { border-radius: 0.25rem; overflow: hidden; }
.modal-header {
  background-color: #e7f1ff;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  padding: .5rem .75rem;
  font-size: .875rem;
}
.modal-title {
  font-weight: 600;
  font-size: 1.2rem;
  color: #003366;
}
.modal-body {
  font-size: .875rem;
  padding: .75rem 1rem;
}
.modal-body .fw-medium { font-size: .9rem; }
.modal-footer {
  padding: 0.5rem 1rem;
  border-top: none;
}
.modal-header .btn-close {
  scale: 0.9;
  filter: invert(16%) sepia(30%) saturate(2000%) hue-rotate(200deg) brightness(90%) contrast(90%);
}
.modal-header.bg-primary,
.modal-header.bg-success,
.modal-header.bg-warning,
.modal-header.bg-danger {
  color: #fff !important;
}
.modal-header.bg-primary .modal-title,
.modal-header.bg-success .modal-title,
.modal-header.bg-warning .modal-title,
.modal-header.bg-danger .modal-title {
  color: #fff !important;
}
.modal-header.bg-primary .btn-close {
  filter: invert(100%) grayscale(100%) brightness(200%);
  opacity: 0.9;
}
.modal-header.bg-primary .btn-close:hover { opacity: 1; }

/* ========================================
   Tables
======================================== */
.table td, .table th {
  font-size: .875rem;
  padding: .5rem .5rem;
}
.table tbody tr:nth-child(odd) { background-color: #fafafa; }
.table-hover tbody tr:hover { background-color: #f5f7fa; }

.table thead th {
  font-weight: 600;
  font-size: 0.9rem;
  color: #0c4aad;
  border-bottom: 2px solid #dee2e6;
  background-color: #f8f9fc;
  padding-top: .4rem;
  padding-bottom: .4rem;
}

.status-success { color: #198754; font-weight: 600; }
.status-warning { color: #b58105; font-weight: 600; }
.status-pending { color: #6c757d; font-weight: 600; }

/* Badges */
.badge-draft {
  background-color: #e2e3e5;
  color: #495057;
  font-weight: 500;
  font-size: .75rem;
  padding: .35em .65em;
}

/* DataTables controls (if using DataTables) */
.dataTables_filter input {
  border-radius: .25rem;
  font-size: .85rem;
  padding: .25rem .5rem;
}
.dataTables_filter label { font-weight: 500; margin-bottom: 0; color: #495057; }
.dataTables_info { font-size: .8rem; color: #6c757d; }
.dataTables_paginate .pagination { margin-bottom: 0; }
.dataTables_paginate .page-item .page-link {
  padding: .25rem .5rem;
  font-size: .8rem;
  line-height: 1.2;
  border-radius: .2rem;
}
.dataTables_paginate .page-item.active .page-link {
  background-color: #e7f1ff;
  color: #0c4aad;
  border-color: #b6d4fe;
}

/* ========================================
   Utilities
======================================== */
.summary-dl {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 2rem;
}
@media (min-width: 768px) {
  .summary-dl { grid-template-columns: 1fr 1fr; }
}
.summary-dl dt {
  font-weight: 600;
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0 0 0.25rem 0;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.summary-dl dd {
  font-size: 0.95rem;
  margin: 0;
  color: #212529;
}

.toast-container { margin-top:70px; z-index:1080; }
.view-details-link { cursor:pointer; text-decoration:none; }
.view-details-link:hover { text-decoration:underline; }

/* ========================================
   Reusable Card Header Variants
======================================== */

/* Base style (stronger header presence) */
.card-header {
  font-weight: 600;
  letter-spacing: .5px;
  font-size: 0.95rem;
  padding: 0.5rem 0.75rem;
}

/* Base card tweaks */
.card-body-compact {
  padding: .75rem 1rem;
}

/* Header variants */
.card-header-blue   { background:#e7f1ff; color:#0c4aad; border-bottom:2px solid #e9ecef; font-weight:600; }
.card-header-green  { background:#d1f0db; color:#146c43; border-bottom:2px solid #c3e6cb; font-weight:600; }
.card-header-yellow { background:#fff3cd; color:#997404; border-bottom:2px solid #ffe69c; font-weight:600; }
.card-header-red    { background:#f8d7da; color:#842029; border-bottom:2px solid #f5c2c7; font-weight:600; }

/* ========================================
   Loading Overlay
======================================== */
#loadingOverlay {
  display: none;
  justify-content: center;
  align-items: center;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  z-index: 2000;
}

/* ========================================
   Navigation
======================================== */
/* Nav pills styling for segmented controls */
.nav-pills .nav-link {
  padding: 0.35rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 999px;
  color: #495057;
  background-color: #f1f3f5;
  border: 1px solid #dee2e6;
}
.nav-pills .nav-item + .nav-item {
  margin-left: .35rem;
}

.nav-pills .nav-link:hover {
  background-color: #e9ecef;
}

.nav-pills .nav-link.active {
  background-color: #0d6efd;
  color: #fff;
  border-color: #0d6efd;
}

/* ========================================
   Audit Timeline
======================================== */
.audit-timeline {
  border-left: 2px solid #e5e7eb;
  padding-left: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.audit-entry {
  position: relative;
  padding-left: 1rem;
}

.audit-entry::before {
  content: "";
  position: absolute;
  left: -1.45rem;
  top: 0.35rem;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: #2563eb;
}

/* ========================================
   Responsive Utilities
======================================== */
@media (max-width: 767.98px) {
  .page-header {
    flex-direction: column !important;
    align-items: flex-start !important;
  }
  
  .page-header > div:last-child {
    width: 100%;
    margin-top: 1rem;
  }
}

/* ========================================
   Print Styles
======================================== */
@media print {
  .accent-bar-blue,
  .accent-bar-red,
  .accent-bar-yellow,
  .accent-bar-orange {
    display: none;
  }
  
  body {
    background-color: white;
  }
  
  .no-print {
    display: none !important;
  }
}

/* ========================================
   Accessibility Improvements
======================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible improvements */
*:focus-visible {
  outline: 2px solid #0d6efd;
  outline-offset: 2px;
}

/* ========================================
   End of Mission Fed Standard Theme
======================================== */
