* {
    margin: 5px;
    box-sizing: border-box;
}

body {
    height: 95vh;
    background-color: white;
    font-family: 'Geomanist';
    text-align: center;
    color: black;
    font-size: 24px;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
header {
    background: #151f42;
    margin-top: 0;
    padding: 1.5em 0;
    height: 200px; /* Increased to 200px */
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}



.main-header h1 {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    height: 100%;
    display: flex;
    align-items: center;
}

.header-logo {
    max-height: 140px; /* Increased from 100px */
    width: auto;
    object-fit: contain;
}

/* Login Page Styles */
.login-container {
    max-width: 300px;
    margin: 0 auto;
    text-align: center;
}

.number-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.num-btn {
    transition: all 0.2s ease;
    padding: 15px;
    font-size: 18px;
    cursor: pointer;
}

#pin-display {
    font-size: 24px;
    margin-bottom: 20px;
    letter-spacing: 5px;
}

.login-logo.small-logo {
    width: 200px !important;
    height: auto !important;
    max-width: 200px !important;
    max-height: 200px !important;
}

.num-btn:hover {
    background-color: #e0e0e0;
    cursor: pointer;
}

.num-btn:active {
    background-color: #c0c0c0;
}

/* User Info Styles */
.user-info {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: auto;
    font-size: 0.8em;
    font-family: 'Geomanist';
    color: white;
}

.user-info a {
    color: black;
    text-decoration: none;
    border: 1px solid black;
}

.btn {
    border: 1px solid black;
    padding: 5px 10px;
    border-radius: 3px;
    text-decoration: none;
    display: inline-block;
}

.btn-danger {
    background-color: #0074d9;
    color: white;
}

.btn-primary {
    background-color: #151f42;
    color: white;
}

/* Header2 Styles */
header2 {
    width: 100%;
    display: block;
    background: #Cb6ce6;
    border: 1px solid black;
}

.header2 {
    width: 100%;
    background: linear-gradient(#4568dc, #b06ab3);
}

.info-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.patient-details {
    display: inline-block;
    text-align: center;
}

.Patient-info-title {
    display: inline-block;
    vertical-align: middle;
}

.patient-info {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 8px;
    margin: 0 5px;
    border-radius: 4px;
    vertical-align: middle;
}

.patient-info .label {
    font-weight: bold;
    color: #555;
}

.patient-info .value {
    color: black;
}

.patient-info:hover {
    background-color: #e9ecef;
    transition: background-color 0.3s ease;
}

.label, .value {
    display: inline;
}

.patient-input-boxes {
    border: solid black;    
}

.main {
    display: flex;
    flex: 1;
    flex-wrap: wrap;
    padding: 0;
    margin-top: 0;
}

.menu-icon {
    color: white;
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.menu-icon:hover {
    color: #007bff;
}
    
.left {
    position: relative;
}
    
.dropdown-menu {
    display: none;
    position: absolute;
    top: -100px;
    left: 10px;
    background-color: #ffffff;
    min-width: 200px;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 9999;  /* Added higher z-index */
    overflow: hidden;
    transition: all 0.3s ease;
    border: solid black;
}
    
.dropdown-menu a {
    color: #333;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease;
    border: solid black;
    background: linear-gradient(#4568dc , #b06ab3);
}
    
.dropdown-menu a:hover {
    background-color: #f5f5f5;
}

main {
    background: linear-gradient(#4568dc , #b06ab3);
    padding: 3em 0;
    flex: 5 5 150px;
    padding: 0px;
}

main2 {
    background: linear-gradient(#4568dc , #b06ab3);
    padding: 0px;
    margin: 0px;
    width: 100%;
}

.main2 {
    background: pink;
    padding: 0px;
    flex: 1 1 100%;
    margin-top: 0px;
    border: 1px;
}

.right {
    background: pink;
    padding: 3em 0 3em 0;
    flex: 1 1 100px
}

footer {
    background: linear-gradient(#4568dc , #b06ab3);
    padding: 1em 0 1em 0;
    border: solid black;
}

@media screen and (min-width: 768px) {
    body {
        font-size: 18px;
    }
    
    .main {
        flex-direction: row;
    }
}

@media screen and (min-width: 1024px) {
    body {
        font-size: 24px;
    }
}

.sub-menu-title {
    color: white;
    font-size: 16px;
    font-family: 'Geomanist';
    padding: 5px 10px;
    width: 100%;
    margin: 5px auto;
}

.patient_input_container {
    position: relative;
}

/* Replace with these updated grid styles */
.button-group {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(120px, 1fr)) !important;
    gap: 1px;
    padding: 10px;
    max-width: 1600px;
    margin: 0 auto;
    grid-auto-flow: row;
    grid-auto-rows: 60px;
}

* {
    margin: 2px; /* Reduced from 5px */
    box-sizing: border-box;
}

.sub-menu, .sub-sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    z-index: 10;
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.sub-button, .sub-sub-button {
    background-color: #008CBA;
    color: white;
    font-size: 20px;
    font-family: 'Geomanist';
    border-radius: 5px;
    cursor: pointer;
    margin: 5px 0;
    width: 100%;
    padding: 10px;
}
.transcript-title {
    background: linear-gradient(#4568dc , #b06ab3);
    font-size: 20px;
    font-family: 'Geomanist';
    font-weight: bold;
    color: #333;
    text-align: center;
    padding: 10px 0;
    z-index: 100;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px auto;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
}

th, td {
    border: 1px solid black;
    padding: 15px;
    text-align: left;
    vertical-align: middle;
    font-size: 18px;
}

th {
    background-color: #0074d9;
    color: white;
    font-weight: bold;
    text-transform: uppercase;
}

tr:nth-child(even) {
    background-color: rgb(31, 172, 228);
}

tr:nth-child(odd) {
    background-color: rgb(21, 150, 200);
}

.total-blood-loss {
    font-size: 30px;
    color: #c81f46;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
}

.delete-button:hover, .Back-Button:hover {
    background-color: #ff1a1a;
}

.small-input {
    width: 100px;
    height: 30px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
}

.large-input {
    width: 120px;
    padding: 5px;
    font-size: 14px;
}
    
.submit-button {
    height: 30px;
    padding: 0 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #008CBA;
    cursor: pointer;
}

.nav-links {
    list-style: none;
    padding: 0;
    display: flex;
    justify-content: space-between;
}

.nav-links li a {
    color: #333;
    text-decoration: none;
    padding: 10px;
    transition: color 0.3s ease;
}

.nav-links li a:hover {
    color: #007bff;
}

.output-container {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.total-blood-loss, .meows-info, .result-box {
    margin: 0 20px;
    padding: 10px;
    border: 2px solid #333;
    border-radius: 5px;
    background-color: #f0f0f0;
    transition: background-color 0.3s ease;
}

.total-blood-loss h3, .meows-info h3, .result-box h3 {
    margin: 0;
    font-size: 18px;
    color: #333;
}

.result-box {
    transition: background-color 0.3s ease;
}

.result-box.warning {
    background-color: orange;
    color: white;
    border-color: darkorange;
}

.result-box.danger {
    background-color: red;
    color: white;
    border-color: darkred;
}

.result-box.alert,
.total-blood-loss.alert,
.meows-info.alert {
    background-color: red;
    color: white;
    border-color: darkred;
}
  .input-group {
      display: flex;
      flex-direction: column;
      gap: 10px;
      margin-bottom: 15px;
      width: 100%;
  }

  .input-group label {
      font-weight: bold;
      margin-bottom: 5px;
  }

  .input-group select {
      width: 100%;
      padding: 8px;
      margin-bottom: 10px;
  }

  .input-group input {
      width: 100%;
      padding: 8px;
  }

  .submit-btn {
      width: 100%;
      padding: 8px;
      margin-top: 5px;
  }
.hemocue-container,
.blood-gas-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.hemocue-container .small-input,
.blood-gas-container .small-input {
    width: 100px;
    height: 30px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.hemocue-container .unit,
.blood-gas-container select {
    height: 30px;
    width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.hemocue-container input,
.blood-gas-container input,
.blood-gas-container select {
    width: 120px;
    margin-right: 5px;
}

.blood-gas-container select {
    background-color: white;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 25px;
    background-image: url('data:image/svg+xml;utf8,<svg fill="black" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position: right 5px top 50%;
    background-size: 16px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    transition: opacity 0.3s ease;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 5px;
    width: 70%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.close:hover {
    color: #000;
}

.changes-container {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.old-data, .new-data {
    width: 45%;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

pre {
    margin: 0;
    white-space: pre-wrap;
    font-family: monospace;
}

.patient-input-boxes .input-group form input[type="text"] {
    padding: 12px 20px !important;
    font-size: 16px !important;
    width: 300px !important;
    height: 45px !important;
    border-radius: 4px !important;
    border: 1px solid #ccc !important;
}

.patient-input-boxes .input-group form input[type="submit"] {
    padding: 12px 24px !important;
    font-size: 16px !important;
    height: 45px !important;
    min-width: 150px !important;
    border-radius: 4px !important;
    background-color: #4CAF50 !important;
    color: white !important;
    border: none !important;
    cursor: pointer !important;
}

.alert-danger-custom {
    width: 80%;
    max-width: 800px;
    margin: 50px auto;
    padding: 30px;
    background-color: #ffebee;
    border: 3px solid #ff0000;
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    text-align: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.alert-heading-custom {
    color: #d32f2f;
    font-weight: bold;
    font-size: 1.5em;
    margin-bottom: 20px;
}

.alert-text-custom {
    color: #d32f2f;
    font-size: 1.2em;
    line-height: 1.6;
    margin-bottom: 25px;
}

.main-menu-link {
    display: inline-block;
    margin: 10px 15px;
    padding: 10px 20px;
    background-color: #d32f2f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.main-menu-link:hover {
    background-color: #b71c1c;
}

.sub-menu.stay-open {
    display: block !important;
}

const styles = `
    .loading-spinner {
        display: inline-block;
        width: 12px;
        height: 12px;
        border: 2px solid #ffffff;
        border-radius: 50%;
        border-top-color: transparent;
        animation: spin 1s linear infinite;
        margin-right: 5px;
    }
    
    @keyframes spin {
        to {transform: rotate(360deg);}
    }
    
    .popup-btn.success {
        background-color: #4CAF50 !important;
    }
    
    .popup-btn.error {
        background-color: #f44336 !important;
    }
`;

.button-group .category-btn {
    width: 35%;
    height: 35%;
    margin: 0;
    padding: 2px;
    font-size: 0.8em;
    background: White;
    color: Black;
    border: 3px solid black !important;
    border-radius: 15px !important;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}


.category-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Status Grid Layout */
.status-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 10px auto;
    max-width: 800px;
}

.status-box {
    background: white;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    border: 2px solid black;
}

.status-box:hover {
    transform: translateY(-2px);
}

.status-box h3 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 0.9em;
    font-weight: bold;
}

.status-box p {
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: bold;
    margin: 0;
}
  /* Status Box States */
  .status-box.alert {
      background-color: red !important;
      border: 2px solid black;
      border-left: 4px solid #ff5252;
      color: #d32f2f;
      transition: background-color 0.3s ease;
  }

  .status-box.warning {
      background-color: #ffa726 !important;
      border: 2px solid black;
      border-left: 4px solid #ffa726;
      color: #f57c00;
  }

  .status-box.danger {
      background-color: #ff0000 !important;
      border: 2px solid #d50000;
      color: white;
  }

/* Sub Menu Styling */
.popup-button-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    padding: 10px;
}

.popup-btn {
    padding: 15px;
    font-size: 1.1em;
    font-weight: bold;
    background: linear-gradient(#4568dc, #b06ab3);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 60px;
}

.popup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Sub-sub Menu Styling */
.sub-sub-menu .popup-btn {
    font-size: 1em;
    padding: 12px;
    min-height: 50px;
}

/* Category Popup Customization */
.category-popup {
    padding: 20px;
    border-radius: 10px;
}

/* Replace old container styles with this */
.button-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}

.ebl-button-container, .observation-button-container {
    position: relative;
    z-index: 1000;
}

.small-input {
    position: relative;
    z-index: 1001;
    cursor: text;
}

form {
    position: relative;
    z-index: 1000;
}