/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

.main-content {
    height: 100%;
}

:root {
    --primary-color: #f5f5f5;
    --secondary-color: #e0e0e0;
    --accent-color: #4a90e2;
    --text-color: #333;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    min-height: 100vh;
    overflow: hidden;
}

/* Main Content */
.main-content {
    width: 100%;
    height: 100vh;
    padding: 0;
    margin: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-color);
}

/* Map Container */
.map-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Map Controls */
.map-controls {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
    background-color: #858f99;
    padding: 8px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-control-btn {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 4px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.map-control-btn:hover {
    background-color: #f0f0f0;
    transform: scale(1.05);
}

.map-control-btn:active {
    transform: scale(0.95);
}

.map-control-btn.active {
    background-color: #4CAF50;
    color: white;
}

.map-control-btn i {
    font-size: 16px;
    color: #333;
}

/* Temporary debugging styles for toggle button */
#toggleMarkers {
    background-color: #ff6b6b !important;
    border: 2px solid #333 !important;
}

#toggleMarkers i {
    color: white !important;
    font-size: 18px !important;
}

/* Logo Container */
.logo-container {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 1000;
    background-color: white;
    padding: 8px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.logo {
    height: 85px;
    width: auto;
    display: block;
}

/* Floating Action Button */
.fab-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
}

.fab-button {
    position: relative;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: #2e9d61;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 1001;
}

.fab-button i {
    color: white;
    font-size: 24px;
    transition: transform 0.3s ease;
}

.fab-button.active {
    background-color: #e74c3c;
}

.fab-button.active i {
    transform: rotate(45deg);
}

.fab-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 16px;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1000;
}

.fab-menu.active {
    opacity: 1;
    pointer-events: all;
}

.fab-menu-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    border: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    transform: scale(0);
    opacity: 0;
}

.fab-menu.active .fab-menu-item {
    transform: scale(1);
    opacity: 1;
}

.fab-menu-item i {
    color: var(--accent-color);
    font-size: 18px;
}

.fab-menu-item:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
}

.fab-menu-item:hover i {
    color: white;
}

/* Add animation delays for menu items */
.fab-menu-item:nth-child(1) { transition-delay: 0.1s; }
.fab-menu-item:nth-child(2) { transition-delay: 0.2s; }
.fab-menu-item:nth-child(3) { transition-delay: 0.3s; }
.fab-menu-item:nth-child(4) { transition-delay: 0.4s; }
.fab-menu-item:nth-child(5) { transition-delay: 0.5s; }

/* Responsive Design */
@media (max-width: 768px) {
    body {
        overflow: hidden;
        margin: 0;
        padding: 0;
    }

    .main-content {
        width: 100vw;
        height: 100vh;
        padding: 0;
        margin: 0;
        overflow: hidden;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .map-container {
        width: 100%;
        height: 100%;
        margin: 0;
        border-radius: 0;
    }

    .map-controls {
        top: 10px;
        right: 10px;
        padding: 6px;
    }

    .map-control-btn {
        width: 32px;
        height: 32px;
    }

    .logo-container {
        top: 10px;
        left: 10px;
        padding: 6px;
    }

    .logo {
        height: 32px;
    }

    .search-container {
        top: 60px;
        left: 10px;
        right: 10px;
        width: auto;
    }

    .zoom-level-popup {
        width: 90vw;
        max-width: 300px;
    }
}

/* Responsive adjustments for legend */
@media (max-width: 767px) {
    .map-legend {
        bottom: 70px !important;
        left: 10px;
        padding: 8px;
        min-width: 140px;
    }

    .legend-header h3 {
        font-size: 12px;
    }

    .legend-item span {
        font-size: 11px;
    }

    .legend-color {
        width: 14px;
        height: 14px;
    }

    .fab-container {
        bottom: 65px;
        right: 16px;
    }

    .fab-menu {
        bottom: 90px;
    }

    .fab-menu.active {
        bottom: 90px;
    }

    .fab-menu-item {
        width: 40px;
        height: 40px;
        margin-bottom: 8px;
    }

    .fab-menu-item:last-child {
        margin-bottom: 0;
    }
}

/* Search Container */
.search-container {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 1000;
    display: flex;
    align-items: center;
    background-color: white;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 4px;
    width: 400px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border: 1px solid #ced4da;
}

.search-container.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.search-container:focus-within {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

#searchInput {
    flex: 1;
    border: none;
    padding: 8px 12px;
    font-size: 14px;
    outline: none;
    background: transparent;
    width: calc(100% - 40px);
}

#searchInput:focus {
    outline: none;
}

.search-submit {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    transition: color 0.2s ease;
}

.search-submit:hover {
    color: #2c6cb0;
}

/* Remove old search panel styles */
.search-panel,
.search-panel-content,
.search-header,
.search-input-container,
.search-filters,
.search-results {
    display: none;
}

/* Tower Creation Popup Styles */
.tower-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tower-popup.active {
    display: flex;
    opacity: 1;
}

.tower-popup-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: popupSlideIn 0.3s ease;
}

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

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

.tower-popup-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.close-popup {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #666;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.close-popup:hover {
    color: #333;
}

.tower-form {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-color);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.cancel-btn,
.save-btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cancel-btn {
    background-color: #f8f9fa;
    border: 1px solid #ced4da;
    color: #495057;
}

.save-btn {
    background-color: var(--accent-color);
    border: none;
    color: white;
}

.cancel-btn:hover {
    background-color: #e9ecef;
}

.save-btn:hover {
    background-color: #357abd;
}

.form-group .form-text {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

.form-group input:invalid {
    border-color: #4caf50;
    box-shadow: 0 0 0 2px #4caf5024;
}

.form-group input:invalid + .form-text {
    color: #dc3545;
}

/* Responsive adjustments for the popup */
@media (max-width: 767px) {
    .tower-popup-content {
        width: 95%;
        margin: 10px;
    }

    .tower-form {
        padding: 16px;
    }

    .form-actions {
        flex-direction: column;
    }

    .cancel-btn,
    .save-btn {
        width: 100%;
    }
}

/* Zoom Level Control */
.zoom-level-text {
    font-size: 12px;
    font-weight: 600;
    color: #333333;
}

.zoom-level-popup {
    position: absolute;
    top: 50px;
    right: 10px;
    background-color: #858f99;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 1000;
    display: none;
    min-width: 200px;
}

.zoom-level-popup.active {
    display: block;
    animation: popupSlideIn 0.2s ease;
}

.zoom-level-content h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: white;
    text-align: center;
}

.zoom-level-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.zoom-level-btn {
    padding: 8px;
    border: 1px solid rgb(255, 255, 255);
    border-radius: 4px;
    background-color: rgb(243, 243, 243);
    color: #262627;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zoom-level-btn:hover {
    background-color: rgb(212, 212, 212);
    border-color: #ffffff;
    color: #333333;
}

.zoom-level-btn.active {
    background-color: white;
    color: #858f99;
    border-color: white;
}

/* Map Legend */
.map-legend {
    position: absolute;
    bottom: 80px;
    left: 20px;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 12px;
    z-index: 1000;
    min-width: 126px;
}

.legend-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
}

.legend-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333333;
}

.legend-logo {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.legend-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
}

.legend-color.scoped {
    background-color: #ff4d4d; /* Red */
}

.legend-color.assessed {
    background-color: #ffa726; /* Orange */
}

.legend-color.reported {
    background-color: #8df392; /* Light Green */
}

.legend-color.not-scoped {
    background-color: #e0e0e0; /* Light Gray */
}

.legend-item span {
    font-size: 12px;
    color: #333333;
    font-weight: 500;
}

/* Map Marker Popup Styles */
.leaflet-popup-content .tower-popup-content {
    box-shadow: none;
    padding: 8px;
}

.leaflet-popup-content .tower-popup-content h3 {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #333333;
}

.leaflet-popup-content .tower-popup-content p {
    margin: 4px 0;
    font-size: 12px;
    color: #666666;
}

.leaflet-popup-content .tower-popup-content strong {
    color: #333333;
}

/* Custom Div Icon Styles */
.custom-div-icon {
    background: none;
    border: none;
}

.custom-div-icon i {
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.3);
}

/* Font Awesome Marker Styles */
.fa-marker {
    background: none;
    border: none;
}

.fa-marker::before {
    display: none !important;
    content: none !important;
}
.fa-marker {
    outline: none !important;
    box-shadow: none !important;
}

/* Login Form Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-image: url('login-bg.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgb(22 22 22 / 31%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1;
}

.login-form {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 400px;
    text-align: center;
    position: relative;
    z-index: 2;
}

.login-logo {
    max-width: 200px;
    margin-bottom: 1.5rem;
}

.login-form h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.login-form .form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.login-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.login-form input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.login-form input:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.login-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #44a26e;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.login-btn:hover {
    background-color: #388E3C;
}

.error-message {
    color: #f44336;
    margin-top: 1rem;
    font-size: 0.875rem;
}

/* User Management Styles */
.user-table {
    margin-top: 1rem;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.user-table td, .user-table th {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.user-table tr:last-child td {
    border-bottom: none;
}

.role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.role-admin {
    background-color: #ff9800;
    color: white;
}

.role-manager {
    background-color: #2196F3;
    color: white;
}

.role-user {
    background-color: #4CAF50;
    color: white;
}

.action-btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.edit-btn {
    background-color: #4CAF50;
    color: white;
}

.edit-btn:hover {
    background-color: #388E3C;
}

.delete-btn {
    background-color: #f44336;
    color: white;
}

.delete-btn:hover {
    background-color: #D32F2F;
}

.add-user-btn {
    background-color: #2196F3;
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.add-user-btn:hover {
    background-color: #1976D2;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 2rem;
    width: 90%;
    max-width: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: #666;
    cursor: pointer;
    transition: color 0.2s;
}

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

.modal h2 {
    margin-bottom: 1.5rem;
    color: #333;
}

.modal .form-group {
    margin-bottom: 1rem;
}

.modal label {
    display: block;
    margin-bottom: 0.5rem;
    color: #666;
}

.modal input,
.modal select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.modal input:focus,
.modal select:focus {
    outline: none;
    border-color: #2196F3;
    box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.1);
}

.modal small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.875rem;
}

/* Hide FAB container for view role users */
.fab-container.hidden {
    display: none !important;
}

/* Ensure FAB container is hidden when user has view role */
.fab-container[data-role="view"] {
    display: none !important;
}

/* Hide specific FAB menu items for view role users */
.fab-menu-item[data-role="view"] {
    display: none !important;
}

/* Hide create tower and dashboard buttons for view users */
#createTowerButton[data-role="view"],
#dashboardButton[data-role="view"] {
    display: none !important;
}

/* Logout button styling in FAB menu */
.fab-menu-item.logout-btn {
    background-color: #dc3545 !important;
    color: white !important;
    border: 2px solid #dc3545 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.fab-menu-item.logout-btn:hover {
    background-color: #c82333 !important;
    border-color: #c82333 !important;
    transform: scale(1.1);
}

.fab-menu-item.logout-btn i {
    color: white !important;
}

/* Ensure logout button is visible for view users */
#logoutButton[data-role="view"] {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Hide logout button for admin users */
#logoutButton[data-role="admin"] {
    display: none !important;
}

/* City Label Styles */
.city-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.city-label div {
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    border: none !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    text-align: center !important;
}

.city-label div div:first-child {
    font-weight: bold !important;
    font-size: 14px !important;
    color: #222 !important;
    text-shadow: 2px 2px 4px #fff, 0 0 8px #fff !important;
    margin-bottom: 2px !important;
}

.city-label div div:last-child {
    font-weight: normal !important;
    font-size: 10px !important;
    color: #444 !important;
    text-shadow: 1px 1px 2px #fff, 0 0 4px #fff !important;
}

/* Province Label Styles */
.province-label {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
}

.province-label div {
    font-weight: bold !important;
    font-size: 14px !important;
    color: #222 !important;
    text-shadow: 2px 2px 4px #fff, 0 0 8px #fff !important;
    background: none !important;
    padding: 0 !important;
    border-radius: 0 !important;
    white-space: nowrap !important;
    pointer-events: none !important;
    border: none !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
} 