body {
    font-family: sans-serif;
    margin: 0;
}

.hidden {
    display: none !important;
}

.page-container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem 3rem;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
}

/* Navbar styles */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #333;
    color: var(--navbar-text-color, #ffffff);
    padding: 0.5rem 1rem;
    position: relative;
    z-index: 2000;
}

.navbar-brand a {
    color: var(--navbar-text-color, #ffffff);
    text-decoration: none;
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.navbar-links a {
    color: var(--navbar-text-color, #ffffff);
    text-decoration: none;
    padding: 0.5rem 1rem;
    display: block;
}

.install-helper-button {
    border: 1px solid #5b8def;
    background: #1d4ed8;
    color: #fff;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-right: 0.25rem;
}

.install-helper-button:hover {
    background: #1e40af;
}

.nav-share {
    position: relative;
    display: flex;
    align-items: center;
}

.share-menu-toggle {
    border: 1px solid #5b8def;
    background: #1d4ed8;
    color: #fff;
    border-radius: 8px;
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.share-menu-toggle:hover {
    background: #1e40af;
}

.share-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    min-width: 220px;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 12px;
    box-shadow: 0 14px 28px rgba(2, 6, 23, 0.18);
    padding: 0.6rem;
    z-index: 2300;
}

.share-menu__title {
    font-size: 0.78rem;
    color: #475569;
    font-weight: 700;
    margin: 0 0 0.4rem;
    padding: 0 0.25rem;
}

.share-menu__options {
    display: grid;
    gap: 0.25rem;
}

.share-menu .share-menu__option {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #0f172a;
    border-radius: 8px;
    padding: 0.42rem 0.55rem;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.2;
    appearance: none;
}

.share-menu .share-menu__option:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

    .featured-threats {
        padding: 3rem 1.5rem;
        background: linear-gradient(135deg, #f5f7fa 0%, #e4ecff 100%);
    }

    .featured-threats__intro {
        max-width: 720px;
        color: #4a5568;
        margin-bottom: 1.5rem;
    }

    .featured-threats__grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 1.5rem;
    }

    .featured-threats__card {
        background: #fff;
        border-radius: 12px;
        padding: 1.5rem;
        box-shadow: 0 12px 30px rgba(7, 16, 38, 0.08);
        border: 1px solid #e2e8f0;
    }

    .featured-threats__type {
        text-transform: uppercase;
        letter-spacing: 0.1em;
        font-size: 0.75rem;
        color: #2563eb;
        margin-bottom: 0.75rem;
    }

    .featured-threats__country {
        font-size: 0.78rem;
        color: #111111;
        margin: -0.45rem 0 0.75rem;
    }

    .featured-threats__card h3 {
        margin-top: 0;
        margin-bottom: 0.5rem;
    }

    .featured-threats__card dl {
        display: grid;
        grid-template-columns: 80px 1fr;
        gap: 0.5rem 1rem;
        margin: 1rem 0 0;
    }

    .featured-threats__card dt {
        font-weight: 600;
        color: #475569;
    }

    .featured-threats__card dd {
        margin: 0;
    }

    .featured-threats__source-text {
        display: inline-block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        vertical-align: bottom;
    }

    .pagination {
        margin-top: 1.5rem;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        flex-wrap: wrap;
    }

    .pagination__link {
        display: inline-block;
        padding: 0.45rem 0.75rem;
        border: 1px solid #cbd5e1;
        border-radius: 8px;
        background: #ffffff;
        color: #1e3a8a;
        text-decoration: none;
        font-weight: 600;
    }

    .pagination__link:hover {
        background: #eff6ff;
    }

    .pagination__link--disabled {
        color: #94a3b8;
        border-color: #e2e8f0;
        background: #f8fafc;
        cursor: not-allowed;
    }

    .pagination__status {
        color: #334155;
        font-weight: 600;
    }
.navbar-links a:hover {
    background-color: #555;
}

.navbar-toggler {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.navbar-toggler-icon {
    display: block;
    width: 24px;
    height: 2px;
    background-color: var(--navbar-text-color, #ffffff);
    position: relative;
}

.navbar-toggler-icon::before,
.navbar-toggler-icon::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: var(--navbar-text-color, #ffffff);
    left: 0;
}

.navbar-toggler-icon::before {
    top: -8px;
}

.navbar-toggler-icon::after {
    bottom: -8px;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
    .navbar-links {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #333;
        z-index: 2100;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    }

    .navbar-links.active {
        display: flex;
    }

    .navbar-toggler {
        display: block;
    }

    .nav-share {
        width: 100%;
        padding: 0.35rem 1rem;
        box-sizing: border-box;
    }

    .share-menu-toggle {
        width: 100%;
        justify-content: center;
    }

    .share-menu {
        left: 1rem;
        right: 1rem;
        min-width: 0;
    }
}

#map {
    height: calc(100vh - 56px);
}

.content-section {
    padding: 2rem;
}

/* =================================
   Form Styling
   ================================= */

.form-container {
    max-width: 700px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
    box-sizing: border-box;
    overflow-x: hidden;
}

.admin-config-container {
    max-width: 1200px;
    overflow-x: visible;
}

.visitor-chat-toggle {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1200;
    border: 1px solid #1d4ed8;
    background: #1d4ed8;
    color: #fff;
    border-radius: 999px;
    padding: 0.55rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
}

.visitor-chat-panel {
    position: fixed;
    right: 1rem;
    bottom: 3.8rem;
    width: min(360px, calc(100vw - 2rem));
    max-height: 70vh;
    z-index: 1200;
    background: #fff;
    border: 1px solid #dbeafe;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.visitor-chat-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.visitor-chat-panel__join {
    display: grid;
    gap: 0.35rem;
}

.visitor-chat-messages {
    min-height: 140px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    background: #f8fafc;
}

.visitor-chat-message {
    padding: 0.35rem 0.25rem;
    border-bottom: 1px solid #e2e8f0;
}

.visitor-chat-message:last-child {
    border-bottom: none;
}

.visitor-chat-message__meta {
    font-size: 0.72rem;
    color: #475569;
}

.visitor-chat-message__text {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.88rem;
    color: #0f172a;
}

.visitor-chat-send-form {
    display: grid;
    gap: 0.35rem;
}

.visitor-chat-send-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.social-share {
    margin-top: 0.7rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.social-share__label {
    font-size: 0.9rem;
    color: #334155;
    font-weight: 600;
}

.social-share__button {
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #1e293b;
    border-radius: 999px;
    padding: 0.28rem 0.7rem;
    font-size: 0.82rem;
    text-decoration: none;
    cursor: pointer;
}

.social-share__button:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.admin-config-container .table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.admin-api-logs-table {
    min-width: 980px;
}

.admin-api-logs-table td:nth-child(3),
.admin-api-logs-table td:nth-child(7) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.form-container form {
    width: 100%;
    box-sizing: border-box;
}

.form-container h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #343a40;
}

.register-support-page .support-intro {
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 1rem;
    margin-bottom: 1rem;
    color: #334155;
}

.support-boxes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.support-box {
    border: 1px solid #d6deea;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    background: #ffffff;
}

.support-box summary {
    cursor: pointer;
    font-weight: 700;
    color: #0f172a;
}

.support-box p {
    margin: 0.55rem 0 0;
    color: #334155;
}

.payment-group {
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    background: #f8fafc;
    padding: 1rem;
}

.payment-group h3 {
    margin-top: 0;
}

.donation-controls {
    margin-top: 0.75rem;
    display: grid;
    gap: 0.65rem;
    max-width: 340px;
}

.consent-checkbox-group {
    border: 1px solid #dbe4f0;
    background: #f8fafc;
    border-radius: 10px;
    padding: 0.9rem;
}

.consent-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.45;
    color: #334155;
    font-weight: 500;
}

.consent-checkbox-label input[type="checkbox"] {
    margin-top: 0.15rem;
}

.success-note {
    color: #166534;
    background: #dcfce7;
    border: 1px solid #86efac;
    border-radius: 8px;
    padding: 0.65rem;
}

.error-note {
    color: #991b1b;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    padding: 0.65rem;
}

.form-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-toolbar h2 {
    margin: 0;
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #495057;
}

.field-label-with-help {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.field-label-with-help label {
    margin-bottom: 0;
}

.field-help-trigger {
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    border: 1px solid #94a3b8;
    background: #f8fafc;
    color: #0f172a;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}

.field-help-trigger:hover {
    background: #e2e8f0;
}

/* Style for required fields */
.form-group label.required::after {
    content: ' *';
    color: #dc3545;
    font-weight: bold;
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    box-sizing: border-box;
}

.form-control:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.invalid-feedback {
    color: #dc3545;
    margin-top: 0.25rem;
    font-size: 80%;
}

.form-check {
    display: flex;
    align-items: center;
}

.form-check-input {
    margin-right: 0.5rem;
}

.btn-submit {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    background-color: #007bff;
    border: 1px solid #007bff;
    border-radius: 0.25rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.btn-primary,
.btn-secondary {
    padding: 0.65rem 1.25rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 0.35rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.btn-primary {
    background-color: #0056b3;
    color: #fff;
}

.btn-primary:hover {
    background-color: #004494;
}

.btn-secondary {
    background-color: #f4f5f7;
    border: 1px solid #cfd3da;
    color: #0f172a;
}

.btn-secondary:hover {
    background-color: #ebeef2;
}

.btn-working {
    cursor: wait !important;
    opacity: 0.75;
}

.btn-link {
    background: none;
    border: none;
    padding: 0;
    color: #0056b3;
    cursor: pointer;
    text-decoration: underline;
    font-size: 0.95rem;
}

.btn-submit:hover {
    background-color: #0056b3;
}

.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.25rem;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
}

.flash-messages {
    position: fixed;
    top: 82px;
    left: 50%;
    transform: translateX(-50%);
    width: min(760px, calc(100% - 2rem));
    z-index: 5001;
    pointer-events: none;
}

.flash-messages .alert {
    pointer-events: auto;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.alert__message {
    flex: 1;
}

.alert__close {
    border: none;
    background: transparent;
    color: inherit;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    margin-top: -0.05rem;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

/* Honeypot for bot prevention */
.honeypot {
    display: none;
}

.footer {
    text-align: center;
    padding: 20px;
    margin-top: 20px;
}

.footer hr {
    margin-bottom: 20px;
    border: 0;
    border-top: 1px solid #eee;
}

.card {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    border: 1px solid #e0e5ec;
    margin-bottom: 1.5rem;
}

.card--highlight {
    background: linear-gradient(120deg, #0f172a, #1e3a8a);
    color: #f8fafc;
}

.card--highlight .btn-primary {
    background-color: #fbbf24;
    color: #111;
}

.card__header {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.card__status {
    margin: 0;
    font-size: 0.95rem;
}

.muted {
    color: #6b7280;
    margin: 0.25rem 0 0;
}

.table-wrapper {
    overflow-x: auto;
}

.manage-users-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.manage-users-title {
    margin: 0;
    font-size: 1.35rem;
    color: #0f172a;
}

.manage-users-export-btn {
    white-space: nowrap;
}

.export-action-btn {
    white-space: nowrap;
}

.manage-threats-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    margin-bottom: 1.25rem;
}

.manage-threats-header h2 {
    margin: 0;
}

.manage-users-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(2, 6, 23, 0.06);
}

.manage-threats-table-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 3px 10px rgba(2, 6, 23, 0.06);
}

.manage-threats-table thead th {
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 1;
}

.manage-threats-table tbody tr:nth-child(even) {
    background: #fcfdff;
}

.manage-threats-table .col-title {
    min-width: 230px;
    max-width: 320px;
}

.manage-threats-table .col-type {
    min-width: 140px;
}

.manage-threats-table .col-date {
    min-width: 165px;
}

.manage-threats-table .col-user {
    min-width: 150px;
}

.manage-threats-table .col-flag,
.manage-threats-table .col-status {
    min-width: 110px;
}

.manage-threats-table .col-actions {
    min-width: 140px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #f3f4f6;
    color: #1f2937;
    font-size: 0.78rem;
    font-weight: 600;
}

.boolean-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
}

.boolean-pill--yes {
    background: #dcfce7;
    color: #166534;
}

.boolean-pill--no {
    background: #f3f4f6;
    color: #374151;
}

.manage-users-table thead th {
    background: #f8fafc;
}

.manage-users-actions-cell {
    min-width: 260px;
}

.manage-users-action-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.manage-users-action-form:last-child {
    margin-bottom: 0;
}

.manage-users-action-form .btn-secondary {
    white-space: nowrap;
}

.table-heading {
    margin: 0 0 0.5rem;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #1f2937;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.75rem 0.5rem;
    border-bottom: 1px solid #e5e7eb;
    text-align: left;
    vertical-align: top;
}

.data-table th {
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: #6b7280;
}

.table-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.actions-cell {
    min-width: 140px;
}

.actions-cell .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 640px) {
    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions-cell .btn {
        width: 100%;
    }

    .manage-users-action-form {
        grid-template-columns: 1fr;
    }

    .manage-users-export-btn {
        width: 100%;
        text-align: center;
    }

    .export-action-btn {
        width: 100%;
        text-align: center;
    }

    .manage-threats-header .btn {
        width: 100%;
        text-align: center;
    }
}

.monospace {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    word-break: break-all;
}

.inline-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.button-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    background: #e5e7eb;
    font-size: 0.85rem;
}

.status-pill--running {
    background: #dbeafe;
    color: #1d4ed8;
}

.status-pill__spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #bfdbfe;
    border-top-color: #1d4ed8;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    100% { transform: rotate(360deg); }
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
}

.form-control--compact {
    max-width: 360px;
}

.form-actions {
    grid-column: 1 / -1;
}

.home-footer {
    position: absolute;
    bottom: 10px;
    left: 5%;
    width: 90%;
    z-index: 1000; /* Ensure it's above the map */
    background: transparent;
    padding: 5px 10px;
    border-radius: 5px;
    box-sizing: border-box;
}

.configurable-footer-message {
    width: 100%;
    font-size: 0.95rem;
    line-height: 1.4;
}

.home-footer .cookie-manage-link,
.footer .cookie-manage-link {
    display: inline;
    margin: 0;
    text-align: inherit;
}

.footer-actions-inline {
    text-align: center;
    margin-top: 0.35rem;
}

#filter-container {
    position: absolute;
    top: 70px; /* Adjust as needed */
    left: 60px; /* Move right to avoid map controls */
    z-index: 1000;
    background: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 220px;
    max-height: calc(100vh - 140px);
    display: flex;
    flex-direction: column;
}

#filter-header {
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    user-select: none;
}

#filter-arrow {
    margin-right: 8px;
    transition: transform 0.2s;
}

#filter-options {
    margin-top: 10px;
    overflow-y: auto;
    max-height: calc(100vh - 210px);
    padding-right: 6px;
}

#filter-options::-webkit-scrollbar {
    width: 8px;
}

#filter-options::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 999px;
}

#filter-options::-webkit-scrollbar-track {
    background: #f8fafc;
}

.filter-divider {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 10px 0;
}

.inactive-filter-controls {
    margin-top: 8px;
    padding: 8px;
    border: 1px solid #e8edf5;
    border-radius: 6px;
    background: #f9fbff;
}

.inactive-filter-mode {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
}

.inactive-mode-panel {
    display: grid;
    gap: 6px;
    margin-bottom: 8px;
}

#inactive-range-controls {
    grid-template-columns: 58px minmax(160px, 1fr);
    gap: 8px 10px;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dbe4f0;
    border-radius: 8px;
    padding: 8px;
}

#inactive-range-controls label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin: 0;
}

#inactive-range-controls input[type="date"] {
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.35rem 0.45rem;
    font-size: 0.9rem;
    background: #f8fafc;
}

#inactive-range-controls input[type="date"]:focus {
    outline: 2px solid #93c5fd;
    border-color: #60a5fa;
    background: #ffffff;
}

.inactive-mode-panel input[type="date"],
.inactive-mode-panel input[type="range"] {
    width: 100%;
}

.inactive-timeline-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #4b5563;
}

.inactive-filter-error {
    color: #b42318;
    font-weight: 600;
}

.inactive-filter-legend {
    position: absolute;
    top: 360px;
    right: 20px;
    z-index: 1000;
    min-width: 260px;
    max-width: 360px;
    background: rgba(7, 16, 38, 0.9);
    color: #f8fafc;
    border-radius: 8px;
    padding: 10px 12px;
    box-shadow: 0 8px 18px rgba(2, 6, 23, 0.35);
}

.inactive-filter-legend strong {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 4px;
}

.inactive-filter-legend p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
}

.more-tools-popup {
    position: absolute;
    top: 70px;
    right: 20px;
    z-index: 1000;
    width: min(360px, calc(100vw - 40px));
    background: #ffd9a8;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    padding: 10px;
}

.more-tools-popup summary {
    cursor: pointer;
    list-style: none;
    font-weight: bold;
    display: flex;
    align-items: center;
    user-select: none;
    color: #111827;
}

.more-tools-arrow {
    margin-right: 8px;
    transition: transform 0.2s;
}

.more-tools-popup:not([open]) .more-tools-arrow {
    transform: rotate(-90deg);
}

.more-tools-popup summary::-webkit-details-marker {
    display: none;
}

.more-tools-popup__content {
    margin-top: 10px;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #0f172a;
}

.more-tools-popup__content ul {
    margin: 8px 0 10px 18px;
    padding: 0;
}

.more-tools-popup__content p {
    margin: 8px 0;
}

.more-tools-popup__note {
    font-weight: 600;
    color: #92400e;
}

@media (max-width: 900px) {
    .more-tools-popup {
        top: auto;
        bottom: 20px;
        right: 12px;
        width: min(360px, calc(100vw - 24px));
    }
}

#filter-options.collapsed {
    display: none;
}

/* Autocomplete suggestions styles */
.autocomplete-suggestions {
    position: absolute;
    background: #fff;
    border: 1px solid #ccc;
    z-index: 2000;
    max-height: 150px;
    overflow-y: auto;
    max-width: 100%;
    min-width: 200px;
    width: auto;
    box-sizing: border-box;
    overflow-x: auto;
}

.autocomplete-suggestion {
    padding: 6px 12px;
    cursor: pointer;
}

.autocomplete-suggestion:hover {
    background: #f0f0f0;
}

.threat-popup-link {
    background: none;
    border: none;
    padding: 0;
    color: #1d4ed8;
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
}

.threat-popup-link:hover {
    color: #1e40af;
}

.leaflet-popup-content .threat-popup-multi,
.leaflet-popup-content .threat-popup-multi h3,
.leaflet-popup-content .threat-popup-multi ul,
.leaflet-popup-content .threat-popup-multi li {
    text-align: left !important;
}

.leaflet-popup-content .threat-popup-multi h3 {
    margin: 0 0 0.35rem;
}

.leaflet-popup-content .threat-popup-multi ul {
    margin: 0.2rem 0 0;
    padding-left: 1.25rem;
    list-style-position: outside;
}

.leaflet-popup-content .threat-popup-multi li {
    margin: 0.2rem 0;
    padding-left: 0;
}

.leaflet-popup-content .threat-popup-multi .threat-popup-link {
    display: inline;
    margin: 0;
    padding: 0;
    text-align: left;
    vertical-align: baseline;
    white-space: normal;
}

.leaflet-popup-multi-threat .leaflet-popup-content {
    min-width: 300px;
    max-width: 500px;
}

.cookie-consent {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(13, 17, 23, 0.95);
    color: #f8f9fb;
    padding: 1.5rem;
    z-index: 3000;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.55);
}

.cookie-consent__content {
    max-width: 960px;
    margin: 0 auto;
}

.cookie-consent__content h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.cookie-consent__content p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.cookie-details-toggle {
    background: none;
    border: none;
    color: #9cc3ff;
    text-decoration: underline;
    padding: 0;
    margin-bottom: 0.75rem;
    cursor: pointer;
}

.cookie-consent__details {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}

.cookie-consent__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.cookie-manage-link {
    background: none;
    border: none;
    color: #1f6feb;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    font-size: 0.95rem;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4000;
    padding: 1rem;
}

.modal {
    background: #fff;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal__header {
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    gap: 1rem;
}

.modal__body {
    padding: 1rem 1.5rem 1.5rem;
    overflow-y: auto;
}

.modal__content {
    max-height: 65vh;
    overflow-y: auto;
}

.install-helper-modal {
    position: fixed;
    inset: 0;
    z-index: 4500;
    background: rgba(2, 6, 23, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.install-helper-modal__card {
    width: min(640px, 100%);
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(2, 6, 23, 0.4);
    padding: 1rem 1.25rem 1.25rem;
}

.install-helper-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.install-helper-modal__header h2 {
    margin: 0;
    font-size: 1.2rem;
}

.install-helper-modal__steps {
    margin: 0.75rem 0 1rem;
    padding-left: 1.25rem;
}

.install-helper-modal__steps li {
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.install-helper-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.notification-preferences__section {
    margin: 0.75rem 0;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.35rem 0.75rem;
}

.checkbox-inline {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
}

@media (max-width: 600px) {
    .cookie-consent {
        padding: 1rem;
    }

    .cookie-consent__actions {
        flex-direction: column;
    }

    .install-helper-button {
        margin: 0.4rem 0.9rem;
        width: calc(100% - 1.8rem);
        text-align: center;
    }

    .share-menu-toggle {
        margin: 0;
    }

    .install-helper-modal__actions {
        flex-direction: column;
    }
}
