/* ============================================
   RESPONSIVE CSS - Mobile & Desktop Friendly
   ============================================ */

/* Base Styles - Mobile First */
* {
  box-sizing: border-box;
}

/* Header Styles */
#top-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 15px;
  background-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

#top-bar .logo-header {
  min-width: 120px;
  height: 50px;
  /* background-size: contain !important; */
}

#top-bar .cell {
  padding: 5px;
}

#top-bar select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
}

#top-bar select:hover {
  border-color: #015cda;
}

#top-bar select:focus {
  outline: none;
  border-color: #015cda;
  box-shadow: 0 0 0 2px rgba(1, 92, 218, 0.1);
}

#top-bar a {
  padding: 8px 12px;
  color: #015cda;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

#top-bar a:hover {
  color: #0144a8;
  text-decoration: underline;
}

/* Table Styles */
.pax-table {
  width: 100%;
  border-collapse: collapse;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.pax-table thead {
  background-color: #f5f5f5;
  position: sticky;
  top: 0;
  z-index: 10;
}

.pax-table th,
.pax-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #e0e0e0;
}

.pax-table th {
  font-weight: 600;
  color: #333333;
  white-space: nowrap;
}

.pax-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

.pax-table tbody tr:hover {
  background-color: #f0f4ff;
  transition: background-color 0.2s;
}

.pax-table td {
  color: #444444;
}

.pax-table a {
  color: #015cda;
  text-decoration: none;
  font-weight: 500;
}

.pax-table a:hover {
  text-decoration: underline;
}

/* Sortable Headers */
.pax-table th.sort-up,
.pax-table th.sort-down {
  /* position: relative; */
}

.pax-table th.sort-up span::after,
.pax-table th.sort-down span::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  margin-left: 5px;
  vertical-align: middle;
}

.pax-table th.sort-up span::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid #333;
}

.pax-table th.sort-down span::after {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 6px solid #333;
}

/* Scrollable Table Container */
.scrollable-table {
  overflow-x: auto;
  overflow-y: auto;
  height: 100%;
  -webkit-overflow-scrolling: touch;
}
.scrollable-table thead {
  z-index: 100;
}

.scrollable-table table {
  min-width: 100%;
}

/* Widget Styles */
.widget {
  background-color: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.2s;
}

.widget:hover {
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.widget.center {
  text-align: center;
}

.widget h4 {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.widget h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: #333;
}

.widget p {
  margin: 8px 0;
  color: #444;
  line-height: 1.5;
}

.widget img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Tab Styles */
.tab {
  padding: 10px 20px !important;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
  font-weight: 500;
  color: #666;
}

.tab:hover {
  color: #015cda;
  background-color: #f5f5f5;
}

.tab.tab-active {
  color: #015cda;
  border-bottom-color: #015cda;
  background-color: #f0f4ff;
}

.tab.tab-disabled {
  color: #ccc;
  cursor: not-allowed;
}

.tab.tab-disabled:hover {
  color: #ccc;
  background-color: transparent;
}

/* Flex Row Styles */
.flex-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.flex-row-v {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Cell Styles */
.cell {
  flex: 0 0 auto;
}

.cell.cell-50 {
  flex: 0 0 100%;
}

.cell.cell-auto {
  flex: 0 0 auto;
}

.cell.cell-expand {
  flex: 1 1 0;
  min-width: 0;
}

/* Body Container */
#body {
  padding: 15px;
  overflow-y: auto;
}

#body.no-scroll {
  overflow: hidden;
}

/* Typography */
h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #333;
}

h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 15px 0;
  color: #333;
}

/* Links */
a {
  color: #015cda;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #0144a8;
  text-decoration: underline;
}

/* Form Elements */
select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.2s;
  width: 100%;
  max-width: 200px;
}

select:hover {
  border-color: #015cda;
}

select:focus {
  outline: none;
  border-color: #015cda;
  box-shadow: 0 0 0 2px rgba(1, 92, 218, 0.1);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
}

/* Loading */
.loading-modal {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   TABLET STYLES (768px and up)
   ============================================ */
@media (min-width: 768px) {
  #top-bar {
    flex-wrap: nowrap;
    padding: 10px 30px;
  }

  #top-bar .cell.cell-50 {
    flex: 0 0 50%;
  }

  .pax-table {
    font-size: 15px;
  }

  .pax-table th,
  .pax-table td {
    padding: 12px 15px;
  }

  .widget {
    padding: 20px;
  }

  #body {
    padding: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .cell.cell-50 {
    flex: 0 0 50%;
  }
}

/* ============================================
   DESKTOP STYLES (1024px and up)
   ============================================ */
@media (min-width: 1024px) {
  #top-bar {
    padding: 10px 50px;
  }

  #top-bar .logo-header {
    width: 150px;
    height: 70px;
  }

  .pax-table {
    font-size: 16px;
  }

  .pax-table th,
  .pax-table td {
    padding: 12px 18px;
  }

  .widget {
    padding: 20px;
  }

  #body {
    padding: 30px;
  }

  h1 {
    font-size: 32px;
  }

  .flex-row {
    flex-wrap: nowrap;
  }
}

/* ============================================
   MOBILE SPECIFIC STYLES (max-width: 767px)
   ============================================ */
@media (max-width: 767px) {
  /* Header Mobile */
  #top-bar {
    flex-direction: column;
    height: auto;
    min-height: 75px;
    padding: 10px;
  }

  #top-bar .logo-header {
    width: 100px;
    height: 40px;
    margin-bottom: 10px;
  }

  #top-bar .cell {
    width: 100%;
    padding: 5px 0;
  }

  #top-bar select {
    width: 100%;
    max-width: none;
  }

  #top-bar a {
    display: block;
    text-align: center;
    padding: 10px;
  }

  /* Body Mobile */
  #body {
    top: auto;
    padding: 10px;
  }

  /* Table Mobile */
  .scrollable-table {
    overflow-x: scroll;
    -webkit-overflow-scrolling: touch;
  }

  .pax-table {
    font-size: 12px;
    min-width: 600px; /* Force horizontal scroll on mobile */
  }

  .pax-table th,
  .pax-table td {
    padding: 8px 6px;
    white-space: nowrap;
  }

  /* Widget Mobile */
  .widget {
    padding: 12px;
    margin-bottom: 10px;
  }

  .widget h4 {
    font-size: 12px;
  }

  /* Tabs Mobile */
  .tab {
    padding: 8px 12px !important;
    font-size: 14px;
  }

  /* Flex Mobile */
  .flex-row {
    flex-direction: column;
  }

  .flex-row .cell {
    width: 100% !important;
  }

  .cell.cell-50 {
    width: 100% !important;
  }

  /* Typography Mobile */
  h1 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  h2 {
    font-size: 18px;
    margin-bottom: 12px;
  }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

/* Print Styles */
@media print {
  #top-bar {
    display: none;
  }

  #body {
    top: 0;
    padding: 0;
  }

  .pax-table {
    box-shadow: none;
  }

  .widget {
    box-shadow: none;
    border: 1px solid #000;
  }
}
