:root {
    --page-opacity: .94;
}

* { box-sizing: border-box; }

body, input, select, textarea, button {
    font-family: Arial, Helvetica, sans-serif;
}

body {
    margin: 0 25px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: var(--outer-foreground);
    background-color: var(--outer-background);
    background-image: var(--outer-image);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
}

.report-params-container {
    padding: 0 15px;
    max-width: 1024px;
    margin: 0 auto;
}

.report-params-container .row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.form-group {
    margin-bottom: 20px;
}

.report-params-container .col {
    flex: 1 0 0%;
    padding: 0 15px;
}

main {
    flex-grow: 1;
    padding: 1rem;
}

a { color: var(--link-color); text-decoration: none; }
a:hover { color: var(--link-hover) !important; }

.calltype-exclude-form .select-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1em;
}

.page {
    border: 1px solid var(--header-background);
    padding: 1em 2em;
    border-right-width: 3px;
    border-bottom-width: 3px;
    border-radius: 6px;
    background-image: var(--page-image);
    background-color: var(--page-background);
    color: var(--page-foreground) !important;
    opacity: var(--page-opacity);
}
.page h3 {
    color: var(--page-foreground);
    margin-top: 1.5em;
}

.row tr td {
    padding: 1em 2em;
}

.row, tbody tr.even { 
    background-color: var(--row-background); 
    color: var(--row-foreground); 
}

.alt_row, tbody tr.odd { background-color: var(--alt-row-background); color: var(--alt-row-foreground); }

h1, h2 {
    color: var(--page-foreground);
    border-bottom: 1px solid var(--alt-row-background);
}

a:not(.button) {
    text-decoration: underline;
}

.user-info, .user-options {
    flex: 1 1 100%;
    max-width: 100%;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--alt-background);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.checkbox-group input[type="checkbox"] { margin-right: 0.5em; }

.help-text {
    font-size: 0.8em;
    color: var(--body-foreground);
}

.form-actions {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.form-actions button { 
    margin-left: 0; 
    background-color: var(--alt-background);
    color: var(--alt-foreground);
}

.page-header {
    background-color: var(--header-background);
    color: var(--header-foreground);
    padding: 1em;
    margin-bottom: 1em;
}

.main-content {
    padding: .1em;
    background-color: transparent;
    color: var(--page-foreground);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.admin-card {
    background-color: var(--alt-background);
    color: var(--alt-foreground);
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px var(--shadow-color-transparent);
}

.admin-name {
    font-weight: 550;
}

.admin-contact {
    display: flex;
    flex-direction: column;
}

.admin-contact a {
    color: var(--alt-foreground);
}

.link-options {
    font-size: smaller;
}

.incidentid {
    color: var(--link-color);
}

.incidentid:hover {
    color: var(--link-hover);
    cursor: pointer;
}

.link-options a {
    margin: .5em;
}

.search-retdata {
    padding: 2px 4px;
    margin: 0 1px;
    background-color: yellow !important;
    color: black !important;
    font-weight: bold;
    border-radius: 2px;
    text-decoration: none;
    display: inline-block;
}

.download-link {
    text-decoration: none;
    padding: 1em;
    border-radius: 3px; 
}

.sidebar {
    background-color: transparent;
    color: var(--alt-foreground);
    padding: 1em;
}

.footer {
    background-color: var(--header-background);
    color: var(--header-foreground);
    padding: 1em;
    text-align: center;
    margin-top: 2em;
}

.search-container, .sort-container, .checkbox-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.search-container input[type="text"], .search-container select, .sort-container select {
    flex-grow: 1;
    display: inline-flex;
    align-items: center;
    max-width: fit-content;
    margin: 0 .5em;
}

.search-container input[type="text"] {
    max-width: 400px !important;
}
.search-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}
.search-column {
    flex-basis: 45%;
    margin: auto;
}

.search-row {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.search-row select,
.search-row input[type="text"],
.search-row input[type="button"] {
  box-sizing: border-box;
}
.search-row input[type="text"] {
  flex-grow: 1;
  margin: 0 10px;
}
.search-row input[type="button"] {
  white-space: nowrap;
}
.date-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-dates {
    margin-top: 2em;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.search-dates select {
    margin-left: .5em;
}

.row-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.row-item {
  display: inline-flex;
  align-items: center;
  margin: 0 10px;
}

.framediv {
    padding: 1.5rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-column {
        flex-basis: 100%;
    }
    .search-container, .sort-container {
        flex-direction: column;
        align-items: center;
    }
    .search-container input[type="text"], .search-container select, .sort-container select {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        margin: 0 10px;
    }

    .page-content {
        padding: .5em 1em;
    }

    .alert-form {
        grid-template-columns: 1fr;
    }

    .alert-selects {
        grid-template-columns: 1fr;
    }

    .distinct-select-widget-frame {
        min-width: auto;
    }

    .select-container-wrapper {
        flex-direction: column;
    }

    .profile-container {
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .user-info,
    .user-options {
      flex: 0 0 calc(50% - 1rem);
      max-width: calc(50% - 1rem);
    }
}

@media (min-width: 1024px) {
    .profile-container {
        flex-direction: row;
        flex-wrap: nowrap;
    }

    .user-info,
    .user-options {
        flex: 0 0 calc(50% - 1rem);
        max-width: calc(50% - 1rem);
    }
}

/* Accessibility improvements */
:focus {
    outline: 2px solid var(--link-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    body {
        background: none;
        color: var(--page-foreground);
    }

    .page {
        border: none;
    }

    .no-print {
        display: none;
    }
}

/* Additional utility classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 3rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 3rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 3rem; }

.rounded { border-radius: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }

.shadow { box-shadow: 0 1px 3px 0 var(--shadow-color-transparent), 0 1px 2px 0 var(--shadow-color-light); }
.shadow-lg { box-shadow: 0 10px 15px -3px var(--shadow-color-transparent), 0 4px 6px -2px var(--shadow-color-light); }

.transition { transition: all 0.3s ease; }

.hover-shadow:hover { box-shadow: 0 4px 6px -1px var(--shadow-color-transparent), 0 2px 4px -1px var(--shadow-color-light); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.gap-4 { gap: 1rem; }

.w-full { width: 100%; }
button.w-full { max-width: 300px; }
.max-w-md { max-width: 28rem; }
.max-w-lg { max-width: 32rem; }
.max-w-xl { max-width: 36rem; }

.overflow-hidden { overflow: hidden; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.center-container {
    display: flex;
    justify-content: center;
    height: fit-content;
    max-width: 600px !important;
    margin: auto;
    width: 90% !important;
}


.center-container input[type="checkbox"] {
    width: 20px !important;
}

.center-container form {
    min-width: 500px;
    width: 100%;
    max-width: 500px;
    margin: auto;
}


/* centered readable messages */
.center-container.page.form-group {
    display: block;
    margin: 2em auto;
    padding: 25px 30px;
    background-color: var(--input-background);
    border: 1px solid var(--input-foreground);
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    min-width: initial !important;
    height: auto;
}

/* alerts page styling */
.page.alerts-content {
    background-color: var(--input-background);
    color: var(--input-foreground);
}

.center-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 1.5em;
    color: var(--text-color-headings);
    font-weight: 600;
}

.center-container p:first-of-type { /* Style the intro paragraph */
        margin-bottom: 1.5em;
        text-align: center;
        color: var(--text-color-secondary);
}

.center-container table.table {
    margin-bottom: 2em;
    width: 100%;
    border-collapse: collapse; /* Keep collapsed */
    border: none; /* Remove outer table border */
}
.center-container table.table th,
.center-container table.table td {
    padding: 12px 10px; /* Increase padding */
    vertical-align: middle; /* Align middle */
    border-bottom: 1px solid var(--table-border-color);
    border-top: none;
    border-left: none;
    border-right: none;
}
.center-container table.table tr:last-child th,
.center-container table.table td {
        border-bottom: none;
}

.center-container table.table th {
    text-align: right;
    font-weight: 600; /* Slightly bolder */
    width: 35%;
    padding-right: 20px;
    color: var(--text-color-tertiary);
}
.center-container table.table td {
    text-align: left;
    color: var(--text-color);
}

/* Style the form and actions container */
    .center-container form {
        min-width: initial;
        width: 100%;
        max-width: 100%; /* Allow form to fill container */
        margin: 0;
    }
.center-container .form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
}
.center-container .buttonformat {
    padding: 10px 20px;
    font-size: 1em;
}

.container-80-auto {
    width: 80%;
    margin: auto;
}

.container-85-auto {
    width: 85%;
    margin: auto;
}

.container-center-80-auto {
    text-align: center;
    width: 80%;
    margin: auto;
}

.theme-container {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.theme-container > label {
    color: var(--outer-foreground);
    white-space: nowrap;
    margin: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.theme-container select {
    background-color: var(--outer-background);
    color: var(--outer-foreground) !important;
    width: auto;
    height: 3em;
}

div[id$="_new_filter"] {
  background-color: var(--row-background);
  padding: 1rem;
  margin-top: 1rem;
  border-radius: 4px;
  text-align: center;
}

input[id$="_filter_name"] {
  display: inline-block;
  width: 60%;
  margin: 1em 0;
}

/* === Subscription Card Styles === */

.subscription-card {
    border: 1px solid var(--shadow-color);
    border-radius: 8px;
    margin-bottom: 20px;
    background-color: var(--row-background);
    box-shadow: 0 2px 4px var(--shadow-color-transparent);
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background-color: var(--alt-row-background);
    border-bottom: 1px solid var(--shadow-color);
}

.card-title {
    margin: 0;
    font-size: 1.25em;
    color: var(--page-foreground);
}

.card-actions .button,
.card-actions .confirm-link {
    margin-left: 10px;
    display: inline-block;
    vertical-align: middle;
    padding: 6px 12px;
    font-size: 0.9em;
    min-width: auto;
}

.card-body {
    padding: 20px;
    color: var(--page-foreground);
}

.card-section {
    margin-bottom: 15px;
}

.card-section:last-child {
    margin-bottom: 0;
}

.card-section b {
    color: var(--page-foreground);
}

.card-section ul {
    list-style: disc;
    margin-left: 20px;
    padding-left: 0;
    margin-top: 5px;
    margin-bottom: 0;
}

.card-section li {
    margin-bottom: 3px;
}

.card-divider {
    border: 0;
    border-top: 1px solid var(--shadow-color);
    margin: 20px 0;
}

.card-filters h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1em;
    color: var(--page-foreground);
}

.filter-item {
    margin-bottom: 5px;
    font-size: 0.9em;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .card-title {
        margin-bottom: 10px;
    }

    .card-actions {
        margin-top: 10px;
        width: 100%;
        text-align: right;
    }

     .card-actions .button,
     .card-actions .confirm-link {
        margin-left: 5px;
        margin-right: 0;
        margin-bottom: 5px;
    }
}

/* === Alert Form Radio Button Styles === */

.keyword-field-select {
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.keyword-field-select > label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: bold;
    color: var(--page-foreground);
}

.keyword-field-options {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
}

.keyword-field-options > div {
    display: flex;
    align-items: center;
    margin-bottom: 0;
}

.keyword-field-select input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--link-color);
    margin-top: 0;
    margin-bottom: 0;
}

.keyword-field-options input[type="radio"] + label {
    display: inline;
    margin-bottom: 0;
    font-weight: normal;
    color: var(--page-foreground);
}

#txtKeyword {
    margin-top: 0.5rem;
}

/* === Alert Type Radio Button Styles (Wizard Step 1) === */

.alert-type-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.alert-type-options > div {
    display: flex;
    align-items: center;
}

.alert-type-options input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--link-color);
    margin-top: 0;
    margin-bottom: 0;
    flex-shrink: 0;
}

.alert-type-options input[type="radio"] + label {
    display: inline;
    margin-bottom: 0;
    font-weight: normal;
    color: var(--page-foreground);
}

/* === Alert Form Step Divider Styles === */

.form-step-divider {
    border-top: 1px solid var(--alt-row-background);
    margin-top: 1.5rem;
    padding-top: 1.5rem;
}

.alert-form > .form-step-divider:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

/* === Alert Form Button Alignment === */

.button-group {
    text-align: center;
}

.button-group .buttonformat {
    display: inline-block;
    margin-left: 0.5em;
    margin-right: 0.5em;
}

/* === Keyword Search Result Card Styles === */

.kws_results {
    background-color: var(--page-background);
    padding: 0 1rem;
    margin: auto;
}

.result-card {
    background-color: var(--row-background);
    border: 1px solid var(--alt-row-background);
    border-radius: 6px;
    margin-bottom: 1.5rem;
    padding: 1rem 1.5rem;
    box-shadow: 0 2px 5px var(--shadow-color-light);
    position: relative;
    overflow: hidden;
}

.result-number {
    position: absolute;
    top: 1rem;
    left: -10px;
    background-color: var(--alt-background);
    color: var(--alt-foreground);
    padding: 0.3rem 0.8rem;
    border-radius: 4px 0 0 4px;
    font-size: 0.9em;
    font-weight: bold;
    box-shadow: 1px 1px 3px var(--shadow-color-transparent);
}

.result-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-left: 30px;
}

.result-section {
    flex: 1 1 250px;
    min-width: 200px;
}

.section-title {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--page-foreground);
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--alt-background);
}

.data-list {
    margin: 0;
    padding: 0;
}

.data-item {
    display: flex;
    margin-bottom: 0.5rem;
    font-size: 0.95em;
    line-height: 1.4;
}

.data-item dt {
    flex: 0 0 100px;
    font-weight: 500;
    color: var(--page-foreground);
    opacity: 0.85;
    padding-right: 0.5rem;
    text-align: right;
}

.data-item dd {
    flex-grow: 1;
    margin-left: 0;
    color: var(--page-foreground);
    word-wrap: break-word;
}

.address-item dd {
    display: flex;
    align-items: flex-start;
}
.address-item dd .geocoded,
.address-item dd .not_geocoded {
    margin-right: 5px;
    flex-shrink: 0;
}

.address-links {
    margin-top: 0.5rem;
    padding-left: 100px;
    font-size: 0.85em;
}

.address-links a {
    margin-right: 1rem;
    color: var(--link-color);
    text-decoration: none;
}
.address-links a:hover {
    color: var(--link-hover) !important;
    text-decoration: underline !important;
}

.comment_results {
    margin-top: 1rem;
    margin-left: 30px;
    margin-right: 0;
    background-color: var(--alt-row-background);
    border-left: 3px solid var(--alt-background);
    padding: 0.75rem 1rem;
    border-radius: 0 4px 4px 0;
    font-size: 1em;
    font-weight: normal;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .result-sections {
        flex-direction: column;
        gap: 1rem;
        margin-left: 0;
    }

    .result-card {
        padding: 1rem;
    }

    .result-number {
        position: static;
        display: inline-block;
        margin-bottom: 0.75rem;
        border-radius: 4px;
        left: auto;
        top: auto;
    }

    .data-item dt {
        flex-basis: 90px;
    }

    .address-links {
        padding-left: 90px;
    }

    .comment_results {
        margin-left: 0;
    }
}

.add-report-button-container {
    margin-top: 20px;
    text-align: center;
}

.row.padding-1em {
    border: 1px solid var(--shadow-color);
    margin-bottom: 1.5em;
}

.report-cfs-container {
    margin: 20px 0;
}
