html {
    font-family: Verdana, Geneva, Tahoma, sans-serif;
    display: block;
    width: 100%;
    text-align: center;
}

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    width: 100%;
    overflow-x: hidden;
}

.topnav {
    overflow: hidden;
    background-color: #0f377f;
    color: white;
    font-size: 1.2rem;
    padding: 5px;
}

.topnav img {
    max-width: 30%; /* Make the image responsive to the screen size */
    height: auto; /* Maintain the aspect ratio of the image */
    padding: 5px;
}

#copyright{
    background-color:#0f367f25;
    padding-top: 1px;
    padding-bottom: 1px;
    font-size: 0.6rem;
    color: #1f497da2;
}

#authentication-bar{
    background-color:#9cc1ee1e;
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 10px;
    padding-right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    text-align: center;
}

#authentication-bar .auth-user-row {
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: baseline;
    gap: 6px;
}

#authentication-bar .auth-meta-row {
    display: flex;
    flex-direction: column;
    width: 100%;
    justify-content: center;
    align-items: center;
    gap: 2px;
}

#authentication-bar #logout-link {
    display: inline-block;
    margin: 0;
}

#user-details{
    color: #1f497da2;
}

.content {
    padding: 20px;
}

.card {
    background-color: white;
    box-shadow: 2px 2px 12px 1px rgba(140,140,140,.5);
    padding: 5%;
}

.cards {
    width: min(100%, 800px);
    max-width: 800px;
    margin: 0 auto;
    margin-bottom: 10px;
    display: grid;
    grid-gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 2fr));
}

.cards.single-card {
    max-width: 420px;
    grid-template-columns: minmax(220px, 1fr);
}

.eModal {
    max-width: 800px;
    min-width: 200px; /* Minimum width set to 200px */
    width: 100%; /* Allow width to adjust between min-width and max-width */
    margin: 0 auto;
    margin-bottom: 10px;
    display: none; /* Hidden by default */
    grid-gap: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(200px, 2fr));
    align-items: center;
    justify-content: center;
}


.eModal.active {
    display: grid;
}

.eModal-content {
    background-color: white;
    height: 250px;
    width: 100%;
    overflow: hidden;
    position: relative;
    box-shadow: 2px 2px 12px 1px rgba(140,140,140,.5);
    color: #252525;
}

.eModal-content:before {
    background-color: #f656567a;
    border-radius: 50%;
    content: "";
    filter: blur(80px);
    opacity: 0.4;
    position: absolute;
    top: -15em;
    right: -15em;
    width: 30em;
    height: 25em;
    z-index: 1;
    transition: background-color 0.5s;
}

.eModal-body {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

span.eIcon {
    font-size: calc(80px + 2vw); /* Adjust the icon size relative to viewport width */
    color: #ff3a3a;
    padding: 5%;
}

.right-items {
    padding: 5%;
}

.right-items h1 {
    font-size: calc(2rem + 1vw); /* Adjust the heading size relative to viewport width */
    margin-bottom: 10px;
}  

.time-range-container {
    margin: 4px 0 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
    align-items: end;
    gap: 8px;
    text-align: left;
}

.time-range-field {
    min-width: 0;
    display: grid;
    gap: 4px;
}

.time-range-field label {
    margin: 0;
}

.time-range-field input[type=datetime-local] {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-inline-size: 0;
    max-inline-size: 100%;
    display: block;
    appearance: none;
    -webkit-appearance: none;
    font-size: 16px;
}

.time-range-actions {
    display: flex;
    align-items: end;
}

.time-range-actions button {
    white-space: nowrap;
}

.time-range-container button {
    margin: 0;
}

#flight-select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.plotting-tools {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #d5deeb;
}

.flight-export-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #d5deeb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.flight-export-title {
    margin: 0;
    color: #0f377f;
    font-weight: 700;
    letter-spacing: 0.02em;
    flex: 0 0 auto;
}

.flight-export-row {
    display: flex;
    flex: 1 1 380px;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.flight-export-row button {
    margin: 0;
    min-width: 190px;
}

.secondary-button {
    background: #e7eefb;
    color: #0f377f;
    border: 1px solid #b9cceb;
}

.flight-export-feedback {
    margin: 0;
    flex: 1 1 100%;
    text-align: left;
}

.flight-export-feedback {
    color: #0f377f;
    font-weight: 600;
}

.flight-export-feedback.is-error {
    color: #b42318;
}

.time-range-hint {
    margin: 4px 0 0;
    color: #5d7395;
    font-size: 0.78rem;
    line-height: 1.3;
}

.performance-mode-badge {
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid #f7c783;
    border-radius: 8px;
    background: #fff5e8;
    color: #8c5107;
    font-weight: 600;
}

.flight-selected-text {
    margin: 2px 0 0;
}

#flight-management-div .flight-row label {
    min-width: 95px;
}

#flight-management-div .flight-selected-text,
#flight-management-div .time-range-hint {
    width: 100%;
    text-align: center;
    justify-self: center;
}

.flight-grid {
    display: grid;
    gap: 10px;
    text-align: left;
}

.flight-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.flight-row label {
    min-width: 150px;
    margin-right: 0;
}

.flight-row input[type=text],
.flight-row input[type=datetime-local],
.flight-row select {
    min-width: 220px;
    flex: 1;
    max-width: 100%;
}

.flight-row select {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.flight-row button {
    margin: 0;
}

.action-button-row {
    width: min(100%, 800px);
    margin: 0 auto 10px;
    padding: 0 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.action-button-row button {
    margin: 0;
    min-width: 170px;
}

.connect-flight-modal-content {
    max-width: 920px;
}

.flight-modal-buttons {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.connect-mode-switch {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.connect-mode-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1 1 240px;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid #c1d0ea;
    border-radius: 10px;
    padding: 12px 16px;
    margin-right: 0;
    box-shadow: 0 8px 20px rgba(15, 55, 127, 0.08);
    font-weight: 600;
    color: #10387f;
}

.connect-mode-option input {
    accent-color: #0f377f;
}

.recording-flight-section {
    margin-top: 14px;
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #c3d3ed;
    border-radius: 10px;
    background: linear-gradient(150deg, #f8fbff 0%, #f1f6ff 100%);
}

.recording-flight-section p {
    margin: 0 0 12px 0;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #10387f;
}

#connect-flight-modal {
    z-index: 10000;
    background: rgba(11, 21, 41, 0.7);
    backdrop-filter: blur(4px);
    padding: clamp(14px, 3vw, 30px);
    align-items: center;
    justify-content: center;
    overflow: auto;
}

#connect-flight-modal .connect-flight-modal-content {
    margin: 0;
    width: min(920px, 96vw);
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 14px;
    background: linear-gradient(170deg, #f9fbff 0%, #eef4ff 100%);
    box-shadow: 0 30px 70px rgba(8, 18, 36, 0.35);
    overflow: hidden;
}

#connect-flight-modal .container {
    padding: clamp(20px, 4vw, 38px);
}

.connect-flight-subtitle {
    margin: 0 0 20px 0;
    color: #184087;
    font-size: 1.18rem;
    font-weight: 500;
}

#connect-flight-modal h1 {
    margin: 0 0 12px 0;
    color: #0f377f;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.01em;
}

#connect-flight-modal .flight-grid {
    gap: 14px;
}

#connect-flight-modal .flight-row {
    gap: 12px;
}

#connect-flight-modal .flight-row label {
    min-width: 110px;
    font-weight: 600;
    color: #173f82;
}

#connect-flight-modal .flight-row input,
#connect-flight-modal .flight-row select {
    background: #ffffff;
    border: 1px solid #b9c8e3;
}

#connect-flight-modal .flight-modal-buttons button {
    min-width: 170px;
    margin: 0;
    border-radius: 8px;
}

@media screen and (max-width: 700px) {
    #connect-flight-modal .flight-modal-buttons {
        flex-direction: column-reverse;
        align-items: stretch;
    }

    #connect-flight-modal .flight-modal-buttons button {
        width: 100%;
    }
}
      
label {
    font-size: 1rem;
    margin-right: 8px;
}
    
input {
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}

select {
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Verdana, Geneva, Tahoma, sans-serif;
}
    




#map {width: 100%; }
#map {
    height: clamp(320px, 55vh, 720px);
}

.marker {
    background-image: url('mapbox-marker-icon-blue.svg');
    background-size: cover;
    width: 30px;
    height: 50px;
    cursor: pointer;
    }

.mapboxgl-popup {
    max-width: 200px;
    margin: 0 auto;
    box-shadow: 2px 2px 12px 1px rgba(140,140,140,.5);
}

.mapboxgl-popup-content {
    text-align: center;
    font-family: 'Open Sans', sans-serif;
}

/* Keep third-party map/chart controls readable and unaffected by generic button styles */
.mapboxgl-ctrl button,
.mapboxgl-ctrl button:hover {
    margin: 0 !important;
    padding: 0 !important;
    width: 30px !important;
    height: 30px !important;
    background-color: #fff !important;
    color: #1f2937 !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 1 !important;
}

.mapboxgl-ctrl button span {
    color: #1f2937 !important;
}

.reading {
    color: #193036;
}

.clock {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.2rem, 4.5vw, 3.45rem);
    display: flex;
    line-height: 1;
    justify-content: center;
    align-items: center;
}

.status-cards {
    max-width: 800px;
}

.status-card {
    padding: 22px 24px 16px;
    border: 1px solid #dce5f1;
    background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
}

.status-main {
    position: relative;
    min-height: 128px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.status-time-group,
.status-date-group,
.status-speed-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.status-time-group {
    text-align: center;
    align-items: center;
}

.status-date-group {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: left;
    align-items: flex-start;
}

.status-speed-group {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    text-align: right;
    align-items: flex-end;
}

.status-label {
    color: #60708a;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.speed-digital {
    color: #153d86;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.95rem, 2vw, 1.25rem);
    line-height: 1.2;
}

.date-digital {
    color: #153d86;
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(0.85rem, 1.8vw, 1.1rem);
    line-height: 1.2;
}

.status-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e1e7f0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    color: #3f577c;
    font-size: 0.86rem;
}

.status-meta > span:nth-child(1) {
    justify-self: start;
}

.status-meta > span:nth-child(2) {
    justify-self: center;
}

.status-meta > span:nth-child(3) {
    justify-self: end;
}

.chart-container {
    min-height: 360px;
}

.visualization-loading {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(11, 21, 41, 0.42);
    backdrop-filter: blur(4px);
}

.visualization-loading-card {
    min-width: min(320px, 90vw);
    padding: 20px 24px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 20px 50px rgba(8, 18, 36, 0.28);
    color: #10387f;
}

.visualization-loading-card p {
    margin: 12px 0 0;
    font-weight: 700;
}

.visualization-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto;
    border: 4px solid #d7e3f8;
    border-top-color: #1f4f9f;
    border-radius: 50%;
    animation: visualizationSpin 0.9s linear infinite;
}

@keyframes visualizationSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.highcharts-fullscreen,
.highcharts-fullscreen .highcharts-container,
.highcharts-fullscreen .highcharts-root {
    background-color: #ffffff !important;
}

.chart-container .highcharts-container {
    overflow: visible !important;
}

.chart-controls-row {
    margin-top: 4px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.chart-toggle-group {
    display: flex;
    align-items: center;
    gap: 4px;
    background: #eef3fb;
    border: 1px solid #d5e0f0;
    border-radius: 999px;
    padding: 4px;
}

.chart-toggle-btn {
    margin: 0;
    padding: 7px 14px;
    border: 1px solid transparent;
    border-radius: 999px;
    background-color: transparent;
    color: #214989;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.chart-toggle-btn:hover {
    opacity: 1;
    background-color: #dfe9f7;
}

.chart-toggle-btn.active {
    border-color: #1f4f9f;
    background-color: #1f4f9f;
    color: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}

.date-time{
    font-size: 0.8rem;
    color: #1f497da2;
}

.role-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.role-badge-demo {
    background: #ffe8c7;
    color: #8b4b00;
    border: 1px solid #f5ca8a;
}

.role-badge-admin {
    background: #dde8ff;
    color: #0f377f;
    border: 1px solid #b7ccf6;
}

button {
    background-color: #0f377f;
    color: white;
    padding: 14px 20px;
    margin: 8px 0;
    border: none;
    cursor: pointer;
    border-radius: 4px;
}
button:hover {
   opacity: 0.8;
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.deletebtn{
    background-color: #c52c2c;
}

.form-elements-container{
    padding: 16px;
    width: 250px;
    margin: 0 auto;
}

input[type=text], input[type=password] {
    width: 100%;
    padding: 12px 20px;
    margin: 8px 0;
    display: inline-block;
    border: 1px solid #ccc;
    box-sizing: border-box;
}

table {
    width: 100%;
    text-align: center;
    font-size: 0.8rem;
}   
tr, td {
    padding: 0.25rem;
}
tr:nth-child(even) {
    background-color: #f2f2f2
}
tr:hover {
    background-color: #ddd;
}
th {
    position: sticky;
    top: 0;
    background-color: #0f377f;
    color: white;
}

/* The Modal (background) */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: #474e5d;
    padding-top: 50px;
}
  
/* Modal Content/Box */
.modal-content {
    background-color: #fefefe;
    margin: 5% auto 15% auto; /* 5% from the top, 15% from the bottom and centered */
    border: 1px solid #888;
    width: 80%; /* Could be more or less, depending on screen size */
}

#admin-unlock-modal,
#admin-modal,
#admin-edit-modal {
    z-index: 10000;
    background: rgba(11, 21, 41, 0.7);
    backdrop-filter: blur(4px);
    padding: clamp(14px, 3vw, 30px);
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.admin-unlock-modal-content {
    margin: 0;
    width: min(580px, 96vw);
    max-height: calc(100dvh - 24px);
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 14px;
    background: linear-gradient(170deg, #f9fbff 0%, #eef4ff 100%);
    box-shadow: 0 30px 70px rgba(8, 18, 36, 0.35);
    overflow: hidden;
}

.admin-modal-content {
    margin: 0;
    width: min(1200px, 96vw);
    max-height: calc(100dvh - 24px);
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 14px;
    background: linear-gradient(170deg, #f9fbff 0%, #eef4ff 100%);
    box-shadow: 0 30px 70px rgba(8, 18, 36, 0.35);
    overflow: hidden;
}

.admin-edit-modal-content {
    margin: 0;
    width: min(960px, 96vw);
    max-height: calc(100dvh - 24px);
    border: 1px solid rgba(255, 255, 255, 0.44);
    border-radius: 14px;
    background: linear-gradient(170deg, #f9fbff 0%, #eef4ff 100%);
    box-shadow: 0 30px 70px rgba(8, 18, 36, 0.35);
    overflow: hidden;
}

#admin-unlock-modal .container,
#admin-modal .container,
#admin-edit-modal .container {
    padding: clamp(20px, 4vw, 38px);
    max-height: calc(100dvh - 24px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}

.admin-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.admin-header-row h1 {
    margin: 0;
    color: #0f377f;
    letter-spacing: 0.01em;
}

.admin-subtitle {
    margin: 0 0 20px 0;
    color: #184087;
    font-size: 1.12rem;
    font-weight: 500;
}

.admin-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid #c7d6ee;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 22px rgba(15, 55, 127, 0.08);
}

.admin-upload-row input[type=text],
.admin-upload-row input[type=date],
.admin-upload-row input[type=file] {
    margin: 0;
}

.admin-upload-row input[type=text] {
    min-width: 190px;
    flex: 1 1 220px;
}

#admin-upload-feedback {
    margin: 0 0 12px 0;
}

.admin-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid #c7d6ee;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 22px rgba(15, 55, 127, 0.08);
}

.admin-filter-row input[type=text] {
    flex: 1 1 300px;
    margin: 0;
}

.admin-filter-row select {
    min-width: 150px;
}

.admin-demo-only-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    min-width: auto;
}

.admin-table-wrapper {
    max-height: 65vh;
    overflow: auto;
    border: 1px solid #ccd9ee;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 18px rgba(15, 55, 127, 0.09);
}

#admin-flight-table {
    font-size: 0.78rem;
    background: #ffffff;
}

#admin-flight-table td,
#admin-flight-table th {
    white-space: nowrap;
}

#admin-flight-table tr:nth-child(odd) {
    background-color: #ffffff;
}

#admin-flight-table tr:nth-child(even) {
    background-color: #f4f8ff;
}

#admin-flight-table tr:hover {
    background-color: #e9f1ff;
}

#admin-flight-table .admin-actions-cell {
    display: flex;
    gap: 6px;
    justify-content: center;
}

#admin-flight-table .admin-inline-btn {
    padding: 7px 11px;
    margin: 0;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

#admin-flight-table .admin-inline-btn.delete {
    background-color: #c52c2c;
}

#admin-flight-table .admin-demo-toggle {
    transform: scale(1.15);
}

#admin-edit-feedback {
    margin-top: 8px;
    margin-bottom: 0;
}

#admin-unlock-modal .flight-row label,
#admin-edit-modal .flight-row label {
    min-width: 170px;
    font-weight: 600;
    color: #173f82;
}

#admin-unlock-modal .flight-row input,
#admin-edit-modal .flight-row input,
#admin-edit-modal .flight-row select {
    background: #ffffff;
    border: 1px solid #b9c8e3;
}

#admin-unlock-modal h1,
#admin-edit-modal h1 {
    margin: 0 0 12px 0;
    color: #0f377f;
    font-size: clamp(2rem, 4vw, 3rem);
    letter-spacing: 0.01em;
}

.admin-unlock-subtitle {
    margin: 0 0 20px 0;
    color: #184087;
    font-size: 1.05rem;
    font-weight: 500;
}

.admin-unlock-grid {
    gap: 14px;
}

.admin-unlock-hint,
.admin-unlock-feedback {
    margin: 10px 0 0 0;
}

#admin-edit-modal #admin-edit-flight-identity {
    margin: 0 0 20px 0;
    color: #184087;
    font-size: 1.12rem;
    font-weight: 500;
}

.admin-trim-section {
    margin-top: 14px;
    padding: 12px;
    border: 1px dashed #b9c8e3;
    border-radius: 10px;
    background: #f7faff;
}

.admin-trim-section .date-time {
    margin: 0 0 10px 0;
}

#admin-trim-button {
    margin-top: 4px;
}
  
/* Style the horizontal ruler */
hr {
    border: 1px solid #f1f1f1;
    margin-bottom: 25px;
}

/* The Modal Close Button (x) */
.close {
    position: absolute;
    right: 35px;
    top: 15px;
    font-size: 40px;
    font-weight: bold;
    color: #f1f1f1;
}

.close:hover,
.close:focus {
    color: #f44336;
    cursor: pointer;
}

/* Clear floats */
.clearfix::after {
    content: "";
    clear: both;
    display: table;
}

/* Change styles for cancel button and delete button on extra small screens */
@media screen and (max-width: 300px) {
    .cancelbtn, .deletebtn {
        width: 100%;
    }
}

/* Arduino Connection Styles */
#arduino-status {
    text-align: left;
    margin: 10px 0;
}

#arduino-status p {
    margin: 5px 0;
    font-size: 0.9rem;
}

#connection-status {
    font-weight: bold;
    color: #c52c2c;
}

#connection-status.connected {
    color: #4cd100;
}

#connection-status.connecting {
    color: #f7c783;
}

#data-status {
    color: #666;
}

#wifi-status {
    color: #666;
}

#wifi-status.offline {
    color: #c52c2c;
    font-weight: bold;
    animation: blink 1.5s infinite;
    font-size: 1.1em;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.4; }
}

/* Console/Terminal Styles */
#console-header {
    user-select: none;
    background: #f8f9fa;
    color: #0f377f;
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    border: 1px solid #e0e0e0;
    border-bottom: 1px solid #d0d0d0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#console-header:hover {
    background: #f1f3f4;
    border-color: #c0c0c0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
}

#console-header .console-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

#console-header .console-title::before {
    content: "\f120";
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 1.1rem;
    color: #0f377f;
}

.console-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.console-btn {
    background: rgba(15, 55, 127, 0.1);
    border: 1px solid rgba(15, 55, 127, 0.2);
    color: #0f377f;
    padding: 6px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    margin: 0;
}

.console-btn:hover {
    background: rgba(15, 55, 127, 0.2);
    border-color: rgba(15, 55, 127, 0.3);
    transform: translateY(-1px);
}

#console-toggle {
    transition: transform 0.3s ease;
    font-size: 1rem;
    color: #0f377f;
    opacity: 0.7;
}

#console-toggle.expanded {
    transform: rotate(180deg);
}

#console-panel {
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    border-top: none;
}

#console-output {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    color: #333;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.4;
    padding: 16px;
    height: 200px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    position: relative;
}

/* Console scrollbar styling */
#console-output::-webkit-scrollbar {
    width: 8px;
}

#console-output::-webkit-scrollbar-track {
    background: #f1f1f1;
}

#console-output::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

#console-output::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Console message types */
.console-line {
    margin: 4px 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.console-timestamp {
    color: #666;
    font-size: 0.8rem;
    min-width: 80px;
    flex-shrink: 0;
}

.console-error {
    color: #dc3545;
    font-weight: 500;
    background: rgba(220, 53, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid #dc3545;
    flex: 1;
}

.console-success {
    color: #28a745;
    font-weight: 500;
    background: rgba(40, 167, 69, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid #28a745;
    flex: 1;
}

.console-info {
    color: #0f377f;
    background: rgba(15, 55, 127, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid #0f377f;
    flex: 1;
}

.console-data {
    color: #fd7e14;
    background: rgba(253, 126, 20, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    border-left: 3px solid #fd7e14;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    flex: 1;
    word-break: break-all;
}

/* Offline Data Display Styles */
#offline-data-header {
    user-select: none;
    background: linear-gradient(135deg, #ffeaa7, #fdcb6e);
    color: #2d3436;
    padding: 12px 16px;
    cursor: pointer;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    border: 1px solid #fdcb6e;
    border-bottom: 1px solid #e17055;
    box-shadow: 0 1px 3px rgba(253, 203, 110, 0.3);
    margin-top: 10px;
}

#offline-data-header:hover {
    background: linear-gradient(135deg, #fdcb6e, #e17055);
    color: white;
    border-color: #e17055;
    box-shadow: 0 2px 5px rgba(253, 203, 110, 0.4);
}

.offline-data-title {
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-data-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

#offline-data-toggle {
    transition: transform 0.3s ease;
    font-size: 1rem;
    opacity: 0.8;
}

#offline-data-toggle.expanded {
    transform: rotate(180deg);
}

#offline-data-panel {
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #fdcb6e;
    border-top: none;
}

#offline-data-display {
    background: linear-gradient(135deg, #fff8e1, #fffbf0);
    color: #333;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
}

.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 8px;
    margin: 2px 0;
    background: rgba(253, 203, 110, 0.1);
    border-radius: 4px;
    border-left: 3px solid #fdcb6e;
}

.data-key {
    font-weight: 600;
    color: #0f377f;
    min-width: 150px;
}

.data-value {
    color: #2d3436;
    font-family: 'Courier New', monospace;
    text-align: right;
}




/* WiFi Overlay Styles */
.wifi-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.wifi-overlay-content {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    animation: wifiPulse 2s infinite;
}

.wifi-overlay-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: white;
    text-align: center;
}

.wifi-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
    animation: wifiIconPulse 1.5s infinite alternate;
}

.wifi-message h1 {
    font-size: 2rem;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.wifi-message p {
    font-size: 1.1rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.wifi-detail {
    font-size: 0.9rem !important;
    opacity: 0.7 !important;
    font-style: italic;
}

.wifi-close-btn {
    margin-top: 20px;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.wifi-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* WiFi Overlay Sensor Data */
.wifi-overlay-data {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.wifi-overlay-data h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
    text-align: center;
}

.wifi-sensor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
}

.sensor-item {
    background: rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sensor-timestamp {
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.8;
    font-style: italic;
}

.wifi-button-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.wifi-data-btn {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.wifi-data-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

@keyframes wifiPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes wifiIconPulse {
    0% { opacity: 0.3; }
    100% { opacity: 0.7; }
}

/* Responsive design for smaller screens */
@media screen and (max-width: 600px) {
    .status-card {
        padding: 18px;
    }

    .status-main {
        min-height: auto;
        align-items: stretch;
        flex-direction: column;
        gap: 0.9rem;
    }

    .status-speed-group {
        position: static;
        transform: none;
        align-items: flex-start;
        text-align: left;
    }

    .status-date-group {
        position: static;
        transform: none;
        align-items: flex-start;
        text-align: left;
    }

    .status-meta {
        grid-template-columns: 1fr;
        justify-items: start;
        gap: 6px;
    }

    .status-meta > span:nth-child(1),
    .status-meta > span:nth-child(2),
    .status-meta > span:nth-child(3) {
        justify-self: start;
    }

    .status-meta {
        font-size: 0.82rem;
    }

    .chart-container {
        min-height: 280px;
    }

    .chart-controls-row {
        flex-wrap: wrap;
        justify-content: space-between;
    }

    .wifi-overlay-content {
        width: 95%;
        margin: 20px;
    }
    
    .wifi-overlay-body {
        padding: 30px 20px;
    }
    
    .wifi-icon {
        font-size: 3rem;
    }
    
    .wifi-message h1 {
        font-size: 1.5rem;
    }
    
    .wifi-message p {
        font-size: 1rem;
    }
}

@media screen and (max-width: 768px) {
    .cards {
        width: 100%;
        padding: 0 12px;
        grid-template-columns: minmax(0, 1fr);
        grid-gap: 1rem;
    }

    .card {
        padding: 20px 16px;
    }

    .time-range-container,
    .flight-row {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
    }

    .time-range-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .time-range-container label,
    .flight-row label {
        width: 100%;
        min-width: 0;
        text-align: left;
    }

    .time-range-container input[type=datetime-local],
    .time-range-field,
    .time-range-actions,
    .time-range-actions button,
    .flight-row input[type=text],
    .flight-row input[type=datetime-local],
    .flight-row select,
    .flight-row button {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .time-range-field input[type=datetime-local] {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-inline-size: 0;
        max-inline-size: 100%;
        display: block;
        padding: 12px 14px;
        font-size: 16px;
    }

    .action-button-row {
        width: 100%;
        padding: 0 12px;
        justify-content: stretch;
    }

    .action-button-row button {
        width: 100%;
        min-width: 0;
    }

    .flight-export-row {
        flex-direction: column;
        align-items: stretch;
        justify-content: stretch;
        flex-basis: 100%;
    }

    .flight-export-row button {
        width: 100%;
        min-width: 0;
    }

    .chart-container {
        min-height: 260px;
    }

    #admin-unlock-modal,
    #admin-modal,
    #admin-edit-modal {
        padding: 12px;
        align-items: flex-start;
    }

    .admin-unlock-modal-content,
    .admin-modal-content,
    .admin-edit-modal-content {
        width: 100%;
        max-height: calc(100dvh - 24px);
    }

    #admin-unlock-modal .container,
    #admin-modal .container,
    #admin-edit-modal .container {
        padding: 18px 14px 22px;
    }

    .admin-header-row {
        position: sticky;
        top: 0;
        z-index: 1;
        padding-bottom: 10px;
        background: linear-gradient(170deg, #f9fbff 0%, #eef4ff 100%);
    }

    .admin-upload-row,
    .admin-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .admin-upload-row input[type=text],
    .admin-upload-row input[type=date],
    .admin-upload-row input[type=file],
    .admin-upload-row button,
    .admin-filter-row input[type=text],
    .admin-filter-row select,
    .admin-filter-row button,
    .admin-demo-only-label {
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .admin-demo-only-label {
        justify-content: flex-start;
    }

    .admin-table-wrapper {
        width: 100%;
        max-height: 52vh;
    }
}

/*end of style.css
