/* Base styles */
html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    height: 100vh;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #BF2300;
}

/* Page Layout */
.page-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* Header styles */
.main-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.company-logo {
    height: 40px;
    width: auto;
}

/* Menu styles */
.main-menu {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
    z-index: 1;
}

.menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

    .menu-list li a {
        display: block;
        padding: 0.75rem 1.5rem;
        color: #4b5563;
        text-decoration: none;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .menu-list li a:hover {
            background-color: #e5e7eb;
            color: #1a1a1a;
        }

        .menu-list li a.active {
            background-color: #e5e7eb;
            color: #1a1a1a;
            border-bottom: 2px solid #3b82f6;
        }

/* Icon bar styles */
.icon-bar {
    display: flex;
    padding: 0.5rem;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    gap: 0.5rem;
    flex-shrink: 0;
    z-index: 1;
}

.icon-button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    background-color: #ffffff;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .icon-button:hover {
        background-color: #f8f9fa;
    }

    .icon-button.active {
        background-color: #e5e7eb;
        border-color: #C61700;
        color: #1a1a1a;
    }

/* Main content and map styles */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
}

.mapCanvas {
    flex-group: 1;
}

.GoogleMap {
    height: 100% !important;
    width: 100%;
    position: absolute !important;
    top: 0;
    left: 0;
}

/* Map legend styles */
.map-legend {
    position: absolute;
    bottom: 100px;
    left: 10px;
    z-index: 1;
}

.legend-box {
    background-color: white;
    padding: 12px;
    border-radius: 0px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    min-width: 200px;
}

    .legend-box h3 {
        margin: 0 0 8px 0;
        font-size: 14px;
        font-weight: bold;
    }

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    font-size: 12px;
}

.color-box {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    opacity: 0.3;
}


.loading-dots {
    display: flex;
    gap: 6px;
}

.status-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: space-between; /* This spreads the content */
    z-index: 10;
}

.status-left {
    display: flex;
    align-items: center;
}

.connection-status-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-status {
    display: flex;
    align-items: center;
    font-size: 12px;
    color: #6c757d;
}

.dot {
    width: 8px;
    height: 8px;
    background-color: #CC0000;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out;
}

    .dot:nth-child(1) {
        animation-delay: -0.32s;
    }

    .dot:nth-child(2) {
        animation-delay: -0.16s;
    }

    .dot:nth-child(3) {
        animation-delay: 0s;
    }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1);
    }
}

/* Loading page styles */
.loading-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: #f8f9fa;
    z-index: 2000;
}

.loading-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1.5rem;
}

.app-title {
    font-size: 2rem;
    color: #212529;
    margin-bottom: 2rem;
    font-weight: 600;
}

/* Login page styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    padding: 2rem 1rem;
}

.login-logo {
    height: 80px;
    width: auto;
    margin-bottom: 1rem;
}

/* Error UI styles */
#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

/* Blazor loading progress */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Validation styles */
.validation-message {
    color: red;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

/* Utility styles */
.text-muted {
    color: #6c757d !important;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #AA000E;
}

.btn:focus,
.btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Side Panel Styles - Add to your site.css file */

.side-panel {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 360px;
    background-color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.15);
    z-index: 900;
    transition: transform 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

    .side-panel.hidden {
        transform: translateX(100%);
    }

    .side-panel.visible {
        transform: translateX(0);
    }

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background-color: #f5f5f5;
    border-bottom: 1px solid #e0e0e0;
}

.panel-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.detail-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 16px;
}

    .detail-section:last-child {
        border-bottom: none;
    }

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #444;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 14px;
}

.detail-label {
    font-weight: 500;
    color: #666;
}

.detail-value {
    text-align: right;
    overflow-wrap: break-word;
    max-width: 60%;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 60%;
    justify-content: flex-end;
}

.tag {
    background-color: #F9D4E5;
    color: #0369a1;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: 500;
}

.scrollable-list {
    max-height: 240px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 4px;
}

.list-item {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

    .list-item:last-child {
        border-bottom: none;
    }

.item-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.item-detail {
    font-size: 12px;
    color: #666;
}

.alert-description {
    background-color: #f8f8f8;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.panel-actions {
    display: flex;
    gap: 8px;
    padding-top: 16px;
}

.action-button {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    flex: 1;
}

    .action-button.primary {
        background-color: #0078d4;
        color: white;
    }

        .action-button.primary:hover {
            background-color: #A80800;
        }

    .action-button.secondary {
        background-color: #f0f0f0;
        color: #333;
    }

        .action-button.secondary:hover {
            background-color: #e0e0e0;
        }

.no-content {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #999;
}

/* Status classes */
.status-ok {
    color: #2ecc71;
}

.status-warning {
    color: #f39c12;
}

.status-alert {
    color: #e74c3c;
}

.status-sos {
    color: #c0392b;
    font-weight: bold;
}

/* Alert type classes */
.alert-security {
    color: #e74c3c;
}

.alert-weather {
    color: #3498db;
}

.alert-health {
    color: #9b59b6;
}

.alert-transport {
    color: #f39c12;
}

.alert-general {
    color: #34495e;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .side-panel {
        width: 280px;
    }
}

/* UPDATED Marker Popup Styles for percentage-based positioning */
.marker-popup {
    position: absolute;
    width: 250px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    /* Add transitions for transform to make positioning smoother */
    transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    font-size: 14px;
    /* Position will be set inline via popupStyle */
    /* transform will be set inline to position relative to marker */
}

    .marker-popup.hidden {
        opacity: 0;
        pointer-events: none;
        /* Add scale down animation when hiding */
        transform: translate(-50%, -120%) scale(0.9);
    }

    .marker-popup.visible {
        opacity: 1;
        pointer-events: auto;
        /* The base transform will be set inline */
    }

.popup-content {
    padding: 10px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.popup-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.close-button {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #999;
    padding: 0 4px;
}

    .close-button:hover {
        color: #333;
    }

.popup-body {
    font-size: 13px;
}

.entity-info {
    margin-bottom: 10px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.info-label {
    font-weight: 500;
    color: #666;
}

.info-value {
    text-align: right;
}

.view-details {
    margin-top: 10px;
    text-align: center;
}

.details-button {
    background-color: #0078d4;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .details-button:hover {
        background-color: #A80800;
    }

.popup-arrow {
    width: 12px;
    height: 12px;
    background-color: white;
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.1);
}

/* Add media query for smaller screens */
@media (max-width: 480px) {
    .marker-popup {
        width: 220px;
        font-size: 13px;
    }

    .popup-title {
        font-size: 15px;
    }

    .details-button {
        padding: 5px 10px;
        font-size: 12px;
    }
}

/* Tabs styling */
.panel-tabs {
    display: flex;
    border-bottom: 1px solid #e1e1e1;
    background-color: #f7f7f7;
}

.tab-button {
    padding: 10px 16px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    position: relative;
}

    .tab-button:hover {
        color: #4285F4;
    }

    .tab-button.active {
        color: #4285F4;
    }

        .tab-button.active::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            height: 3px;
            background-color: #F2878E;
        }

/* Notes styling */
.notes-container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.note-item {
    margin-bottom: 12px;
    padding: 12px;
    border-radius: 8px;
    background-color: #f9f9f9;
    border-left: 4px solid #ddd;
}

    .note-item.note-important {
        background-color: #fff8e1;
        border-left-color: #ffc107;
    }

.note-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.note-category {
    font-weight: 500;
    color: #F2878E;
}

.note-timestamp {
    color: #666;
    font-size: 12px;
}

.note-content {
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.note-footer {
    font-size: 12px;
    color: #666;
    text-align: right;
}

.add-note-form {
    padding: 12px;
    border-top: 1px solid #e1e1e1;
}

.form-row {
    display: flex;
    margin-bottom: 8px;
}

.note-category-select {
    flex: 1;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.important-checkbox {
    display: flex;
    align-items: center;
    margin-left: 12px;
    white-space: nowrap;
}

.note-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
    resize: vertical;
}

.add-note-button {
    background-color: #F2878E;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    float: right;
}

    .add-note-button:disabled {
        background-color: #ccc;
        cursor: not-allowed;
    }

.no-notes {
    color: #666;
    text-align: center;
    padding: 24px 0;
}

.connection-status {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    z-index: 1000;
    opacity: 0.8;
}

    .connection-status.connected {
        background-color: #4CAF50;
        color: white;
    }

    .connection-status.disconnected {
        background-color: #F44336;
        color: white;
    }

/* Items In View styles */
.items-in-view-container {
    padding: 0 16px;
}

.list-header {
    margin-bottom: 16px;
}

    .list-header h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 500;
        color: #333;
    }

.items-in-view-container .scrollable-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.items-in-view-container .list-item {
    padding: 12px;
    border-radius: 6px;
    background-color: #f9f9f9;
    transition: background-color 0.2s;
    cursor: pointer;
}

    .items-in-view-container .list-item:hover {
        background-color: #f0f0f0;
    }

.items-in-view-container .item-name {
    font-weight: 500;
    font-size: 15px;
    margin-bottom: 4px;
}

.items-in-view-container .item-details {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 12px;
    color: #666;
    flex-wrap: wrap;
}

.items-in-view-container .status,
.items-in-view-container .alert-severity,
.items-in-view-container .last-updated {
    padding: 2px 6px;
    border-radius: 4px;
    background-color: #eee;
    white-space: nowrap;
}

    .items-in-view-container .status.sos {
        background-color: #ffebee;
        color: #d32f2f;
    }

    .items-in-view-container .alert-severity.level-1 {
        background-color: #e8f5e9;
        color: #2e7d32;
    }

    .items-in-view-container .alert-severity.level-2 {
        background-color: #fff8e1;
        color: #ff8f00;
    }

    .items-in-view-container .alert-severity.level-3 {
        background-color: #fff3e0;
        color: #e64a19;
    }

    .items-in-view-container .alert-severity.level-4 {
        background-color: #ffebee;
        color: #d32f2f;
    }

.items-in-view-container .item-description {
    margin-top: 8px;
    font-size: 13px;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.items-in-view-container .empty-message {
    padding: 24px 16px;
    text-align: center;
    color: #777;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 6px;
    margin: 16px 0;
}

/* Tab bar for items in view */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 16px;
    background-color: #f5f5f5;
}

.tab-button {
    padding: 10px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    color: #666;
}

    .tab-button:hover {
        color: #333;
    }

    .tab-button.active {
        border-bottom-color: #F2736A;
        color: #F2736A;
    }

/* Responsive adjustments for items in view */
@media (max-width: 768px) {
    .items-in-view-container .scrollable-list {
        max-height: calc(100vh - 240px);
    }
}

/* Enhanced styles for affected people list in alerts */
.scrollable-list .list-item {
    display: flex;
    flex-direction: column;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s;
}

    .scrollable-list .list-item:hover {
        background-color: #f5f5f5;
        cursor: pointer;
    }

    .scrollable-list .list-item:last-child {
        border-bottom: none;
    }

.scrollable-list .item-name {
    font-weight: 600;
    margin-bottom: 3px;
}

.scrollable-list .item-details {
    display: flex;
    flex-wrap: wrap;
    font-size: 0.85rem;
    color: #666;
    align-items: center;
    gap: 8px;
}

.scrollable-list .status-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
}

    .scrollable-list .status-badge.traveling {
        background-color: #e3f2fd;
        color: #1976d2;
    }

    .scrollable-list .status-badge.local {
        background-color: #e8f5e9;
        color: #2e7d32;
    }

.scrollable-list .location-time {
    font-style: italic;
    color: #757575;
    margin-left: auto;
}

/* Styling for filtered out people */
.scrollable-list .list-item.filtered-out {
    opacity: 0.6;
    background-color: #f9f9f9;
    cursor: default !important;
}

    .scrollable-list .list-item.filtered-out:hover {
        background-color: #f9f9f9; /* Keep the same background on hover */
    }

.scrollable-list .filter-notice {
    margin-left: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.scrollable-list .filter-icon {
    color: #f57c00;
    font-style: normal;
    font-size: 14px;
}

/* Make the list more compact when there are many items */
.detail-section:has(.scrollable-list .list-item:nth-child(n+6)) .scrollable-list {
    max-height: 250px;
    overflow-y: auto;
}

/* Severity level styles */
.severity-level-1 {
    color: #2e7d32;
}

.severity-level-2 {
    color: #ff8f00;
}

.severity-level-3 {
    color: #e64a19;
}

.severity-level-4 {
    color: #d32f2f;
    font-weight: bold;
}


/* User info */
.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #FF8060;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 10px;
}

/* Logout button */
.logout-button {
    background-color: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

    .logout-button:hover {
        background-color: #f5f5f5;
        color: #333;
    }

/* Custom InfoWindow Styles */
.gm-style-iw {
    width: 350px !important;
    top: 0 !important;
    left: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}
    /* Remove default Google Maps InfoWindow styling */
    .gm-style-iw > div {
        overflow: hidden !important;
        border-radius: 4px !important;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
    }
    /* Hide default close button */
    .gm-style-iw + div {
        display: none !important;
    }
/* Customization for entity-specific details */
.info-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.info-detail-card {
    background-color: #f7fafc;
    padding: 10px;
    border-radius: 4px;
    text-align: center;
}

.info-detail-card-title {
    color: #718096;
    font-size: 12px;
    margin-bottom: 5px;
}

.info-detail-card-value {
    font-weight: 600;
    color: #2d3748;
    font-size: 18px;
}
/* Status color utilities */
.status-sos {
    color: #e53e3e;
}

.status-ok {
    color: #38a169;
}
/* Responsive adjustments */
@media (max-width: 400px) {
    .gm-style-iw {
        width: 300px !important;
    }
}