* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
}

.icon-img {
  width: 15px;
  height: 15px;
  object-fit: contain;
  vertical-align: middle;
  margin-right: 6px; /* spacing between icon and text */
}

/* Left Sidebar */
.sidebar {
    width: 350px;
    max-width: 350px;
    min-width: 280px;
    background: white;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.app-logo {
  height: 75px;   
  margin-right: 5px;
  vertical-align: middle;
}

.sidebar-header {
    padding: 0px 20px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0; 
    padding-bottom: 10px;
}

.search-container {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
    display: flex;
    align-items: center;
}

.search-container .search-icon {
  margin-right: 6px;
}

.clear-icon {
  cursor: pointer;
  margin-left: 6px;
}

.search-input {
    width: 100%;
    max-width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background: #f8f9fa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.search-input:focus {
    border-color: #108531;
    background: white;
}

.search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 16px;
    pointer-events: none;
}

.clear-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    color: #999;
    cursor: pointer;
    display: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.clear-icon:hover {
    color: #333;
}

.search-container.has-text .clear-icon {
    display: block;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 0;
    flex-wrap: wrap;
}

.tab {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    background: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.tab.active {
    background: #347433;
    color: white;
    border-color: #347433;
}

.tab:hover:not(.active) {
    background: #f0f0f0;
}

/* Sidebar Content */
.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 0;
    min-height: 0;
}

.category-section {
    margin-bottom: 24px;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.category-icon {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.location-item {
    display: flex;
    align-items: flex-start;
    padding: 12px 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    border-left: 3px solid transparent;
}

.location-item:hover {
    background: #f8f9fa;
}

.location-item.active {
    background: #e8fde3;
    border-left-color: #347433;
}

.location-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    flex-shrink: 0;
    font-size: 16px;
    color: white;
    font-weight: bold;
}

.location-info {
    flex: 1;
    min-width: 0;
}

.location-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.location-description {
    font-size: 12px;
    color: #666;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    background: #e0e0e0;
    min-width: 0;
}

.map-header {
    background: white;
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    flex-shrink: 0;
}

.map-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    flex-shrink: 0;
}

.map-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: #333;
    white-space: nowrap;
}

.action-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

#map {
    width: 100%;
    height: calc(100vh - 61px);
}

/* Color coding for different categories */
.academic { background: #dabd01; }
.dining { background: #34a853; }
.parking { background: #fbbc04; }
.recreation { background: #9c27b0; }
.administrative { background: #ea4335; }
.library { background: #4285f4; }
.technology { background: #19335b; }
.student-services { background: #34a853; }
.gates {background: #b10f00;}

/* Custom popup styling */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border: none;
    max-width: 300px;
    min-width: 250px;
}

.leaflet-popup-content {
    margin: 16px;
    font-size: 14px;
    line-height: 1.4;
    overflow: hidden;
}

.popup-title {
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 16px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.3;
}

.popup-description {
    color: #666;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: auto;
    font-size: 13px;
}

.popup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.popup-btn {
    padding: 6px 12px;
    background: #347433;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.popup-btn:hover {
    background: #2d5f2a;
}

/* Custom marker styles */
.custom-building-marker {
    background: transparent !important;
    border: none !important;
}

.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

.map-pin.pin1{
  --c:#ff5a5f;
  position: relative;
  width: 20px; height: 20px;
  border-radius: 50% 50% 50% 0;
  border: 4px solid #fff;
  background: var(--c);
  transform: rotate(-45deg);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.map-pin.pin1::after{
  content:"";
  position:absolute;
  width:10px; height:10px;
  border-radius:50%;
  top:50%; left:50%;
  margin:-5px 0 0 -5px;
  background:#fff;
}

.map-pin.pin2{
  --c:#ff5a5f;
  position: relative;
  width: 8px; height: 8px;
  border-radius: 50%;
  border: 8px solid #fff;
  background: var(--c);
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.map-pin.pin2::after{
  content:"";
  position:absolute;
  left:50%; transform:translateX(-50%);
  bottom:-30px;
  width:0; height:0;
  border:10px solid transparent;
  border-top:17px solid #fff;
}

/* subtle hover */
.map-pin:hover{ filter:brightness(1.05); }

/* Hide scrollbar but keep functionality */
.sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.sidebar-content::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* Loading state */
.loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #666;
    font-size: 16px;
    z-index: 1000;
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 12px;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.2s ease;
}

.mobile-menu-toggle:hover {
    background: #f8f9fa;
    border-color: #ccc;
}

.mobile-menu-toggle:active {
    transform: scale(0.95);
}

/* Hamburger icon */
.hamburger {
    width: 20px;
    height: 16px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hamburger span {
    display: block;
    height: 2px;
    width: 100%;
    background: #333;
    border-radius: 1px;
    transition: all 0.3s ease;
}

/* Hamburger animation when sidebar is open */
.sidebar.open ~ .map-container .mobile-menu-toggle .hamburger span:first-child {
    transform: translateY(7px) rotate(45deg);
}

.sidebar.open ~ .map-container .mobile-menu-toggle .hamburger span:nth-child(2) {
    opacity: 0;
}

.sidebar.open ~ .map-container .mobile-menu-toggle .hamburger span:last-child {
    transform: translateY(-7px) rotate(-45deg);
}

/* Backdrop overlay for mobile */
.sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.show {
    display: block;
}

/* Tablet responsiveness (768px and below) */
@media (max-width: 768px) {
    .sidebar {
        width: 320px;
        max-width: 320px;
        min-width: 300px;
    }

    .sidebar-header {
        padding: 12px 16px;
    }

    .sidebar-header h1 {
        font-size: 16px;
        margin-bottom: 12px;
    }

    .search-input {
        font-size: 13px;
        padding: 10px 14px 10px 36px;
    }

    .search-icon {
        left: 12px;
        font-size: 14px;
    }

    .tab {
        padding: 6px 10px;
        font-size: 11px;
    }

    .category-header {
        padding: 6px 16px;
        font-size: 13px;
    }

    .location-item {
        padding: 10px 16px;
    }

    .location-icon {
        width: 32px;
        height: 32px;
        font-size: 14px;
        margin-right: 10px;
    }

    .location-name {
        font-size: 13px;
    }

    .location-description {
        font-size: 11px;
    }

    .map-header {
        padding: 10px 12px;
    }

    .map-title {
        font-size: 15px;
    }

    .action-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }

    #map {
        height: calc(100vh - 53px);
    }
}

/* Mobile responsiveness (480px and below) */
@media (max-width: 480px) {
    .app-container {
        flex-direction: column;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        max-width: 100%;
        height: 100vh;
        transform: translateX(-100%);
        z-index: 1002;
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-header {
        padding: 60px 16px 12px 16px;
    }

    .map-container {
        width: 100%;
        height: 100vh;
    }

    .map-header {
        padding: 60px 12px 8px 60px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .map-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
    }

    #map {
        height: calc(100vh - 95px);
    }

    .category-tabs {
        gap: 2px;
    }

    .tab {
        padding: 5px 8px;
        font-size: 10px;
        flex: 1;
        text-align: center;
    }

    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 60px);
        min-width: calc(100vw - 80px);
    }

    .popup-description {
        max-height: 100px;
        font-size: 12px;
    }

    .popup-title {
        font-size: 14px;
    }

    /* Close button for sidebar */
    .sidebar-close {
        display: block;
        position: absolute;
        top: 16px;
        right: 16px;
        background: #f8f9fa;
        border: 1px solid #e0e0e0;
        border-radius: 6px;
        padding: 8px;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .sidebar-close:hover {
        background: #e9ecef;
    }

    .sidebar-close span {
        display: block;
        width: 16px;
        height: 2px;
        background: #333;
        border-radius: 1px;
        position: relative;
        transform: rotate(45deg);
    }

    .sidebar-close span::after {
        content: '';
        position: absolute;
        width: 16px;
        height: 2px;
        background: #333;
        border-radius: 1px;
        transform: rotate(-90deg);
    }
}

/* Hide close button on desktop */
@media (min-width: 481px) {
    .sidebar-close {
        display: none;
    }
}

/* Very small screens (360px and below) */
@media (max-width: 360px) {
    .sidebar-header h1 {
        font-size: 15px;
    }

    .search-input {
        font-size: 12px;
        padding: 8px 12px 8px 32px;
    }

    .search-icon {
        left: 10px;
        font-size: 13px;
    }

    .location-icon {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }

    .location-name {
        font-size: 12px;
    }

    .location-description {
        font-size: 10px;
    }

    .tab {
        font-size: 9px;
        padding: 4px 6px;
    }

    .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 80px);
        min-width: calc(100vw - 100px);
    }

    .popup-description {
        max-height: 80px;
        font-size: 11px;
    }

    .popup-title {
        font-size: 13px;
    }
}

/* Landscape mobile orientation */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar-header {
        padding: 8px 16px;
    }

    .sidebar-header h1 {
        font-size: 14px;
        margin-bottom: 8px;
    }

    .category-header {
        padding: 4px 16px;
        font-size: 12px;
    }

    .location-item {
        padding: 8px 16px;
    }
}
/* Settings Menu Styles */
        .settings-btn {
            background: #ffffff !important;
            border-color: #dddddd !important;
        }

        .settings-btn:hover {
            background: #eeeff0 !important;
            border-color: #dddddd !important;
        }

        .settings-menu {
            position: absolute;
            top: 60px;
            right: 20px;
            background: white;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            padding: 8px 0;
            min-width: 180px;
            display: none;
            z-index: 1000;
            animation: slideDown 0.2s ease;
        }

        .settings-menu.show {
            display: block;
        }

        @keyframes slideDown {
            from {
                opacity: 0;
                transform: translateY(-10px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .settings-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            cursor: pointer;
            transition: background 0.2s ease;
            color: #000000;
            font-size: 14px;
        }

        .settings-item:hover {
            background: #f8f9fa;
        }

        .settings-icon {
            margin-right: 12px;
            font-size: 16px;
        }

        /* Admin Login Modal Styles */
        .modal-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.6);
            z-index: 2000;
            align-items: center;
            justify-content: center;
            animation: fadeIn 0.3s ease;
        }

        .modal-overlay.show {
            display: flex;
        }

        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }

        .modal-container {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 400px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            animation: slideUp 0.3s ease;
        }

        @keyframes slideUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .modal-header {
            padding: 20px;
            border-bottom: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .modal-header h2 {
            margin: 0;
            font-size: 20px;
            color: #333;
        }

        .modal-close-btn {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .modal-close-btn:hover {
            background: #f0f0f0;
            color: #333;
        }

        .modal-body {
            padding: 30px 20px;
        }

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

        .form-group label {
            display: block;
            margin-bottom: 5px;
            color: #555;
            font-weight: 500;
            font-size: 14px;
        }

        .form-group input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            transition: all 0.3s ease;
        }

        .form-group input:focus {
            outline: none;
            border-color: #347433;
            box-shadow: 0 0 0 3px rgba(52, 116, 51, 0.1);
        }

        .login-btn {
            width: 100%;
            padding: 12px;
            background: #347433;
            color: white;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.3s ease;
        }

        .login-btn:hover {
            background: #2d5f2a;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(52, 116, 51, 0.3);
        }

        .error-message {
            color: #dc3545;
            font-size: 13px;
            margin-bottom: 10px;
            display: none;
            text-align: center;
        }

        .error-message.show {
            display: block;
        }

        /* Mobile Responsive */
        @media (max-width: 480px) {
            .settings-menu {
                right: 10px;
                top: 50px;
            }

            .modal-container {
                width: 95%;
                margin: 0 10px;
            }

            .action-btn {
                padding: 6px 10px;
                font-size: 11px;
            }

            .map-actions {
                gap: 5px;
            }
        }

