/* Aim is to use this standardised CSS for all related webpages */

/* ===== Global Reset ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== Base ===== */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  background-color: #0e1525; /* Background colour of website */
  color: #e2e8f0;
  overflow: hidden; /* prevent global scroll */
  height: 100vh;
  display: flex;
  flex-direction: column; /* Column ensures that the children are stacked VERTICALLY */
}
/* Children are: Topbar, Layout, Security Footer */

/* ===== Topbar Class ===== */
.topbar {
  background-color: #1e293b; /* Top bar background colour */
  padding: 8px 16px; /* Padding above and below the elements in top bar */
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #2d3548; /* Top bar bottom border colour */
  flex-shrink: 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px; /* Gap between Logo and Left Text */
}

.topbar-left h2 {
  /* font-size: 18px; */ /* Font size of left text. Commenting it sets it to default h2 size. */
  color: #f0f4ff; /* Colour of left text */
}

.topbar-right {
  font-size: 15px; /* Font size of right text. */
  color: #e2e8f0; /* Colour of right text */
}

.logo {
  height: 70px; /* Logo size */
  width: auto;
  border-radius: 7px;
}

/* ===== Layout Class (Main divs) ===== */
.layout {
  flex: 1;
  display: flex; /* Flex ensures that the children are stacked HORIZONTALLY */
  height: calc(100vh - 64px - 40px); /* full height minus topbar + footer */
  overflow: hidden; /* contain scrolling to content */
  gap: 20px;
  padding: 20px;
}
/* Children are: Sidebar Class (aside div), Content Class (section div)

/* Sidebar (fixed dark grey) */
/* Occupies the left whole column */
.sidebar {
  flex: 1;
  max-width: 500px; /* Horizontal width limits */
  min-width: 300px; /* Horizontal width limits */
  display: flex;
  flex-direction: column; /* Ensures children (content panes) are vertical stacked. */
  gap: 20px; /* Vertical gap between children (content panes) */
  background: #1b2433; /* Background colour of whole side bar */
  padding: 10px; /* Padding (both horizontal and vertical) between children inside and the outline of the side bar */
  border: 1px solid #2d3548; /* Border and its colour of the side bar */
  overflow: hidden; /* ensure no scroll */
}
/* Children are content panes (card class)

/* Content */
/* Occupies the right whole column */
.content {
  flex: 1; /* Grows to fit remaining horizontal width not occupied by side bar */
  display: flex;
  flex-direction: column; /* Ensures children (content panes) are vertically stacked. */
  gap: 20px; /* I assume: Vertical gap between children (content panes) */
  background: #1b2433; /* Background colour of whole content column */
  overflow-y: auto; /* Enables vertical scroll */
  padding-right: 5px; /* avoid scrollbar overlap */
}
/* Children are content panes (card class)

/* ===== Card Class ===== */
/* Used for each content pane */
.card {
  background: #1b2433; /* Background colour of each pane */
  border: 1px solid #2d3548; /* Border surrounding the pane */
  border-left: 2px solid #38bdf8; /* Left blue effect of each pane */
  border-radius: 0;
  padding: 16px; /* Padding between constiuent children and the borders of the pane */
  flex-shrink: 0;
}
/* Children typically are: h3 and a div below containing the text/details

/* The h3 header of each content pane */
.card h3 {
  margin-bottom: 12px; /* Margin between text and the next child below */
  font-size: 14px;
  text-transform: uppercase;
  color: #38bdf8; /* Colour of h3 text */
}

/* ===== Table ===== */
.table-container {
  overflow-x: auto; /* Pushes horizontal scroll to the bottom */
  width: 100%;
}

/* ===== Footer ===== */
/* Bottom of body div */
.security-footer {
  background-color: #000000;
  padding: 4px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #ffffff;
  position: relative;
  letter-spacing: 1.5px;
  font-weight: bold;
}

/* keep "unit" pinned left */
.security-footer .left {
  position: absolute;
  left: 27px;
}

/* "restricted" will stay centered naturally */
.security-footer .center {
  text-align: center;
}

/* Custom Tables */
.infoTable {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed;
}

.infoTable th,
.infoTable td {
  padding: 10px 14px;
  text-align: left;
  border: 1px solid #2d3548;
  word-break: break-word;
  overflow-wrap: break-word;
}

.infoTable th {
  background-color: #1e293b;
  color: #e2e8f0;
  font-weight: bold;
}

.infoTable tbody tr:nth-child(even) {
  background-color: #1f2a3d;
}

.infoTable tbody tr:nth-child(odd) {
  background-color: #263243;
}

.infoTable tbody tr:hover {
  background-color: #374151;
  transition: background 0.2s ease;
}

/* Bottom border for last row */
.date-group-last {
    border-bottom: 2px solid #808080;
}

/* Count Table */
.countTable-container {
  max-height: 300px; /* adjust as needed */
  overflow-y: auto;
}

.countTable {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  table-layout: fixed; /* keeps it from expanding weirdly */
}

.countTable th,
.countTable td {
  padding: 8px 12px;
  text-align: left;
  border: 1px solid #2d3548;
}

.countTable th {
  background-color: #1e293b;
  color: #e2e8f0;
  font-weight: bold;
}

.countTable tbody tr:nth-child(even) {
  background-color: #1f2a3d;
}

.countTable tbody tr:nth-child(odd) {
  background-color: #263243;
}

.countTable tbody tr:hover {
  background-color: #374151;
  transition: background 0.2s ease;
}

/* Custom Buttons */
/* Class button-outline-blue */
.button-outline-blue {
    background: none;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    padding: 1px 3px;
    cursor: pointer;
    border-radius: 2px;
}

.button-outline-blue:hover {
    background-color: #38bdf8;     /* optional: fill on hover */
    color: white;                  /* text becomes white on hover */
}

.button-outline-blue-top-space {
    background: none;
    border: 1px solid #38bdf8;
    color: #38bdf8;
    font-size: 10px;
    padding: 1px 3px;
    cursor: pointer;
    border-radius: 2px;
    margin-top:6px;
}

.button-outline-blue-top-space:hover {
    background-color: #38bdf8;     /* optional: fill on hover */
    color: white;                  /* text becomes white on hover */
}

/* More */
.start-end-marker {
    width: 16px;
    height: 16px;
    background-color: grey;
    border: 1px solid grey;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px; /* fits inside small box */
    color: rgb(255, 255, 255);
    font-weight: bold;
    line-height: 1; /* ensures vertical centering */
}
.start-end-marker span {
    display: block;
}

.neutral-link {
    color: grey;           /* text color */
    text-decoration: underline;  /* keep underline */
}

.neutral-link:hover,
.neutral-link:visited,
.neutral-link:active {
    color: grey;           /* stay grey on all states */
}

.largeMap {
    width: 100%;
    height: 500px;
}

/* Card without blue highlight */
.aircraft-card {
  background: #1b2433; /* Background colour of each pane */
  border: 1px solid #2d3548; /* Border surrounding the pane */
  /* border-left: 2px solid #38bdf8; Left blue effect of each pane */
  border-radius: 0;
  padding: 16px; /* Padding between constiuent children and the borders of the pane */
  flex-shrink: 0;

  display: flex;
  align-items: flex-start;
}

.aircraft-image {
  display: block;
  width: 100%;        /* Fill the width of the card */
  height: auto;       /* Keep aspect ratio */
  max-height: 250px;  /* Optional: prevent overly tall images */
  object-fit: contain; /* Ensures the image is fully visible */
}

/* For overview drop-down table */
.accordion-header {
    background: #1b2433;
    border: 1px solid #2d3548;
    padding: 8px;
    cursor: pointer;
    /* font-weight: bold; */
    margin-top: 6px;
    border-radius: 4px;
}

.accordion-details {
    padding: 8px;
    border-left: 2px solid #ccc;
    margin-bottom: 10px;
}

.hidden {
    display: none;
}

/* Left Right Separator */
.inline-leftright {
    display: flex;
    justify-content: space-between; /* push left + right apart */
    align-items: flex-start;        /* align tops */
    gap: 20px;                      /* space between left and right */
    margin-bottom: 20px;            /* spacing below this block */
}
.inline-leftright .left,
.inline-leftright .right {
    flex: 1;
}
.inline-leftright .left p {
    margin: 4px 0;
}

/* Fixed Maximum Height, Vertical Scroll, No Horizontal Scroll Table */
.fixed-height-vertical-scroll-no-horizontal-scroll-table-container {
  width: 100%;
  max-height: 300px;   /* adjust height */
  overflow-y: auto;    /* vertical scroll */
  overflow-x: hidden;  /* prevent horizontal scroll */
}

/* Date Filters */
.dateFilter {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dateGroup {
  display: flex;
  flex-direction: column;
}

.dateGroup input[type="date"] {
  max-width: 180px;
  width: 100%;
}

/* Refresh Settings */
.refresh-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.refresh-settings {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.refresh-input {
  display: flex;
  align-items: center;
}
.refresh-input input[type="number"] {
  width: 40px;
  text-align: right;
}
.refresh-input span {
  margin-left: 0.25rem;
}

/* Icon Bar */
/* .icon-bar {
    margin-top: auto;
    border: 1px solid #ccc;
    width: fit-content;
    max-width: 100%;
} */
/* For lettered one */
.icon-bar {
    margin-top: auto;
    width: fit-content;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    gap: 10px;
}

/* .icon-bar button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: background 0.2s ease;
} */
/* For lettered one */
.icon-bar button {
    width: 35px;
    height: 35px;
    border: 1px solid #38bdf8;    /* box border */
    border-radius: 6px;
    background: none;
    color: #38bdf8;
    font-weight: bold;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2 ease;
}

/* .icon-bar button:hover {
    background: rgba(0,0,0,0.1);
} */
/* For lettered one */
.icon-bar button:hover {
    background-color: #38bdf8;     /* optional: fill on hover */
    color: white;                  /* text becomes white on hover */
}

.icon-bar img {
    width: 35px;
    height: 35px;
    display: block;
}

/* Alert CSS */
.alert-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 400px;
    height: 30vh;
    padding: 12px;
    
    background: rgba(50, 50, 50, 0.9); /* dark grey */
    border-radius: 10px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    z-index: 99999;

    display: none; /* Hidden until alerts exist */
}

.alert-box {
    background: #ff4444;
    color: white;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.alert-title {
    font-size: 18px;
    font-weight: bold;
}

.alert-explanation {
    font-size: 14px;
}

.alert-close {
    align-self: flex-end;
    cursor: pointer;
    font-weight: bold;
    padding: 4px 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}

.border-yellow-black {
    border: 4px solid;
    border-image: repeating-linear-gradient(
        45deg,
        yellow 0 10px,
        black 10px 20px
    ) 10;
}

.border-red-black {
    border: 4px solid;
    border-image: repeating-linear-gradient(
        45deg,
        red 0 10px,
        black 10px 20px
    ) 10;
}

.search-bar {
    display: flex;
    gap: 8px;
    width: 50%
}

.search-bar input {
    flex: 1;          /* takes up all available space */
    padding: 4px 6px;
}