/* Home Page (Map) Styles - Redesigned UI */

/* Main Wrapper */
.home-map-wrapper {
    width: 100%;
    height: calc(100vh - 160px);
    position: fixed;
    top: 130px;
    left: 0;
    right: 0;
    bottom: 30px;
    overflow: hidden;
}

.map-with-tabs {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Top Tab Navigation - Floating on top area of map */
.home-top-tabs {
    position: fixed;
    top: 145px;
    left: 380px;
    right: 15px;
    z-index: 1000;
    display: flex;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.home-top-tabs .tab-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: white;
    color: #666;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-right: 1px solid #e0e0e0;
    outline: none;
    position: relative;
}

.home-top-tabs .tab-btn:last-child {
    border-right: none;
}

.home-top-tabs .tab-btn:hover {
    background: #f8f9fa;
}

.home-top-tabs .tab-btn i {
    font-size: 1rem;
}

/* Tab Active States with specific colors */
.home-top-tabs .tab-btn.events-tab.active {
    background: #ffebee;
    color: #c62828;
}

.home-top-tabs .tab-btn.events-tab.active i {
    color: #c62828;
}

.home-top-tabs .tab-btn.elderly-tab.active {
    background: #fce4ec;
    color: #c2185b;
}

.home-top-tabs .tab-btn.elderly-tab.active i {
    color: #c2185b;
}

.home-top-tabs .tab-btn.staff-tab.active {
    background: #e3f2fd;
    color: #1976d2;
}

.home-top-tabs .tab-btn.staff-tab.active i {
    color: #1976d2;
}

.home-top-tabs .tab-btn.hospital-tab.active {
    background: #e8f5e9;
    color: #388e3c;
}

.home-top-tabs .tab-btn.hospital-tab.active i {
    color: #388e3c;
}

.home-top-tabs .tab-btn.center-tab.active {
    background: #fff3e0;
    color: #f57c00;
}

.home-top-tabs .tab-btn.center-tab.active i {
    color: #f57c00;
}

/* Map Sidebar - Floating on left side */
.map-sidebar {
    position: fixed;
    top: 145px;
    left: 15px;
    width: 340px;
    max-height: calc(100vh - 240px);
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sidebar-header {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    flex-shrink: 0;
}

.sidebar-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.btn-refresh {
    padding: 6px 12px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-refresh:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-cases {
    padding: 6px 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-cases:hover {
    background: #5a6268;
    transform: scale(1.05);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

/* Event List */
.event-list {
    padding: 8px;
}

.event-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    margin-bottom: 6px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.event-item.alert-item {
    background: #ffebee;
}

.event-item:hover {
    background: #ffcdd2;
    transform: translateX(4px);
}

.event-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ef5350;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.event-info {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 0.8rem;
    color: #333;
    font-weight: 500;
    line-height: 1.3;
    margin-bottom: 2px;
}

.event-time {
    font-size: 0.75rem;
    color: #666;
}

/* User List */
.user-list {
    padding: 8px;
}

.user-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 5px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
}

.user-list-item:hover {
    background: #e9ecef;
    transform: translateX(4px);
}

.user-list-item.active {
    background: #d1ecf1;
    border-left: 4px solid #0c5460;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.user-avatar.elderly-avatar {
    background: #e91e63;
}

.user-avatar.staff-avatar {
    background: #2196f3;
}

.user-avatar.medical-avatar {
    background: #ff9800;
}

.user-avatar.hospital-avatar {
    background: #4caf50;
}

.user-avatar.emergency-avatar {
    background: #f44336;
}

.user-avatar.default-avatar {
    background: #9e9e9e;
}

.user-details {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-location {
    font-size: 0.7rem;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-age {
    font-size: 0.75rem;
    color: #666;
    white-space: nowrap;
}

.user-actions-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-open-case {
    padding: 6px 10px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.btn-open-case:hover {
    background: #218838;
    transform: scale(1.1);
}

/* Hospital List */
.hospital-list {
    padding: 8px;
}

.hospital-item {
    display: flex;
    gap: 10px;
    padding: 10px;
    margin-bottom: 8px;
    background: #f1f8f4;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.hospital-item:hover {
    background: #d4edda;
    transform: translateX(4px);
}

.hospital-icon {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    background: #4caf50;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.hospital-info {
    flex: 1;
}

.hospital-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.hospital-address {
    font-size: 0.7rem;
    color: #666;
    line-height: 1.3;
    margin-bottom: 3px;
}

.hospital-hours {
    font-size: 0.7rem;
    color: #28a745;
    font-weight: 500;
}

/* Filter Counts */
.filter-counts {
    padding: 10px 12px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
}

.filter-count-title {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 8px;
}

.filter-count-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-count-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: #333;
}

.filter-count-item i {
    font-size: 0.7rem;
}

.filter-count-item.elderly-count i {
    color: #e91e63;
}

.filter-count-item.staff-count i {
    color: #2196f3;
}

.filter-count-item.medical-count i {
    color: #ff9800;
}

.filter-count-item.hospital-count i {
    color: #4caf50;
}

.filter-count-item.emergency-count i {
    color: #f44336;
}

/* View All Button */
.btn-view-all {
    width: calc(100% - 16px);
    padding: 8px;
    margin: 8px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-view-all:hover {
    background: #c3e6cb;
}

/* Map Container Full */
.map-container-full {
    width: 100%;
    height: 100%;
    position: relative;
}

/* Map Filter Bar - Bottom */
.map-filter-bar {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 12px 24px;
    border-radius: 50px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 998;
}

.filter-label {
    font-weight: 600;
    color: #333;
    font-size: 0.85rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #333;
}

.filter-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.marker-icon {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.marker-icon.elderly {
    background: #dc3545;
}

.marker-icon.staff {
    background: #2196f3;
}

.marker-icon.medical {
    background: #ff9800;
}

.marker-icon.hospital {
    background: #4caf50;
}

.marker-icon.emergency {
    background: #f44336;
}

/* Scrollbar Styling */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .map-sidebar {
        width: 300px;
    }

    .home-top-tabs {
        left: 330px;
    }
}

@media (max-width: 992px) {
    .map-sidebar {
        width: 280px;
        max-height: calc(100vh - 140px);
    }

    .home-top-tabs {
        left: 310px;
    }

    .home-top-tabs .tab-btn {
        padding: 8px 12px;
        font-size: 0.8rem;
        gap: 4px;
    }

    .home-top-tabs .tab-btn i {
        font-size: 0.9rem;
    }
}

@media (max-width: 768px) {
    .map-sidebar {
        left: -350px;
        transition: left 0.3s ease;
        top: 15px;
    }

    .map-sidebar.open {
        left: 15px;
    }

    .home-top-tabs {
        left: 15px;
        right: 15px;
        top: 15px;
    }

    .home-top-tabs .tab-btn {
        flex: 0 0 auto;
        min-width: 120px;
        font-size: 0.75rem;
        padding: 8px 10px;
    }

    .map-filter-bar {
        bottom: 15px;
        padding: 12px 20px;
        gap: 15px;
        max-width: 90%;
    }
}

@media (max-width: 576px) {
    .home-top-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        gap: 0;
    }

    .home-top-tabs .tab-btn {
        min-width: 120px;
        font-size: 0.8rem;
    }

    .map-filter-bar {
        flex-direction: column;
        align-items: flex-start;
        border-radius: 15px;
        padding: 10px 15px;
    }

    .filter-label {
        font-size: 0.85rem;
    }

    .filter-item {
        font-size: 0.8rem;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.event-item,
.user-list-item,
.hospital-item {
    animation: slideIn 0.2s ease-out;
}
