body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

.container {
    width: 80%;
    margin: auto;
    /* overflow: hidden; */
}

/* Override Leaflet defaults */
.leaflet-popup-content {
    margin: 10px 4px 10px 4px;
}

button {
    margin-top:5px;
    height:25px;
}

header {
    background-color: #333;
    color: #fff;
    padding-top: 30px;
    min-height: 70px;
    border-bottom: #00bf63 3px solid;
}

header .logo img {
    height: 50px;
    float: left;
}

header .container {
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}


header nav {
    float: right;
    margin-top: 10px;
}

header nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

header nav ul li {
    display: inline;
    margin-left: 20px;
}

header nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

nav {
    position: relative;
}

.dropdown-toggle {
    background-color: #333;
    color: #fff;
    padding: 0px 5px 10px 70px;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    margin-bottom:5px;
}

.dropdown-menu {
    display: none;
    position: absolute;
    background-color: #444;
    padding: 10px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    z-index: 10000; /* Increase to a very high value */
    width: 120px; /* Set a fixed width */
    border-radius: 5px;
    right: 0; /* Align to the right edge of the container */
}

.dropdown-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
    text-align: left;
}

.dropdown-menu li {
    padding: 8px 0;
    line-height: 1;
}

.dropdown-menu li a {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: normal;
    padding: 5px 10px;
    display: block;
    transition: background-color 0.3s;
}

.dropdown-menu li a:hover {
    background-color: #555;
    border-radius: 3px;
}


/* Show the dropdown menu when the button is clicked */
nav.active .dropdown-menu {
    display: block !important;
}


main {
    flex: 1;
}

main h1,h2 {
    color: #0779e4;
    clear: both;
    padding-top:10px;
    margin: 10px 0 5px 0;

}

.badge {
    background-color: #007bff; /* Adjust color as needed */
    color: white;
    padding: 2px 6px;
    font-size: 0.7em;
    border-radius: 4px;
    margin-left: 8px; /* Adjust spacing as needed */
}


main h3 {
    clear: both;


}

main a{
    text-decoration: none;
}

main img {
    max-width: 100%;
    width: auto;
    max-height: 300px; /* Adjust this value as needed */
    height: auto;
    display: block;
    margin: 0 auto;
    float:none; /* Add this to left-justify */
    padding-bottom: 20px;
}

main .topimage img {
    margin-top:20px;

}

main .container {
    max-width: 900px;
    width: 90%;
    margin: 0 auto;
    padding: 0px;
    box-sizing: border-box;
}

main p, li {

    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px; /* Adjust as needed */
    line-height: 1.5; /* For readability */
    color: #333; /* Matches typical text color */    

}

main .stats-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    background-color: #ffffff;
}

main .stats-table th,
main .stats-table td {
    text-align: left;
    padding: 8px 12px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.stats-table .leftheader {
    font-weight: bold;
    background-color: #f8f8f8;
    color: #3b3b3b;

}

.tooltip-note {
  font-size: 0.9em;
  color: #aaa;
  margin-top: -4px;
}



footer {
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 1px solid #444;
    font-size: 14px;
}

footer nav ul {
    list-style: none;
    padding: 0;
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

footer nav ul li {
    display: inline;
}

footer nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: normal;
    transition: color 0.3s;
    font-size:14px;
}

footer nav ul li a:hover {
    color: #00bf63;
}


form {
  display: flex;
  flex-direction: column;    
  width: 100%;
  max-width: 100%; /* override previous max-width if set */
  box-sizing: border-box;  
  background: #fff;
  border-radius: 10px;
  padding: 2em;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin-top: 1em;
  font-family: inherit;
}


form label {
  display: block;
  font-weight: 600;
  margin: 1em 0 0.3em;
}

form input,
form textarea {
  width: 100%;
  padding: 0.6em 0.8em;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  font-family: inherit;
  box-sizing: border-box;
}

form button {
  display: inline-block;
  padding: 0.6em 1.2em;
  line-height: 0; /* key line */
  height:2em;
  font-size: 1em;
  font-weight: 600;
  background-color: #0072ce;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  vertical-align: middle;
}

form button:hover {
  background-color: #005aa0;
}

.g-recaptcha {
  margin-top: 1em;
  margin-bottom: 1em;
}


#map {
    height: 600px;
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
  }
  .filter-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
  }
  


#dashboard {
    display: flex;
    height: 100vh;
}

  
#alert-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border: red;
}

#filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

select,input {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    max-width: 220px;
}

#alert-list-container {
    max-height: 300px; /* Adjust this value as needed */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#country-isp-list-container {
    /* max-height: 300px; Adjust this value as needed */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#alert-list {
    width: 100%;
    /* border-collapse: collapse; */
}

#alert-list th,
#alert-list td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

#alert-list th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #3b3b3b;
    position: sticky;
    top: 0;
    z-index: 10;
}

#alert-list td {
    background-color: #ffffff;

}

#isp-table-container {
    max-height: 300px; /* Adjust this value as needed */
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
}

#isp-table,#country-isp-table {
    width: 100%;
    /* border-collapse: collapse; */
}

#isp-table th,
#isp-table td,
#country-isp-table th,
#country-isp-table td {
    padding: 10px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

#isp-table th,#country-isp-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    color: #3b3b3b;
    position: sticky;
    top: 0;
    z-index: 10;
}

#isp-table td,#country-isp-table td {
    background-color: #ffffff;
}



#alert-list tbody .alert-for-user-ip {
    background-color: #ffdcdc !important;
}

#alert-list tbody .alert-for-user-ip td {
    background-color: #ffdcdc !important;
}

/* #alert-list tbody tr:hover {
    background-color: #f5f5f5;
} */


#stats-panel {
    flex: 1;
    padding: 20px;
    background-color: #ffffff;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
}


#user-metadata-control {
    color: white !important; /* Force the text to be white */
    font-weight: bold !important; /* Ensure the text is bold */
    font-size: 8pt; /* Set the font size */
    line-height: 1; /* Reduce the line spacing */
    text-align: right; /* Right-align the text */
    padding: 5px; /* Add padding for spacing */
    background-color: rgba(0, 0, 0, 0.5); /* Optional: Add a semi-transparent background for visibility */
}

#user-metadata-control p {
    margin: 0 !important; /* Remove any default margin */
    color: white !important; /* Ensure the color remains white */
    font-size: 8pt !important; /* Ensure the font size matches */
    line-height: 1.3 !important; /* Set the desired line height */
    font-weight: bold !important; /* Ensure the text is bold */
}

.dropdown-and-links {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px; /* Adds spacing below the dropdown and links */
}

.anchor-links {
    font-size: 0.9rem;
    white-space: nowrap;
}

.anchor-links a {
    text-decoration: none;
    color: #007BFF;
    margin-left: 10px;
}

.anchor-links a:hover {
    text-decoration: underline;
}

#histogram-container {
    margin: 0px;
  }
  
#filter-input {
margin-bottom: 10px;
padding: 5px;
width: 80%;
max-width: 400px;
}

#outage-histogram {
width: 100%;
max-height: 500px;
}

.autocomplete-suggestions {
    position: absolute;
    background-color: #fff;
    /* border: 1px solid #ccc; */
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    width: 400px; /* Match input width with small border correction */
    box-sizing: border-box; /* Ensures width includes padding and border */
}

.suggestion-item {
    padding: 8px 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background-color: #f0f0f0;
}

.no-suggestions {
    padding: 8px 10px;
    color: #888;
    font-style: italic;
}

.date-range {
    color: #666; /* Softer gray for a subtle appearance */
    font-size: 0.95em; /* Slightly smaller than the main text */
    font-weight: normal; /* Make it consistent with other text */
    margin: 0 0 15px 0; /* Add spacing below the date range */
    text-align: left; /* Align with the section title */
    padding-left: 10px; /* Add a little padding for alignment */
    background-color: #f9f9f9; /* Light background to make it distinct */
    border-left: 4px solid #007bff; /* Blue border for visual emphasis */
    padding: 5px 10px; /* Space around the text for better readability */
    border-radius: 3px; /* Slight rounding for a polished look */
}

.highlight-bottom {
    background-color: #d4edda; /* Light green */
    color: #155724; /* Dark green text */
    font-weight: bold;
}

.highlight-top {
    background-color: #f8d7da; /* Light red */
    color: #721c24; /* Dark red text */
    font-weight: bold;
}



.features-grid {
    display: grid;
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
    margin-top: 20px;
}

/* Desktop - 2 x 3 Grid */
@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr 1fr; /* 2 columns */
    }
}

.feature-item {
    display: flex;
    align-items: center;
    padding: 14px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
    border-radius: 8px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.feature-item img {
    width: auto;
    height: auto;
    margin-right: 15px;
}

.feature-item h3 {
    font-size: 20px;
    color: #007BFF;
    margin: 0 0 5px 0;
    font-weight: bold;
}

.feature-item p {
    font-size: 16px;
    color: #555;
    margin: 0;
}


/* Default table styling for larger screens remains unchanged */
@media (max-width: 768px) {
    /* Make the table responsive for smaller screens */


    section label,
    section select,
    section input {
        display: block;
        width: 100%; /* Make them full-width */
        margin: 5px 0; /* Add some vertical spacing */
    }

    select,input{
        font-size:16px;
    }

    #histogram-container {
        width: 100%; /* Make the container responsive */
        justify-content: center; /* Center align on mobile */
    }

    #outage-histogram {
        width: 100%;
        max-height: 500px;
        margin-bottom:20px;
    }

    canvas {
        max-width: 100%; /* Ensure the canvas doesn't exceed container width */
        height: auto; /* Maintain aspect ratio */
    }
    
    #alert-list, #alert-list thead, #alert-list tbody, #alert-list th, #alert-list td, #alert-list tr {
        display: block;
    }

    /* Hide the table headers (they will be added before each cell in mobile) */
    #alert-list thead {
        position: absolute;
        top: -9999px;
        left: -9999px;
        display:none;
    }

    #alert-panel {
        /* height: 318px; */
        background-color: #e0e0e0;
        border: 1px solid gray;
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }

    /* General tile styling for alert-list */
    /* General styling for the alert-list tiles */
    #alert-list tr {
        border: 1px solid #f08080; /* Subtle red border */
        border-left: 4px solid #ff4d4d; /* Prominent red left border for alerts */
        border-radius: 8px; /* Rounded corners */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
        margin-bottom: 15px; /* Space between cards */
        padding: 10px; /* Padding for content */
        background-color: #fff5f5; /* Light red background to indicate alert */
    }

    /* Pseudo-element for column headings */
    #alert-list td::before {
        content: attr(data-label); /* Show the heading */
        font-weight: bold; /* Bold headings */
        color: #555; /* Subtle gray for headings */
        flex: 0 0 40%; /* Space for the heading */
        text-align: left; /* Left-align headings */
    }

    /* Highlight the ISP name row */
    #alert-list td:first-child {
        font-size: 16px; /* Larger font for ISP name */
        font-weight: bold; /* Bold for emphasis */
        color: #d00000; /* Red color to indicate an alert */
        border-bottom: 2px solid #ff4d4d; /* Extra emphasis for alert heading */
    }

    /* Ensure the main text is aligned properly */
    #alert-list td {
        display: flex; /* Flex layout for alignment */
        justify-content: space-between; /* Space between heading and value */
        align-items: center; /* Vertically center content */
        text-align: right; /* Right-align data values */
        padding: 8px 12px; /* Padding for readability */
        font-size: 14px; /* Standard font size */
        color: #333; /* Darker color for values */
        border-bottom: 1px solid #eee; /* Subtle border for separation */
    }

    /* Add spacing between labels and values */
    #alert-list td span:first-child {
        color: #777; /* Light gray for labels */
        font-weight: normal; /* Normal font for labels */
        flex: 1; /* Allow label to take up space */
    }

    #alert-list td span:last-child {
        color: #000; /* Darker color for values */
        font-weight: bold; /* Bold values for emphasis */
    }


    /* Adjust padding and spacing for the last cell */
    #alert-list td:last-child {
        border-bottom: none;
    }
    
    #alert-list td:first-child::before {
        content: "⚠️ "; /* Add an alert icon */
        color: #d00000; /* Icon in red */
        font-size: 1.2rem; /* Slightly larger size */
    }

    
    #user-metadata-control {
        color: white !important; /* Force the text to be white */
        font-weight: bold !important; /* Ensure the text is bold */
        font-size: 8pt; /* Set the font size */
        line-height: 1; /* Reduce the line spacing */
        text-align: right; /* Right-align the text */
        padding: 5px; /* Add padding for spacing */
        background-color: rgba(0, 0, 0, 0.5); /* Optional: Add a semi-transparent background for visibility */
    }
    
    #user-metadata-control p {
        margin: 0 !important; /* Remove any default margin */
        color: white !important; /* Ensure the color remains white */
        font-size: 10pt !important; /* Ensure the font size matches */
        line-height: 1.3 !important; /* Set the desired line height */
        font-weight: bold !important; /* Ensure the text is bold */
    }


    #isp-table, #isp-table thead, #isp-table tbody, #isp-table th, #isp-table td, #isp-table tr {
        display: block;
    }

    #isp-table thead tr {
        display: none; /* Hide table header */
    }

    /* #isp-table tr {
        border: 1px solid #ddd;
        margin-bottom: 10px;
        padding: 10px;
    } */
/* 
    #isp-table td {
        display: flex;
        justify-content: space-between;
        padding: 5px 10px;
    } */

    #isp-table td::before {
        content: attr(data-label);
        font-weight: bold;
    }

    /* General tile styling */
    #isp-table tr {
        border: 1px solid #ddd; /* Light border for separation */
        border-radius: 8px; /* Rounded corners */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
        margin-bottom: 15px; /* Spacing between tiles */
        padding: 10px; /* Padding for content */
        background-color: #fff; /* Light background */
    }

    /* Highlight the ISP name row */
    #isp-table td:first-child {
        font-weight: bold; /* Bold text */
        background-color: #f7f7f7; /* Slightly darker background for distinction */
        padding: 12px; /* Extra padding for readability */
        border-radius: 8px 8px 0 0; /* Rounded corners for the top of the tile */
        font-size: 16px; /* Slightly larger font size */
        color: #333; /* Dark text for visibility */
    }

    /* General label and value styling */
    #isp-table td {
        padding: 8px 12px; /* Padding for readability */
        font-size: 14px; /* Standard font size for mobile */
        display: flex; /* Flexbox layout for alignment */
        justify-content: space-between; /* Space between label and value */
        align-items: center; /* Vertically center content */
    }

    /* Add spacing between labels and values */
    #isp-table td span:first-child {
        color: #777; /* Light gray for labels */
        font-weight: normal; /* Normal font for labels */
        flex: 1; /* Allow label to take up space */
    }

    #isp-table td span:last-child {
        color: #000; /* Darker color for values */
        font-weight: bold; /* Bold values for emphasis */
    }


    #country-isp-table, #country-isp-table thead, #country-isp-table tbody, #country-isp-table th, #country-isp-table td, #country-isp-table tr {
        display: block;
    }

    #country-isp-table thead tr {
        display: none; /* Hide table header */
    }    

    /* Card styling for country-isp-table on mobile */
    #country-isp-table tr {
        border: 1px solid #ddd; /* Light border */
        border-left: 4px solid #007BFF; /* Blue left border for distinction */
        border-radius: 8px; /* Rounded corners */
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); /* Subtle shadow */
        margin-bottom: 15px; /* Spacing between tiles */
        padding: 10px; /* Padding for content */
        background-color: #f9fafe; /* Light blue background */
    }

    /* Pseudo-elements for column headings */
    #country-isp-table td::before {
        content: attr(data-label); /* Show column heading */
        font-weight: bold; /* Bold for emphasis */
        color: #555; /* Subtle gray for headings */
        flex: 0 0 40%; /* Allocate space for heading */
        text-align: left; /* Left-align headings */
    }

    /* Data values styling (right-aligned) */
    #country-isp-table td {
        display: flex; /* Flex layout */
        justify-content: space-between; /* Space between heading and value */
        align-items: center; /* Vertical alignment */
        text-align: right; /* Right-align data values */
        padding: 8px 12px; /* Padding for readability */
        font-size: 14px; /* Standard font size */
        color: #333; /* Dark text */
        border-bottom: 1px solid #eee; /* Subtle bottom border */
    }

    /* Highlight ISP name */
    #country-isp-table td:first-child {
        font-size: 16px; /* Slightly larger font size */
        font-weight: bold; /* Bold text */
        color: #007BFF; /* Blue text to match border */
        border-bottom: 2px solid #007BFF; /* Emphasize with blue underline */
    }
    
    #country-isp-list-container {
        max-height: 300px; 
        overflow-y: auto;
        border: 1px solid #ddd;
        border-radius: 4px;
    }

}

/* Styles for portrait orientation */
@media only screen and (orientation: portrait) {
    /* CSS rules for portrait orientation */
    #map {
        height:500px;
    }
}


.no-alerts-row td {
    text-align: center !important;  /* Center the text in all views */
    padding: 15px;  /* Add padding for better visibility on mobile */
}

@media screen and (max-width: 768px) {
    .no-alerts-row td{
        display: block;    /* Ensure it takes full width in mobile view */
        text-align: center;  /* Override right-aligned default in vertical columns */
        justify-content: normal !important;
    }

}