/* Custom styles to complement Bootstrap theme */
#map {
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 400px;
}

.card {
    margin-bottom: 1.5rem;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header {
    background-color: var(--bs-dark);
    border-bottom: 1px solid var(--bs-border-color);
}

.table {
    margin-bottom: 0;
}

.footer {
    position: fixed;
    bottom: 0;
    width: 100%;
    background-color: var(--bs-dark);
    border-top: 1px solid var(--bs-border-color);
}

/* Risk level indicators */
.risk-indicator {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
}

/* Loading spinner */
.spinner-border {
    display: none;
}

.loading .spinner-border {
    display: inline-block;
}

/* HERC Region styles */
.herc-label {
    background: none;
    border: none;
}

.herc-label div {
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.herc-control {
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.herc-control label {
    color: #000;
    font-weight: 400;
}

.herc-control input[type="checkbox"] {
    margin-right: 5px;
}

/* HERC stats panel styles */
.herc-stats-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 2000;
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.herc-stats-panel .card-header {
    background-color: var(--bs-dark);
    border-bottom: 1px solid var(--bs-border-color);
    padding: 1rem;
}

.herc-stats-panel .card-body {
    padding: 1rem;
}

.herc-stats-panel h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

.herc-stats-panel .table {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.herc-stats-panel .table td:first-child {
    width: 60%;
}

.herc-stats-panel .btn-close {
    background-color: var(--bs-light);
}

/* WEM Region styles */
.wem-label {
    background: none;
    border: none;
}

.wem-label div {
    white-space: nowrap;
    text-align: center;
    font-size: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.wem-control {
    background: white;
    padding: 5px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
    margin-top: 10px;
}

.wem-control label {
    color: #000;
    font-weight: 400;
}

.wem-control input[type="checkbox"] {
    margin-right: 5px;
}

.wem-stats-panel {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 350px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    z-index: 1000;
    background-color: var(--bs-dark);
    border: 1px solid var(--bs-border-color);
    display: none;
}

.wem-stats-panel .card-header {
    background-color: var(--bs-dark);
    border-bottom: 1px solid var(--bs-border-color);
}

.wem-stats-panel .card-body {
    padding: 1rem;
}

.wem-stats-panel h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: var(--bs-primary);
}

.wem-stats-panel .table {
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.wem-stats-panel .table td:first-child {
    width: 60%;
}

.wem-stats-panel .btn-close {
    background-color: var(--bs-light);
}

/* Responsive Design */
@media (max-width: 768px) {
    .herc-stats-panel,
    .wem-stats-panel {
        width: 100%;
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        border-radius: 1rem 1rem 0 0;
    }

    .card {
        margin-bottom: 1rem;
    }

    #map {
        min-height: 300px;
    }

    .container {
        padding-bottom: 60px; /* Account for fixed footer */
    }
}

/* Print styles */
@media print {
    .footer {
        position: static;
    }

    .herc-stats-panel,
    .wem-stats-panel {
        position: static;
        width: 100%;
        display: block !important;
        break-inside: avoid;
    }

    .print-friendly {
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .print-friendly .table {
        width: 100%;
        margin-bottom: 1rem;
        page-break-inside: auto;
    }

    .print-friendly tr {
        page-break-inside: avoid;
        page-break-after: auto;
    }

    .print-friendly thead {
        display: table-header-group;
    }

    .print-friendly tfoot {
        display: table-footer-group;
    }

    .risk-level-high {
        color: #dc3545 !important;
        background-color: transparent !important;
    }

    .risk-level-medium {
        color: #ffc107 !important;
        background-color: transparent !important;
    }

    .risk-level-low {
        color: #28a745 !important;
        background-color: transparent !important;
    }

    /* Hide non-essential elements when printing */
    .navbar-toggler,
    .nav-item:not(.active),
    button.btn-print {
        display: none !important;
    }
}

/* Cross-browser compatibility */
* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

/* Edge-specific fixes */
@supports (-ms-ime-align: auto) {
    .footer {
        position: fixed;
    }

    .container {
        margin-bottom: 60px;
    }
}