/* General Body Styling */
body {
    background-color: #f3f4f6; /* Use a light shade inspired by the logo */
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden; /* Prevent scrollbars */
}

/* Login Container */
.login-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
}

/* Login Card Styling */
.login-card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15); /* Enhance the shadow for prominence */
    text-align: center;
    z-index: 1;
    position: relative;
}

.logo-login {
    max-width: 150px;
    margin: 0 auto 20px;
    display: block;
}

.login-title {
    font-size: 24px;
    font-weight: bold;
    color: #ff6f61; /* Primary color from the logo */
    margin-bottom: 5px;
}

.login-subtitle {
    font-size: 14px;
    color: #7d7d7d;
    margin-bottom: 20px;
}

.input-group-text {
    background-color: #ff6f61; /* Primary color from the logo */
    color: white;
    border: none;
}

.btn-primary {
    background-color: #ff6f61;
    border: none;
    font-size: 1.2rem;
    padding: 0.75rem; /* ~12px */
    transition: background-color 0.3s ease;
}

.btn-primary:hover {
    background-color: #ff4c4c;
}

.error-message {
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
}

/* Remember Device Checkbox Styling */
.remember-device-container {
    padding: 0;
}

.remember-device-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
    margin: 0;
    gap: 12px;
}

.remember-device-checkbox {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    flex-shrink: 0;
    transition: all 0.2s ease;
    background-color: white;
}

.remember-device-checkbox:hover {
    border-color: #ff6f61;
}

.remember-device-checkbox:focus {
    outline: none;
    border-color: #ff6f61;
    box-shadow: 0 0 0 3px rgba(255, 111, 97, 0.15);
}

.remember-device-checkbox:checked {
    background-color: #ff6f61;
    border-color: #ff6f61;
}

.remember-device-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.remember-device-text {
    font-size: 14px;
    color: #7d7d7d;
    line-height: 1.4;
}
/* ========================
   TOP NAVIGATION
   ======================== */
   .top-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    position: absolute;
    top: 0;
    width: 100%;
    z-index: 2;
  }

  .logo-portal {
    max-width: 10%;
    min-width: 6.25rem; /* ~100px */
    margin-left: -1.25rem; /* ~-20px */
  }
  
  .logout-form .btn-danger {
    background-color: #d9534f;
    border: none;
    padding: 0.5rem 0.94rem; /* ~8px and ~15px */
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-right: -1.25rem;  /* ~-20px */
    margin-top: -4.4rem;     /* ~-70px */
  }
  
  .logout-form .btn-danger:hover {
    background-color: #c9302c;
  }
  
  /* ========================
     PORTAL CONTAINER & CARDS
     ======================== */
  .portal-container {
    width: 90%;
    margin: 5% auto;
    text-align: center;
    position: relative;
    padding-top: 1.25rem; /* ~20px */
    padding-bottom: 5%;
    z-index: 1;
  }
  
  .portal-card {
    background: white;
    border-radius: 1rem;  /* ~15px */
    padding: 3%;
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.1); /* ~10px and ~20px */
    position: relative;
    max-width: 50%;
    min-width: 18.75rem;  /* ~300px */
    margin: 0 auto;
    z-index: 1;
  }
  
  .response-container-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 2% auto 2% auto;
    z-index: 1;
  }
  
  .response-card {
    background: white;
    border-radius: 1rem;
    padding: 3%;
    box-shadow: 0 0.625rem 1.25rem rgba(0, 0, 0, 0.1);
    max-width: 90%;
    width: 90%;
    position: relative;
    margin: 0 auto;
    text-align: center;
    z-index: 1;
  }
  
  /* ========================
     TITLES & TEXT
     ======================== */
  .portal-title {
    font-size: 2rem;
    font-weight: bold;
    color: #ff6f61;
    margin-bottom: 1.25rem; /* ~20px */
  }
  
  .response-title {
    font-size: 1.8rem;
    font-weight: bold;
    color: #ff6f61;
    margin-bottom: 1rem; /* ~15px */
  }
  
  /* ========================
     FORM & BUTTONS
     ======================== */
  .form-control {
    border-radius: 0.3125rem; /* ~5px */
    border: 0.0625rem solid #ddd; /* ~1px */
    font-size: 1rem;
    padding: 0.625rem; /* ~10px */
}

.form-control:focus {
    outline: none;
    box-shadow: 0 0 0.3125rem rgba(255, 111, 97, 0.5); /* ~5px */
    border-color: #ff6f61;
  }
  
  .btn-primary {
    background-color: #ff6f61;
    border: none;
    font-size: 1.2rem;
    padding: 0.75rem; /* ~12px */
    transition: background-color 0.3s ease;
  }
  
  .btn-primary:hover {
    background-color: #ff4c4c;
}

/* ========================
   RESPONSE BOX
   ======================== */
.response-box {
    background: #eef2f7;
    padding: 2%;
    border-radius: 0.3125rem; /* ~5px */
    border: 0.0625rem solid #ddd; /* ~1px */
    width: 100%;
    overflow-x: auto;
}

/* Custom styling for vertical tables */
.vertical-table {
    table-layout: auto; /* Allows flexibility in column widths */
    width: 100%;
    border-collapse: collapse; /* Ensures borders are collapsed for a cleaner look */
}

/* Header Styling */
.vertical-table thead th {
    background-color: #ff6f61; /* Match "Record Found" Card heading color */
    font-family: Arial, sans-serif; /* Match body font or "Record Found" Card heading font */
    color: white; /* Contrast color for readability */
    font-weight: bold;
    text-align: center;
    padding: 0.75rem;
    border: 1px solid #dee2e6; /* Consistent border */
}

/* Data Cells Styling */
.vertical-table tbody td {
    text-align: center;
    padding: 0.75rem;
    border: 1px solid #dee2e6; /* Consistent border */
    word-wrap: break-word; /* Allow wrapping if needed */
}

/* Adjust Specific Column Widths */
.vertical-table th:nth-child(1),
.vertical-table td:nth-child(1) {
    width: 25%; /* Event Type */
}

.vertical-table th:nth-child(2),
.vertical-table td:nth-child(2) {
    width: 15%; /* Risk Tier */
}

.vertical-table th:nth-child(3),
.vertical-table td:nth-child(3) {
    width: 20%; /* Risk Level */
}

.vertical-table th:nth-child(4),
.vertical-table td:nth-child(4) {
    width: 40%; /* Details */
}

/* Highlighting the Event Type cell based on Very High risk profile */
.vertical-table td.risk-very-high {
    background-color: rgba(255, 0, 0, 0.2); /* Transparent Red */
    color: #b22222; /* FireBrick for better readability */
    border: 1px solid #dee2e6; /* Ensure border matches other cells */
}

/* Highlighting Risk Levels with transparency */
.vertical-table td.risk-high {
    background-color: rgba(255, 76, 76, 0.3); /* Light Red for high risk */
    color: #ff0000; /* Dark Red text for readability */
}

.vertical-table td.risk-moderate {
    background-color: rgba(255, 235, 59, 0.3); /* Light Yellow for moderate risk */
    color: #856404; /* Dark Yellow/Brown text for readability */
}

.vertical-table td.risk-low {
    background-color: rgba(76, 175, 80, 0.3); /* Light Green for low risk */
    color: #1b5e20; /* Dark Green text for readability */
}

/* Remove Temporary Blue Border */
.vertical-table th {
    /* border: 2px solid blue; */ /* Commented out to remove blue border */
}

/* Highlighting the third column based on risk profile with transparency */
.vertical-table tr:hover td.risk-high,
.vertical-table tr:hover td.risk-moderate,
.vertical-table tr:hover td.risk-low {
    opacity: 0.8; /* Slightly reduce opacity on hover */
}

/* Highlighting the first column based on Very High risk profile */
.vertical-table th.risk-very-high {
    background-color: rgba(255, 0, 0, 0.2); /* Transparent Red */
    /* Optional: Adjust text color for better readability */
    color: #b22222; /* FireBrick */
}

@media (max-width: 768px) {
    .vertical-table thead {
        display: none; /* Hide headers on small screens */
    }

    .vertical-table, .vertical-table tbody, .vertical-table tr, .vertical-table td {
        display: block;
        width: 100%;
    }

    .vertical-table tr {
        margin-bottom: 1rem;
    }

    .vertical-table td {
        text-align: left;
        padding-left: 50%;
        position: relative;
    }

    .vertical-table td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 45%;
        padding-left: 0.75rem;
        font-weight: bold;
        white-space: nowrap;
    }
}

/* Additional Styles for the Input Form */
.portal-container {
    padding: 2rem;
}

.portal-card {
    max-width: 800px;
    margin: 0 auto;
}

.portal-title {
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Adjusting the timestamp input fields to align properly */
#portal-form .row.g-2 .col input {
    width: 100%;
    height: 100%;
}

/* Ensuring all timestamp fields have consistent height */
#portal-form .row.g-2 .col input {
    height: 100%;
}

/* ========================
   ENVIRONMENT TOGGLE
   ======================== */
.form-check.form-switch {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0;
}

.form-check.form-switch .form-check-input {
  width: 2.5em;
  height: 1.25em;
  margin-right: 0.5em;
  margin-top: 0;
  cursor: pointer;
  flex-shrink: 0;
}

.form-check.form-switch .form-check-label {
  font-weight: 500;
  cursor: pointer;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  white-space: nowrap;
}

#environment-label {
  font-weight: bold;
  color: #ff6f61;
}

.form-check.form-switch .form-check-input:checked {
  background-color: #20c997;
  border-color: #20c997;
}

.form-check.form-switch .form-check-input:not(:checked) {
  background-color: #ff6f61;
  border-color: #ff6f61;
}

/* ========================
   SHARED FORM STYLES
   ======================== */

/* Form Labels - consistent across all forms */
.form-label {
  font-weight: 500;
  color: #555;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  display: block;
  text-align: left;
}

/* Invalid Feedback Messages */
.invalid-feedback {
  display: none;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: #dc3545;
  text-align: left;
}

/* Show invalid feedback when form is validated or field has error */
.was-validated .form-control:invalid ~ .invalid-feedback,
.form-control.is-invalid ~ .invalid-feedback {
  display: block;
}

/* Invalid form control styling */
.form-control.is-invalid {
  border-color: #dc3545;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23dc3545' stroke='none'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* Valid form control styling */
.form-control.is-valid {
  border-color: #198754;
  padding-right: calc(1.5em + 0.75rem);
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%23198754' d='M2.3 6.73.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right calc(0.375em + 0.1875rem) center;
  background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

/* ========================
   PLACEHOLDER STYLING
   ======================== */
/* Lighter placeholder text for all form inputs */
.form-control::placeholder {
  color: #bbb;
  opacity: 1;
}

.form-control::-webkit-input-placeholder {
  color: #bbb;
  opacity: 1;
}

.form-control::-moz-placeholder {
  color: #bbb;
  opacity: 1;
}

.form-control:-ms-input-placeholder {
  color: #bbb;
  opacity: 1;
}

/* ========================
   LOCATION PERMISSION MODAL
   ======================== */
.location-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(3px);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10vh;
  z-index: 9999;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.location-modal {
  background: white;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  text-align: center;
  animation: slideUp 0.3s ease;
}

.location-modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.location-modal-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 12px;
}

.location-modal-text {
  font-size: 15px;
  color: #666;
  margin-bottom: 20px;
  line-height: 1.5;
}

.location-modal-benefits {
  list-style: none;
  padding: 0;
  margin: 0 0 24px 0;
  text-align: left;
}

.location-modal-benefits li {
  font-size: 14px;
  color: #555;
  padding: 8px 0;
  border-bottom: 1px solid #f0f0f0;
}

.location-modal-benefits li:last-child {
  border-bottom: none;
}

.location-modal-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.location-modal-buttons .btn {
  flex: 1;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.location-modal-buttons .btn-primary {
  background: linear-gradient(135deg, #ff6f61 0%, #ff4c4c 100%);
  border: none;
  color: white;
}

.location-modal-buttons .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 111, 97, 0.4);
}

.location-modal-buttons .btn-outline-secondary {
  background: transparent;
  border: 2px solid #ddd;
  color: #666;
}

.location-modal-buttons .btn-outline-secondary:hover {
  background: #f5f5f5;
  border-color: #ccc;
}

.location-modal-note {
  margin: 0;
  color: #999;
}

.location-modal-note small {
  font-size: 12px;
}