* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 14px; /* Reduced from 16px for more compact layout */
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif; /* More professional font stack */
    line-height: 1.5; /* Reduced from 1.6 for compactness */
    color: #334155; /* More professional color */
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%); /* More subtle professional gradient */
    min-height: 100vh;
}

/* ===== VARIABLES ===== */
:root {
    --primary-color: #2563eb; /* More professional blue */
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b; /* Professional gray-blue */
    --accent-color: #f59e0b; /* Professional amber */
    --danger-color: #dc2626;
    --warning-color: #f59e0b;
    --success-color: #059669; /* Professional green */
    --dark-color: #1e293b; /* Darker for better contrast */
    --light-color: #f8fafc;
    --border-color: #e2e8f0; /* Lighter, more professional */
    --shadow: 0 1px 3px rgba(0,0,0,0.08); /* Lighter shadows */
    --shadow-hover: 0 4px 12px rgba(0,0,0,0.12);
    --border-radius: 6px; /* Slightly reduced for modern look */
    --transition: all 0.2s ease; /* Faster for snappier feel */
    --header-height: 56px; /* Reduced from 70px */
    --sidebar-width: 260px; /* Reduced from 280px */
}

/* ===== AUTHENTICATION STYLES ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px; /* Reduced from 20px */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 32px; /* Reduced from 40px */
    width: 100%;
    max-width: 420px; /* Reduced from 450px */
    animation: slideInUp 0.4s ease-out; /* Slightly faster */
}

.auth-header {
    text-align: center;
    margin-bottom: 24px; /* Reduced from 30px */
}

.auth-logo {
    width: 64px; /* Reduced from 80px */
    height: 64px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px; /* Reduced from 20px */
    font-size: 1.5rem; /* Reduced from 2rem */
    color: white;
    font-weight: bold;
}

.auth-title {
    font-size: 1.5rem; /* Reduced from 1.8rem */
    color: var(--dark-color);
    margin-bottom: 8px; /* Reduced from 10px */
}

.auth-subtitle {
    color: #64748b; /* Updated color */
    font-size: 0.875rem; /* Reduced from 0.95rem */
}

.form-group {
    margin-bottom: 16px; /* Reduced from 20px */
}

.form-label {
    display: block;
    margin-bottom: 6px; /* Reduced from 8px */
    font-weight: 500; /* Reduced from 600 for subtlety */
    color: var(--dark-color);
}

.form-input {
    width: 100%;
    padding: 10px 12px; /* Reduced from 12px 16px */
    border: 1px solid var(--border-color); /* Reduced from 2px */
    border-radius: var(--border-radius);
    font-size: 0.875rem; /* Reduced from 1rem */
    transition: var(--transition);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); /* Updated color and reduced spread */
}

.form-input.error {
    border-color: var(--danger-color);
}

.form-textarea {
    resize: vertical;
    min-height: 72px; /* Reduced from 80px */
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 10px center; /* Reduced from 12px */
    background-repeat: no-repeat;
    background-size: 14px; /* Reduced from 16px */
    padding-right: 36px; /* Reduced from 40px */
}

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
    margin: 12px 0; /* Reduced from 15px */
}

.form-checkbox input[type="checkbox"] {
    width: 16px; /* Reduced from 18px */
    height: 16px;
    accent-color: var(--primary-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px; /* Reduced from 8px */
    padding: 10px 20px; /* Reduced from 12px 24px */
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem; /* Reduced from 1rem */
    font-weight: 500; /* Reduced from 600 for more professional look */
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color); /* Updated to new professional color */
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
    transform: translateY(-1px); /* Reduced from -2px */
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: var(--secondary-color); /* Updated color */
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #475569; /* Darker variant */
    transform: translateY(-1px); /* Reduced from -2px */
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #b91c1c;
    transform: translateY(-1px); /* Reduced from -2px */
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary-color); /* Reduced from 2px */
    color: var(--primary-color);
}

.btn-outline:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 6px 12px; /* Reduced from 8px 16px */
    font-size: 0.8125rem; /* Reduced from 0.9rem */
}

.btn-large {
    padding: 12px 24px; /* Reduced from 16px 32px */
    font-size: 0.9375rem; /* Reduced from 1.1rem */
}

.auth-divider {
    text-align: center;
    margin: 24px 0; /* Reduced from 30px */
    position: relative;
    color: #64748b; /* Updated color */
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.auth-divider span {
    background: white;
    padding: 0 12px; /* Reduced from 15px */
}

.auth-links {
    text-align: center;
    margin-top: 20px; /* Reduced from 25px */
}

.auth-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500; /* Reduced from 600 */
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background: #fef2f2;
    color: var(--danger-color);
    padding: 10px; /* Reduced from 12px */
    border-radius: var(--border-radius);
    margin-bottom: 16px; /* Reduced from 20px */
    border-left: 3px solid var(--danger-color); /* Reduced from 4px */
}

.success-message {
    background: #f0fdf4;
    color: var(--success-color);
    padding: 10px; /* Reduced from 12px */
    border-radius: var(--border-radius);
    margin-bottom: 16px; /* Reduced from 20px */
    border-left: 3px solid var(--success-color); /* Reduced from 4px */
}

/* ===== MAIN APPLICATION STYLES ===== */
.app-container {
    min-height: 100vh;
    background: #f8fafc; /* Lighter, more professional */
}

.header {
    background: white;
    box-shadow: var(--shadow);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px; /* Reduced from 20px */
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 15px */
    font-size: 1.125rem; /* Reduced from 1.2rem */
    font-weight: 600; /* Changed from bold for professionalism */
    color: var(--dark-color);
}

.header-logo-icon {
    width: 36px; /* Reduced from 40px */
    height: 36px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 20px */
}

.header-user {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
    position: relative;
}

.user-avatar {
    width: 32px; /* Reduced from 35px */
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.user-avatar:hover {
    transform: scale(1.05); /* Reduced from 1.1 */
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    min-width: 180px; /* Reduced from 200px */
    padding: 8px 0; /* Reduced from 10px */
    margin-top: 8px; /* Reduced from 10px */
    display: none;
    z-index: 1001;
}

.user-menu.show {
    display: block;
    animation: slideInDown 0.2s ease-out; /* Faster animation */
}

.user-menu-item {
    display: block;
    padding: 10px 16px; /* Reduced from 12px 20px */
    color: var(--dark-color);
    text-decoration: none;
    transition: var(--transition);
}

.user-menu-item:hover {
    background: var(--light-color);
}

.main-content {
    margin-top: var(--header-height);
    display: flex;
    min-height: calc(100vh - var(--header-height));
    position: relative;
}

/* ===== COMPACT PROFESSIONAL SIDEBAR STYLES ===== */
.sidebar {
    width: var(--sidebar-width);
    background: white;
    box-shadow: 1px 0 3px rgba(0,0,0,0.06); /* Lighter shadow */
    padding: 12px; /* Reduced from 16px */
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: var(--header-height);
    bottom: 0;
    z-index: 999;
    transform: translateX(0);
    transition: var(--transition);
    border-right: 1px solid #e5e7eb;
}

/* Enhanced scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
    width: 3px; /* Reduced from 4px */
}

.sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 1.5px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 1.5px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* When sidebar is explicitly hidden */
.sidebar.hidden {
    transform: translateX(-100%);
}

.sidebar-toggle {
    display: none; /* Hide by default on desktop */
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px; /* Reduced from 10px */
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1001;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    font-size: 0.875rem; /* Reduced from 1rem */
    line-height: 1;
}

.sidebar-toggle:hover {
    background: var(--primary-dark);
}

/* Compact section styling */
.sidebar-section {
    margin-bottom: 16px; /* Reduced from 20px */
}

.sidebar-section h3 {
    color: var(--dark-color);
    margin-bottom: 10px; /* Reduced from 12px */
    padding: 6px 8px 6px 0; /* More compact padding */
    border-bottom: 1px solid #e5e7eb; /* Thinner, lighter border */
    font-size: 0.8125rem; /* Reduced from 0.95rem */
    font-weight: 600;
    position: sticky;
    top: 0;
    background: white;
    z-index: 10;
    text-transform: uppercase;
    letter-spacing: 0.025em; /* Reduced from 0.5px */
}

/* Professional dividers */
.sidebar-section:not(:last-child)::after {
    content: '';
    display: block;
    height: 1px;
    background: linear-gradient(90deg, #e5e7eb 0%, transparent 100%);
    margin-top: 12px; /* Reduced from 16px */
}

/* Compact project list */
.project-list {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 6px */
}

/* More professional project item styling */
.project-item {
    background: #fafbfc;
    border: 1px solid #e1e5e9;
    border-radius: 4px; /* Reduced from 6px */
    padding: 10px; /* Reduced from 12px */
    cursor: pointer;
    transition: var(--transition);
    border-left: 2px solid #e1e5e9; /* Reduced from 3px */
    margin-bottom: 0; /* Remove margin, use gap instead */
    position: relative;
}

.project-item:hover {
    background: #f0f9ff;
    border-color: #bfdbfe;
    border-left-color: var(--primary-color);
    transform: translateX(1px); /* Reduced from 2px */
    box-shadow: 0 1px 4px rgba(0,0,0,0.06); /* Reduced shadow */
}

.project-item.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    border-left-color: var(--primary-dark);
    transform: translateX(1px); /* Reduced from 2px */
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2); /* Updated color and reduced shadow */
}

.project-item.active .project-actions .btn-icon {
    color: rgba(255, 255, 255, 0.8);
}

.project-item.active .project-actions .btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* Compact project header */
.project-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px; /* Reduced from 6px */
}

.project-header h4 {
    margin: 0;
    font-size: 0.8125rem; /* Reduced from 0.9rem */
    line-height: 1.2; /* Reduced from 1.3 */
    flex: 1;
    min-width: 0;
    font-weight: 600;
}

.project-item h4 {
    margin-bottom: 4px; /* Reduced from 5px */
    font-size: 0.875rem; /* Reduced from 1rem */
}

.project-item p {
    font-size: 0.75rem; /* Reduced from 0.85rem */
    opacity: 0.8;
    margin-bottom: 4px; /* Reduced from 5px */
}

/* Compact project description */
.project-description {
    font-size: 0.75rem; /* Reduced from 0.8rem */
    opacity: 0.85;
    margin: 3px 0; /* Reduced from 4px */
    line-height: 1.2; /* Reduced from 1.3 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Compact location styling */
.project-location {
    font-size: 0.6875rem; /* Reduced from 0.75rem */
    margin: 4px 0; /* Reduced from 6px */
    opacity: 0.9;
    font-weight: 500;
}

.project-location::before {
    content: "📍 ";
    font-size: 0.625rem; /* Reduced from 0.7rem */
}

/* More compact statistics */
.project-stats {
    display: flex;
    gap: 6px; /* Reduced from 8px */
    font-size: 0.625rem; /* Reduced from 0.7rem */
    margin: 6px 0; /* Reduced from 8px */
    flex-wrap: wrap;
}

.stat-item {
    background: rgba(0, 0, 0, 0.08);
    padding: 1px 4px; /* Reduced from 2px 6px */
    border-radius: 6px; /* Reduced from 8px */
    white-space: nowrap;
    font-weight: 500;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.project-item.active .stat-item {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
}

/* Compact metadata */
.project-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.625rem; /* Reduced from 0.65rem */
    opacity: 0.75;
    margin-top: 4px; /* Reduced from 6px */
    gap: 6px; /* Reduced from 8px */
    font-weight: 500;
}

.project-meta small {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* More subtle action buttons */
.project-actions {
    display: flex;
    gap: 3px; /* Reduced from 4px */
    opacity: 0;
    transition: var(--transition);
    flex-shrink: 0;
    margin-left: 6px; /* Reduced from 8px */
}

.project-item:hover .project-actions {
    opacity: 1;
}

.project-item.active .project-actions {
    opacity: 0.9;
}

.btn-icon {
    background: none;
    border: none;
    padding: 3px; /* Reduced from 4px */
    cursor: pointer;
    border-radius: 2px; /* Reduced from 3px */
    font-size: 0.75rem; /* Reduced from 0.8rem */
    transition: var(--transition);
    color: #6b7280;
}

.btn-icon:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--dark-color);
}

.map-container {
    flex: 1;
    margin-left: var(--sidebar-width); /* Always show margin on desktop */
    position: relative;
    background: white;
    transition: var(--transition);
}

.map-container.sidebar-hidden {
    margin-left: 0;
}

#map {
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: #f0f0f0;
}

.map-controls {
    position: absolute;
    top: 16px; /* Reduced from 20px */
    right: 16px; /* Reduced from 20px */
    display: flex;
    flex-direction: column;
    gap: 8px; /* Reduced from 10px */
    z-index: 500;
}

/* Enhanced Legend Styles - Add this to your style.css */
.map-legend {
    position: absolute;
    bottom: 16px; /* Reduced from 20px */
    left: 16px; /* Reduced from 20px */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    padding: 12px; /* Reduced from 15px */
    box-shadow: var(--shadow-hover);
    z-index: 500;
    max-width: 200px; /* Reduced from 220px */
    max-height: 360px; /* Reduced from 400px */
    overflow-y: auto;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.legend-title {
    font-weight: 600;
    margin-bottom: 8px; /* Reduced from 10px */
    color: var(--primary-color);
    font-size: 0.8125rem; /* Reduced from 0.9rem */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px; /* Reduced from 5px */
    text-transform: uppercase;
    letter-spacing: 0.025em; /* Reduced from 0.5px */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
    margin-bottom: 6px; /* Reduced from 8px */
    font-size: 0.75rem; /* Reduced from 0.8rem */
    color: var(--dark-color);
}

.legend-line {
    min-width: 18px; /* Reduced from 20px */
    height: 3px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Ensure dashed/dotted lines display correctly */
.legend-line-dashed {
    border-top-style: dashed !important;
    background: transparent !important;
    height: 1px !important;
}

.legend-line-dotted {
    border-top-style: dotted !important;
    background: transparent !important;
    height: 1px !important;
}

.legend-line-dash-dot {
    border-top-style: dashed !important;
    background: transparent !important;
    height: 1px !important;
}

.legend-line-solid {
    border: none !important;
}

.legend-icon {
    flex-shrink: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Ensure legend colors override any existing styles */
.legend-item .legend-line[style],
.legend-item .legend-icon[style] {
    /* This ensures inline styles take precedence */
}

/* Legend responsiveness */
@media (max-width: 768px) {
    .map-legend {
        bottom: 8px; /* Reduced from 10px */
        left: 8px; /* Reduced from 10px */
        right: 8px; /* Reduced from 10px */
        max-width: none;
        max-height: 180px; /* Reduced from 200px */
    }
    
    .legend-item {
        font-size: 0.6875rem; /* Reduced from 0.75rem */
        margin-bottom: 5px; /* Reduced from 6px */
    }
    
    .legend-title {
        font-size: 0.75rem; /* Reduced from 0.8rem */
    }
}

/* ===== MODAL STYLES ===== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    animation: fadeIn 0.2s ease-out; /* Faster animation */
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px; /* Reduced from 20px */
}

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    max-width: 540px; /* Reduced from 600px */
    width: 100%;
    max-height: 85vh; /* Reduced from 90vh */
    overflow-y: auto;
    box-shadow: var(--shadow-hover);
    animation: slideInUp 0.3s ease-out; /* Faster animation */
}

.modal-header {
    padding: 16px 20px; /* Reduced from 20px 25px */
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.25rem; /* Reduced from 1.4rem */
    color: var(--dark-color);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.25rem; /* Reduced from 1.5rem */
    color: #64748b; /* Updated color */
    cursor: pointer;
    padding: 4px; /* Reduced from 5px */
    border-radius: 50%;
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--light-color);
    color: var(--danger-color);
}

.modal-body {
    padding: 20px; /* Reduced from 25px */
}

.modal-footer {
    padding: 16px 20px; /* Reduced from 20px 25px */
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 8px; /* Reduced from 10px */
}

/* ===== CUSTOM MAP MARKERS ===== */
.custom-site-marker {
    border: none !important;
    background: transparent !important;
}

.site-marker {
    width: 28px; /* Reduced from 30px */
    height: 28px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem; /* Reduced from 14px */
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
}

.site-marker:hover {
    transform: scale(1.15); /* Reduced from 1.2 */
    z-index: 1000;
}

/* Existing Site Types */
.site-marker.exchange { background: var(--success-color); } /* Updated to use variable */
.site-marker.bts { background: var(--primary-color); } /* Updated to use variable */
.site-marker.msc { background: var(--accent-color); } /* Updated to use variable */
.site-marker.bsc { background: #9C27B0; }
.site-marker.repeater { background: #607D8B; }
.site-marker.node { background: #795548; }
.site-marker.hub { background: #E91E63; }

/* Data Center and others already added */
.site-marker.data-center { background: #3F51B5; }
.site-marker.switch { background: #009688; }
.site-marker.router { background: #FF5722; }
.site-marker.antenna { background: #8BC34A; }
.site-marker.satellite-dish { background: #FFC107; }

/* MAAN Nodes */
.site-marker.c1-maan { background: #9C27B0; }
.site-marker.b3-maan { background: #8E24AA; }
.site-marker.b4-maan { background: #7B1FA2; }
.site-marker.a3-maan { background: #6A1B9A; }
.site-marker.a4-maan { background: #4A148C; }

/* CPAN Nodes */
.site-marker.a1-cpan { background: #009688; }
.site-marker.a2-cpan { background: #00897B; }
.site-marker.b1-cpan { background: #00796B; }
.site-marker.b2-cpan { background: #00695C; }

/* Optical/Access Equipment */
.site-marker.dslam { background: #546E7A; }
.site-marker.olt { background: #3F51B5; }
.site-marker.onu-ont { background: #5C6BC0; }

/* Routers */
.site-marker.pe-routers { background: #1B5E20; }
.site-marker.p-routers { background: #2E7D32; }
.site-marker.lsr { background: #43A047; }

.site-marker.active { animation: pulse 2s infinite; }
.site-marker.inactive { opacity: 0.5; filter: grayscale(100%); }
.site-marker.maintenance { border-color: var(--warning-color); }

.site-marker.selected {
    transform: scale(1.25); /* Reduced from 1.3 */
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.5); /* Updated color and reduced spread */
}

/* ===== POPUP STYLES ===== */
.leaflet-popup-content-wrapper {
    border-radius: var(--border-radius) !important;
    box-shadow: var(--shadow-hover) !important;
}

.popup-content {
    min-width: 220px; /* Reduced from 250px */
}

.popup-content h4 {
    color: var(--primary-color);
    margin-bottom: 8px; /* Reduced from 10px */
    font-size: 1rem; /* Reduced from 1.1rem */
}

.popup-content p {
    margin-bottom: 6px; /* Reduced from 8px */
    font-size: 0.8125rem; /* Reduced from 0.9rem */
}

.popup-buttons {
    display: flex;
    gap: 6px; /* Reduced from 8px */
    margin-top: 12px; /* Reduced from 15px */
}

.popup-btn {
    padding: 5px 10px; /* Reduced from 6px 12px */
    font-size: 0.75rem; /* Reduced from 0.8rem */
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 3px; /* Reduced from 4px */
}

.popup-btn-edit {
    background: var(--secondary-color); /* Updated color */
    color: white;
}

.popup-btn-edit:hover {
    background: #475569; /* Updated hover color */
}

.popup-btn-delete {
    background: var(--danger-color);
    color: white;
}

.popup-btn-delete:hover {
    background: #b91c1c; /* Updated hover color */
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
}

.status-active { background: var(--success-color); }
.status-inactive { background: var(--danger-color); }
.status-maintenance { background: var(--warning-color); }
.status-planned { background: #9E9E9E; }

/* ===== CONTEXT MENU ===== */
.context-menu {
    position: absolute;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    min-width: 160px; /* Reduced from 180px */
    padding: 4px 0; /* Reduced from 5px */
    z-index: 2001;
    animation: slideInUp 0.15s ease-out; /* Faster animation */
}

.context-menu-item {
    display: block;
    padding: 10px 16px; /* Reduced from 12px 20px */
    color: var(--dark-color);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.8125rem; /* Reduced from 0.9rem */
}

.context-menu-item:hover {
    background: var(--light-color);
    color: var(--primary-color);
}

/* ===== NOTIFICATIONS ===== */
.notification {
    position: fixed;
    top: 70px; /* Reduced from 90px */
    right: 16px; /* Reduced from 20px */
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    padding: 12px 16px; /* Reduced from 15px 20px */
    max-width: 360px; /* Reduced from 400px */
    z-index: 2000;
    border-left: 3px solid var(--success-color); /* Reduced from 4px */
    animation: slideInRight 0.3s ease-out; /* Faster animation */
    transition: var(--transition);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

.notification.info {
    border-left-color: var(--secondary-color); /* Updated color */
}

.notification-close {
    position: absolute;
    top: 8px; /* Reduced from 10px */
    right: 12px; /* Reduced from 15px */
    background: none;
    border: none;
    font-size: 1.125rem; /* Reduced from 1.2rem */
    color: #64748b; /* Updated color */
    cursor: pointer;
}

/* ===== LOADING STATES ===== */
.loading {
    display: inline-flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
}

.spinner {
    width: 16px; /* Reduced from 20px */
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    flex-direction: column;
    gap: 16px; /* Reduced from 20px */
    backdrop-filter: blur(2px);
}

.loading-text {
    font-size: 1rem; /* Reduced from 1.1rem */
    color: var(--dark-color);
    margin-top: 12px; /* Reduced from 15px */
    font-weight: 500; /* Reduced from 600 */
    color: var(--primary-color);
}

/* Export Options Styling */
.export-options {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Reduced from 15px */
    margin: 16px 0; /* Reduced from 20px */
}

.export-option {
    display: flex;
    align-items: center;
    gap: 12px; /* Reduced from 15px */
    padding: 12px; /* Reduced from 15px */
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.export-option:hover {
    border-color: var(--primary-color);
    background: var(--light-color);
}

.export-icon {
    font-size: 1.75rem; /* Reduced from 2rem */
    width: 44px; /* Reduced from 50px */
    text-align: center;
}

.export-info h4 {
    margin: 0 0 4px 0; /* Reduced from 5px */
    color: var(--dark-color);
}

.export-info p {
    margin: 0;
    color: #64748b; /* Updated color */
    font-size: 0.8125rem; /* Reduced from 0.9rem */
}

/* Professional current project stats */
#currentProjectStats {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 4px; /* Reduced from 6px */
    padding: 10px; /* Reduced from 12px */
    margin-bottom: 12px; /* Reduced from 16px */
    border: 1px solid #e2e8f0;
}

#currentProjectStats h3 {
    color: var(--primary-color);
    margin-bottom: 8px; /* Reduced from 10px */
    font-size: 0.8125rem; /* Reduced from 0.9rem */
    padding-bottom: 4px; /* Reduced from 6px */
    border-bottom: 1px solid #cbd5e0;
}

/* Compact stats grid */
.stats-grid {
    display: grid;
    gap: 4px; /* Reduced from 6px */
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0; /* Reduced from 6px */
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.75rem; /* Reduced from 0.8rem */
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item strong {
    color: var(--dark-color);
    font-weight: 600;
}

.stat-item span {
    font-weight: 600;
    color: var(--primary-color);
    background: rgba(37, 99, 235, 0.1); /* Updated color */
    padding: 1px 4px; /* Reduced from 2px 6px */
    border-radius: 3px; /* Reduced from 4px */
    font-size: 0.6875rem; /* Reduced from 0.75rem */
}

/* Compact control group */
.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px; /* Reduced from 8px */
}

/* Compact action buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 6px */
}

.action-buttons .btn {
    padding: 6px 12px; /* Reduced from 8px 16px */
    font-size: 0.8125rem; /* Reduced from 0.85rem */
    font-weight: 500;
}

/* Empty state styling */
.empty-state {
    text-align: center;
    padding: 24px 12px; /* Reduced from 32px 16px */
    color: #6b7280;
}

.empty-icon {
    font-size: 2rem; /* Reduced from 2.5rem */
    margin-bottom: 10px; /* Reduced from 12px */
    opacity: 0.6;
}

.empty-state p {
    margin-bottom: 6px; /* Reduced from 8px */
    line-height: 1.3; /* Reduced from 1.4 */
    font-size: 0.8125rem; /* Reduced from 0.85rem */
}

/* Connection Mode Indicator */
.map-container.connection-mode {
    position: relative;
}

.map-container.connection-mode::before {
    content: 'Connection Mode Active - Click sites to connect them';
    position: absolute;
    top: 60px; /* Reduced from 70px */
    left: 50%;
    transform: translateX(-50%);
    background: var(--warning-color);
    color: white;
    padding: 8px 16px; /* Reduced from 10px 20px */
    border-radius: var(--border-radius);
    z-index: 1000;
    font-weight: bold;
    box-shadow: var(--shadow);
}

/* Auto-save Indicator */
.auto-save-indicator {
    position: fixed;
    bottom: 16px; /* Reduced from 20px */
    right: 16px; /* Reduced from 20px */
    background: var(--success-color);
    color: white;
    padding: 8px 12px; /* Reduced from 10px 15px */
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(16px); /* Reduced from 20px */
    transition: all 0.3s ease;
    z-index: 1000;
}

.auto-save-indicator.show {
    opacity: 1;
    transform: translateY(0);
}

/* Welcome Notification */
.welcome-notification {
    animation: slideInUp 0.4s ease-out; /* Faster animation */
}

/* Registration Page Specific Styles */
.form-section {
    margin-bottom: 24px; /* Reduced from 30px */
    padding: 16px; /* Reduced from 20px */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: #fafafa;
}

.section-title {
    color: var(--primary-color);
    margin: 0 0 16px 0; /* Reduced from 20px */
    padding-bottom: 8px; /* Reduced from 10px */
    border-bottom: 1px solid var(--border-color); /* Reduced from 2px */
    font-size: 1rem; /* Reduced from 1.1rem */
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px; /* Reduced from 20px */
    margin-bottom: 12px; /* Reduced from 15px */
}

.form-help {
    display: block;
    font-size: 0.75rem; /* Reduced from 0.8rem */
    color: #64748b; /* Updated color */
    margin-top: 4px; /* Reduced from 5px */
}

.field-error {
    display: block;
    font-size: 0.75rem; /* Reduced from 0.8rem */
    color: var(--danger-color);
    margin-top: 4px; /* Reduced from 5px */
}

.form-input.error {
    border-color: var(--danger-color);
    background: #fff5f5;
}

.form-input.success {
    border-color: var(--success-color);
    background: #f0fff4;
}

.password-strength {
    margin-top: 6px; /* Reduced from 8px */
}

.strength-bar {
    width: 100%;
    height: 3px; /* Reduced from 4px */
    background: #eee;
    border-radius: 1.5px; /* Reduced from 2px */
    overflow: hidden;
    margin-bottom: 4px; /* Reduced from 5px */
}

.strength-fill {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 1.5px; /* Reduced from 2px */
}

.terms-section {
    background: white;
    padding: 16px; /* Reduced from 20px */
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color); /* Reduced from 4px */
}

.auth-help {
    margin-top: 24px; /* Reduced from 30px */
    padding: 16px; /* Reduced from 20px */
    background: #f8f9fa;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.help-section h4 {
    color: var(--primary-color);
    margin: 0 0 12px 0; /* Reduced from 15px */
}

.contact-info {
    margin-top: 12px; /* Reduced from 15px */
}

.contact-info p {
    margin: 4px 0; /* Reduced from 5px */
    font-size: 0.8125rem; /* Reduced from 0.9rem */
}

.contact-info a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-info a:hover {
    text-decoration: underline;
}

.terms-content, .privacy-content {
    max-height: 55vh; /* Reduced from 60vh */
    overflow-y: auto;
    padding: 16px; /* Reduced from 20px */
    line-height: 1.5; /* Reduced from 1.6 */
}

.terms-content h3, .privacy-content h3 {
    color: var(--primary-color);
    margin-bottom: 16px; /* Reduced from 20px */
}

.terms-content h4, .privacy-content h4 {
    color: var(--dark-color);
    margin: 16px 0 8px 0; /* Reduced from 20px 0 10px 0 */
}

.terms-content ul, .privacy-content ul {
    margin: 8px 0 8px 16px; /* Reduced from 10px 0 10px 20px */
}

.terms-content li, .privacy-content li {
    margin: 4px 0; /* Reduced from 5px */
}

/* Search Box Styles */
.search-container {
    position: relative;
    margin: 0 12px; /* Reduced from 15px */
    flex: 1;
    max-width: 280px; /* Reduced from 300px */
}

.search-input {
    width: 100%;
    padding: 6px 10px 6px 30px; /* Reduced from 8px 12px 8px 35px */
    border: 1px solid #ddd;
    border-radius: 18px; /* Reduced from 20px */
    font-size: 0.8125rem; /* Reduced from 14px */
    background: white;
    transition: all 0.3s ease;
    outline: none;
}

.search-input:focus {
    border-color: var(--primary-color); /* Updated color */
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1); /* Updated color */
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b; /* Updated color */
    font-size: 0.8125rem; /* Reduced from 14px */
}

.search-clear {
    position: absolute;
    right: 8px; /* Reduced from 10px */
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #64748b; /* Updated color */
    cursor: pointer;
    font-size: 14px; /* Reduced from 16px */
    padding: 1px; /* Reduced from 2px */
    border-radius: 50%;
    width: 18px; /* Reduced from 20px */
    height: 18px;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.search-clear:hover {
    background: #f0f0f0;
    color: #333;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 6px 6px; /* Reduced from 8px */
    max-height: 180px; /* Reduced from 200px */
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08); /* Reduced shadow */
}

.search-result-item {
    padding: 8px 12px; /* Reduced from 10px 15px */
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    transition: background-color 0.2s ease;
}

.search-result-item:hover {
    background: #f8f9fa;
}

.search-result-item.selected {
    background: #e8f5e8;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-icon {
    margin-right: 8px; /* Reduced from 10px */
    font-size: 14px; /* Reduced from 16px */
}

.search-result-text {
    flex: 1;
}

.search-result-name {
    font-weight: 500;
    color: #333;
}

.search-result-details {
    font-size: 0.6875rem; /* Reduced from 12px */
    color: #64748b; /* Updated color */
    margin-top: 1px; /* Reduced from 2px */
}

.search-no-results {
    padding: 12px; /* Reduced from 15px */
    text-align: center;
    color: #64748b; /* Updated color */
    font-style: italic;
}

/* Highlighted site marker */
.site-marker.search-highlighted {
    transform: scale(1.2) !important; /* Reduced from 1.3 */
    z-index: 1000 !important;
    box-shadow: 0 0 16px rgba(245, 158, 11, 0.8) !important; /* Reduced from 20px and updated color */
    border: 3px solid var(--accent-color) !important; /* Updated color */
}

/* Search status indicator */
.search-status {
    position: absolute;
    bottom: 16px; /* Reduced from 20px */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 6px 12px; /* Reduced from 8px 16px */
    border-radius: 16px; /* Reduced from 20px */
    font-size: 0.6875rem; /* Reduced from 12px */
    z-index: 1000;
    display: none;
}

.export-section {
    margin-bottom: 20px; /* Reduced from 25px */
}

.export-option {
    display: flex;
    align-items: center;
    padding: 12px; /* Reduced from 15px */
    border: 2px solid #e0e0e0;
    border-radius: 8px; /* Reduced from 10px */
    margin-bottom: 8px; /* Reduced from 10px */
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
}

.export-option:hover {
    border-color: var(--primary-color); /* Updated color */
    background: #f8fff8;
    transform: translateY(-1px); /* Reduced from -2px */
    box-shadow: 0 3px 10px rgba(37, 99, 235, 0.12); /* Updated color and reduced shadow */
}

.export-icon {
    font-size: 28px; /* Reduced from 32px */
    margin-right: 12px; /* Reduced from 15px */
    min-width: 44px; /* Reduced from 50px */
    text-align: center;
}

.export-info h4 {
    margin: 0 0 4px 0; /* Reduced from 5px */
    color: #333;
    font-size: 14px; /* Reduced from 16px */
    font-weight: 600;
}

.export-info p {
    margin: 0;
    color: #64748b; /* Updated color */
    font-size: 0.8125rem; /* Reduced from 14px */
    line-height: 1.3; /* Reduced from 1.4 */
}

/* Add this to your existing styles */
.boundary-popup {
    text-align: center;
    padding: 8px; /* Reduced from 10px */
}

.boundary-popup h4 {
    margin: 0 0 4px 0; /* Reduced from 5px */
    color: #333;
    font-size: 0.8125rem; /* Reduced from 14px */
}

.boundary-popup p {
    margin: 0;
    color: #64748b; /* Updated color */
    font-size: 0.6875rem; /* Reduced from 12px */
}

/* Style for the boundary checkbox */
#showBoundaries + span {
    color: #FF6B6B;
    font-weight: 500;
}

/* Karnataka Boundary Styles */
.boundary-controls {
    margin-top: 8px; /* Reduced from 10px */
    padding: 8px; /* Reduced from 10px */
    background: #f8f9fa;
    border-radius: 4px; /* Reduced from 5px */
    border-left: 2px solid #FF6B35; /* Reduced from 3px */
}

.boundary-info {
    font-size: 0.8125rem; /* Reduced from 0.85rem */
    color: #64748b; /* Updated color */
    margin-top: 4px; /* Reduced from 5px */
}

/* Enhanced Map Controls */
.map-controls {
    position: absolute;
    top: 8px; /* Reduced from 10px */
    right: 8px; /* Reduced from 10px */
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 4px; /* Reduced from 5px */
}

/* Legend Updates */
.legend-line[style*="dashed"] {
    border-top: 3px dashed;
    background: none !important;
    height: 1px;
}

/* Loading Animation for Boundary */
.loading-boundary {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 16px; /* Reduced from 20px */
    border-radius: 6px; /* Reduced from 8px */
    z-index: 2000;
}

/* Customization Modal Styles */
.modal-large {
    max-width: 720px; /* Reduced from 800px */
}

.customization-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 16px; /* Reduced from 20px */
}

.tab-button {
    padding: 10px 16px; /* Reduced from 12px 20px */
    border: none;
    background: none;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-button.active {
    border-bottom-color: var(--primary-color); /* Updated color */
    color: var(--primary-color);
    background: #f8fff8;
}

.tab-button:hover {
    background: #f5f5f5;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px; /* Reduced from 20px */
}

.custom-types-list {
    max-height: 360px; /* Reduced from 400px */
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px; /* Reduced from 8px */
    padding: 8px; /* Reduced from 10px */
}

.custom-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px; /* Reduced from 12px */
    border: 1px solid #e0e0e0;
    border-radius: 4px; /* Reduced from 6px */
    margin-bottom: 6px; /* Reduced from 8px */
    background: #fafafa;
    transition: all 0.3s ease;
}

.custom-type-item:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.type-info {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced from 12px */
    flex: 1;
}

.type-icon {
    font-size: 18px; /* Reduced from 20px */
    width: 28px; /* Reduced from 30px */
    text-align: center;
}

.type-name {
    font-weight: 500;
    color: #333;
}

.type-color {
    width: 18px; /* Reduced from 20px */
    height: 18px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #ccc;
}

.type-line {
    height: 3px; /* Reduced from 4px */
    border-radius: 1.5px; /* Reduced from 2px */
    min-width: 36px; /* Reduced from 40px */
}

.type-actions {
    display: flex;
    gap: 6px; /* Reduced from 8px */
}

.btn-icon {
    padding: 5px 6px; /* Reduced from 6px 8px */
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 3px; /* Reduced from 4px */
    cursor: pointer;
    font-size: 0.8125rem; /* Reduced from 14px */
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #f5f5f5;
    border-color: #bbb;
}

.btn-icon-danger:hover {
    background: #fff5f5;
    border-color: var(--danger-color); /* Updated color */
    color: var(--danger-color);
}

/* Form Styles for Customization */
.form-row {
    display: flex;
    gap: 12px; /* Reduced from 15px */
}

.form-row .form-group {
    flex: 1;
}

.icon-selector, .color-selector {
    position: relative;
}

.icon-input, .color-input {
    width: 100%;
}

.icon-presets, .color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px; /* Reduced from 8px */
    margin-top: 6px; /* Reduced from 8px */
    padding: 6px; /* Reduced from 8px */
    background: #f9f9f9;
    border-radius: 4px; /* Reduced from 6px */
    border: 1px solid #eee;
}

.icon-preset, .color-preset {
    width: 28px; /* Reduced from 30px */
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ddd;
    border-radius: 4px; /* Reduced from 6px */
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px; /* Reduced from 16px */
}

.color-preset {
    border-radius: 50%;
}

.icon-preset:hover, .color-preset:hover {
    border-color: var(--primary-color); /* Updated color */
    transform: scale(1.05); /* Reduced from 1.1 */
}

.preview-section {
    margin-top: 16px; /* Reduced from 20px */
    padding: 12px; /* Reduced from 15px */
    background: #f9f9f9;
    border-radius: 6px; /* Reduced from 8px */
    border: 1px solid #eee;
}

.type-preview {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced from 12px */
}

.preview-marker {
    width: 32px; /* Reduced from 35px */
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color); /* Updated color */
    color: white;
    font-size: 16px; /* Reduced from 18px */
    box-shadow: 0 2px 6px rgba(0,0,0,0.25); /* Reduced shadow */
}

.connection-preview {
    display: flex;
    align-items: center;
    gap: 10px; /* Reduced from 12px */
}

.preview-connection {
    width: 54px; /* Reduced from 60px */
    height: 18px; /* Reduced from 20px */
    position: relative;
}

.preview-line {
    width: 100%;
    height: 3px; /* Reduced from 4px */
    background: var(--primary-color); /* Updated color */
    border-radius: 1.5px; /* Reduced from 2px */
}

.preview-text {
    font-weight: 500;
    color: #333;
}

/* Loading states */
.btn .spinner {
    width: 14px; /* Reduced from 16px */
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
    margin-left: 6px; /* Reduced from 8px */
}

/* Empty state */
.empty-state {
    text-align: center;
    padding: 32px 16px; /* Reduced from 40px 20px */
    color: #64748b; /* Updated color */
}

.empty-state .empty-icon {
    font-size: 40px; /* Reduced from 48px */
    margin-bottom: 12px; /* Reduced from 16px */
    opacity: 0.5;
}

/* Enhanced Site Markers */
.site-marker {
    width: 32px; /* Reduced from 35px */
    height: 32px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 6px rgba(0,0,0,0.25); /* Reduced shadow */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px; /* Reduced from 16px */
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    z-index: 100;
}

.site-marker:hover {
    transform: scale(1.15); /* Reduced from 1.2 */
    z-index: 1000;
    box-shadow: 0 3px 10px rgba(0,0,0,0.25); /* Reduced shadow */
}

.site-marker.active {
    animation: pulse 2s infinite;
}

.site-marker.inactive {
    opacity: 0.5;
    filter: grayscale(100%);
}

.site-marker.maintenance {
    border-color: var(--accent-color); /* Updated color */
    animation: blink 1.5s infinite;
}

.site-marker.selected {
    border-color: #FFD700;
    border-width: 3px; /* Reduced from 4px */
    box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.3); /* Reduced spread */
}

/* Enhanced Tooltips */
.leaflet-tooltip.site-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 4px; /* Reduced from 6px */
    padding: 6px 10px; /* Reduced from 8px 12px */
    font-size: 0.8125rem; /* Reduced from 0.85rem */
    box-shadow: 0 2px 6px rgba(0,0,0,0.25); /* Reduced shadow */
    max-width: 180px; /* Reduced from 200px */
}

.leaflet-tooltip.connection-tooltip {
    background: rgba(0, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 4px; /* Reduced from 6px */
    padding: 6px 10px; /* Reduced from 8px 12px */
    font-size: 0.75rem; /* Reduced from 0.8rem */
    box-shadow: 0 2px 6px rgba(0,0,0,0.25); /* Reduced shadow */
    max-width: 200px; /* Reduced from 220px */
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(0, 0, 0, 0.8);
}

/* Enhanced Popup Styles */
.popup-header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px; /* Reduced from 10px */
    margin-bottom: 12px; /* Reduced from 15px */
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-header h4 {
    margin: 0;
    color: var(--primary-color);
    font-size: 0.9375rem; /* Reduced from 1.1rem */
}

.site-type-badge,
.connection-type-badge {
    background: var(--light-color);
    color: var(--dark-color);
    padding: 3px 6px; /* Reduced from 4px 8px */
    border-radius: 10px; /* Reduced from 12px */
    font-size: 0.6875rem; /* Reduced from 0.75rem */
    font-weight: 600;
}

.connection-type-badge {
    color: white;
}

.popup-details {
    margin-bottom: 12px; /* Reduced from 15px */
}

.detail-row {
    display: flex;
    align-items: center;
    margin-bottom: 6px; /* Reduced from 8px */
    gap: 6px; /* Reduced from 8px */
}

.detail-label {
    font-weight: 600;
    min-width: 72px; /* Reduced from 80px */
    color: var(--dark-color);
    font-size: 0.8125rem; /* Reduced from 0.85rem */
}

.detail-value {
    flex: 1;
    font-size: 0.8125rem; /* Reduced from 0.85rem */
    color: #64748b; /* Updated color */
}

.priority-critical { color: #b91c1c; font-weight: bold; } /* Updated color */
.priority-high { color: #d97706; font-weight: bold; } /* Updated color */
.priority-medium { color: var(--primary-color); } /* Updated color */
.priority-low { color: var(--success-color); } /* Updated color */

/* Enhanced Legend */
.map-legend {
    position: absolute;
    bottom: 16px; /* Reduced from 20px */
    left: 16px; /* Reduced from 20px */
    background: white;
    border-radius: var(--border-radius);
    padding: 12px; /* Reduced from 15px */
    box-shadow: var(--shadow);
    z-index: 500;
    max-width: 180px; /* Reduced from 200px */
    max-height: 360px; /* Reduced from 400px */
    overflow-y: auto;
}

.legend-title {
    font-weight: bold;
    margin-bottom: 8px; /* Reduced from 10px */
    color: var(--primary-color);
    font-size: 0.8125rem; /* Reduced from 0.9rem */
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px; /* Reduced from 5px */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
    margin-bottom: 6px; /* Reduced from 8px */
    font-size: 0.75rem; /* Reduced from 0.8rem */
}

.legend-line {
    width: 18px; /* Reduced from 20px */
    height: 3px;
    border-radius: 2px;
}

.legend-icon {
    width: 18px; /* Reduced from 20px */
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6875rem; /* Reduced from 0.7rem */
    color: white;
}

/* Customization Modal */
.custom-type-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px; /* Reduced from 10px */
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 8px; /* Reduced from 10px */
    background: var(--light-color);
}

.type-info {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced from 10px */
}

.type-icon {
    font-size: 1.125rem; /* Reduced from 1.2rem */
}

.type-name {
    font-weight: 600;
    min-width: 90px; /* Reduced from 100px */
}

.type-color {
    width: 18px; /* Reduced from 20px */
    height: 18px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.type-line {
    width: 28px; /* Reduced from 30px */
    height: 3px;
    border-radius: 2px;
}

.type-actions {
    display: flex;
    gap: 4px; /* Reduced from 5px */
}

/* Enhanced Connection Lines */
.leaflet-interactive {
    cursor: pointer;
}

.leaflet-interactive:hover {
    filter: brightness(1.2);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Large Desktop (1200px and above) - sidebar always visible */
@media (min-width: 1200px) {
    .sidebar {
        transform: translateX(0);
        position: fixed;
    }
    
    .sidebar-toggle {
        display: block;
        left: var(--sidebar-width);
        background: var(--danger-color);
    }
    
    .sidebar-toggle::before {
        content: '←';
        font-size: 1rem; /* Reduced from 1.2rem */
    }
    
    .sidebar.hidden + .main-content .sidebar-toggle {
        left: 0;
        background: var(--primary-color);
    }
    
    .sidebar.hidden + .main-content .sidebar-toggle::before {
        content: '→';
    }
    
    .sidebar-section h3 {
        font-size: 0.8125rem; /* Reduced from 0.9rem */
    }
    
    .project-header h4 {
        font-size: 0.8125rem; /* Reduced from 0.85rem */
    }
}

/* Tablet (769px to 1023px) - sidebar hidden by default, toggleable */
@media (min-width: 769px) and (max-width: 1023px) {
    :root {
        --sidebar-width: 220px; /* Reduced from 250px */
    }
    
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 4px 0 12px rgba(0,0,0,0.08); /* Reduced shadow */
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .map-container {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-toggle::before {
        content: '☰';
        font-size: 1rem; /* Reduced from 1.2rem */
    }
    
    .header-nav {
        gap: 8px; /* Reduced from 10px */
    }
    
    .modal-content {
        margin: 8px; /* Reduced from 10px */
        max-width: calc(100% - 16px); /* Reduced from 20px */
    }
}

/* Mobile (768px and below) */
@media (max-width: 768px) {
    :root {
        --header-height: 52px; /* Reduced from 60px */
        --sidebar-width: 100%;
    }
    
    .header {
        padding: 0 12px; /* Reduced from 15px */
    }
    
    .header-logo {
        font-size: 0.9375rem; /* Reduced from 1rem */
    }
    
    .header-logo-icon {
        width: 30px; /* Reduced from 35px */
        height: 30px;
    }
    
    .sidebar {
        width: 100%;
        transform: translateX(-100%);
        z-index: 1500;
        box-shadow: none;
        padding: 10px; /* Reduced from 12px */
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
    }
    
    .map-container {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .sidebar-toggle::before {
        content: '☰';
        font-size: 1rem; /* Reduced from 1.2rem */
    }
    
    .map-controls {
        top: 12px; /* Reduced from 15px */
        right: 12px; /* Reduced from 15px */
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .map-legend {
        bottom: 12px; /* Reduced from 15px */
        left: 12px; /* Reduced from 15px */
        right: 12px; /* Reduced from 15px */
        font-size: 0.8125rem; /* Reduced from 0.85rem */
    }
    
    .auth-card {
        padding: 24px 16px; /* Reduced from 30px 20px */
        margin: 8px; /* Reduced from 10px */
    }
    
    .form-input {
        padding: 8px 10px; /* Reduced from 10px 14px */
    }
    
    .btn {
        padding: 8px 16px; /* Reduced from 10px 20px */
        font-size: 0.8125rem; /* Reduced from 0.9rem */
    }
    
    .popup-content {
        min-width: 180px; /* Reduced from 200px */
    }
    
    .project-stats {
        flex-direction: column;
        gap: 4px; /* Reduced from 5px */
    }
    
    .project-header {
        flex-direction: column;
        gap: 8px; /* Reduced from 10px */
    }
    
    .project-actions {
        opacity: 1;
        justify-content: flex-end;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 4px; /* Reduced from 5px */
    }
    
    .stat-item {
        align-self: flex-start;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px; /* Reduced from 15px */
    }
    
    .form-section {
        padding: 12px; /* Reduced from 15px */
        margin-bottom: 16px; /* Reduced from 20px */
    }
    
    .section-title {
        font-size: 0.9375rem; /* Reduced from 1rem */
    }
    
    .auth-help {
        padding: 12px; /* Reduced from 15px */
    }
    
    .contact-info {
        font-size: 0.75rem; /* Reduced from 0.8rem */
    }
    
    .search-container {
        margin: 0 8px; /* Reduced from 10px */
        max-width: 180px; /* Reduced from 200px */
    }
    
    .search-input {
        font-size: 0.75rem; /* Reduced from 13px */
        padding: 5px 8px 5px 26px; /* Reduced from 6px 10px 6px 30px */
    }
    
    .project-item {
        padding: 8px; /* Reduced from 10px */
    }
    
    .sidebar-section h3 {
        font-size: 0.75rem; /* Reduced from 0.85rem */
        margin-bottom: 8px; /* Reduced from 10px */
    }
    
    .map-controls {
        right: 4px; /* Reduced from 5px */
        top: 56px; /* Reduced from 60px */
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 16px 12px; /* Reduced from 20px 15px */
        margin: 4px; /* Reduced from 5px */
    }
    
    .modal-content {
        margin: 4px; /* Reduced from 5px */
        max-width: calc(100% - 8px); /* Reduced from 10px */
    }
    
    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 12px; /* Reduced from 15px */
    }
    
    .form-input {
        padding: 6px 8px; /* Reduced from 8px 12px */
        font-size: 0.8125rem; /* Reduced from 0.9rem */
    }
    
    .btn {
        padding: 6px 12px; /* Reduced from 8px 16px */
        font-size: 0.75rem; /* Reduced from 0.85rem */
    }
    
    .header-nav {
        display: none;
    }
    
    .header-user {
        margin-left: auto;
    }
    
    .form-section {
        padding: 8px; /* Reduced from 10px */
    }
    
    .btn-large {
        padding: 10px 20px; /* Reduced from 14px 24px */
        font-size: 0.875rem; /* Reduced from 1rem */
    }
    
    .modal-large {
        max-width: 95vw;
        margin: 16px auto; /* Reduced from 20px */
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .tab-button {
        padding: 6px 10px; /* Reduced from 8px 12px */
        font-size: 0.8125rem; /* Reduced from 14px */
    }
    
    .custom-type-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px; /* Reduced from 10px */
    }
    
    .type-actions {
        align-self: flex-end;
    }
    
    .map-legend {
        bottom: 8px; /* Reduced from 10px */
        left: 8px; /* Reduced from 10px */
        right: 8px; /* Reduced from 10px */
        max-height: 160px; /* Reduced from 200px */
    }
    
    .site-marker {
        width: 26px; /* Reduced from 30px */
        height: 26px;
        font-size: 0.75rem; /* Reduced from 14px */
    }
    
    .detail-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 3px; /* Reduced from 4px */
    }
    
    .detail-label {
        min-width: auto;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px); /* Reduced from 30px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-15px); /* Reduced from -20px */
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px); /* Reduced from 30px */
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.7); /* Updated color */
    }
    70% {
        box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); /* Reduced from 10px and updated color */
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

@keyframes blink {
    0%, 50% {
        opacity: 1;
    }
    51%, 100% {
        opacity: 0.5;
    }
}

@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); } /* Reduced from 1.05 */
    100% { transform: scale(1); }
}

.btn.success {
    animation: successPulse 0.5s ease-in-out; /* Faster animation */
}

/* ===== PRINT STYLES ===== */
@media print {
    .no-print,
    .header,
    .sidebar,
    .map-controls,
    .context-menu,
    .modal,
    .notification {
        display: none !important;
    }
    
    .main-content {
        margin-top: 0;
    }
    
    .map-container {
        margin-left: 0;
    }
    
    body {
        background: white;
    }
    
    .btn {
        border: 1px solid #333;
        background: white !important;
        color: #333 !important;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--border-radius);
    z-index: 3000;
}

.skip-link:focus {
    top: 6px;
}

/* ===== DARK MODE SUPPORT ===== */
@media (prefers-color-scheme: dark) {
    .auth-container {
        background: linear-gradient(135deg, #1e293b 0%, #334155 100%); /* Updated colors */
    }
    
    .auth-card {
        background: #1e293b; /* Updated color */
        color: #f1f5f9; /* Updated color */
    }
    
    .form-input {
        background: #334155; /* Updated color */
        border-color: #475569; /* Updated color */
        color: #f1f5f9; /* Updated color */
    }
    
    .form-input:focus {
        border-color: var(--primary-color);
    }
}

/* Enhanced form sections */
.form-section {
    margin: 20px 0;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    background: #f9f9f9;
}

.form-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

/* Enhanced legend styles */
.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
    font-size: 12px;
}

.legend-line {
    width: 30px;
    height: 3px;
    border-radius: 1px;
}

.legend-line-dashed {
    border-style: dashed !important;
}

.legend-line-dotted {
    border-style: dotted !important;
}

.legend-line-solid {
    background-color: var(--color) !important;
}

/* Enhanced connection preview */
.connection-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
}

.preview-connection {
    display: flex;
    align-items: center;
    width: 50px;
}

.preview-line {
    width: 100%;
    height: 3px;
    background: #4CAF50;
    border-radius: 1px;
}

/* Bandwidth indicator styles */
.bandwidth-indicator {
    display: inline-block;
    font-size: 10px;
    color: #666;
    margin-left: 5px;
}

/* Loading state styles */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #333;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced site marker styles */
.site-marker {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: white;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.site-marker:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.site-marker.selected {
    border-color: #ffff00;
    box-shadow: 0 0 10px #ffff00;
}

/* Enhanced connection styles for different bandwidths */
.connection-line-thin { stroke-width: 2px; }
.connection-line-medium { stroke-width: 4px; }
.connection-line-thick { stroke-width: 6px; }
.connection-line-very-thick { stroke-width: 8px; }

/* Form validation styles */
.form-input.error {
    border-color: #f44336;
    box-shadow: 0 0 5px rgba(244, 67, 54, 0.3);
}

.form-input.success {
    border-color: #4CAF50;
    box-shadow: 0 0 5px rgba(76, 175, 80, 0.3);
}

/* Enhanced tooltip styles */
.site-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
}

.connection-tooltip {
    background: rgba(0, 0, 0, 0.8) !important;
    color: white !important;
    border: none !important;
    border-radius: 4px !important;
    padding: 8px 12px !important;
    font-size: 12px !important;
    line-height: 1.4 !important;
    max-width: 200px !important;
}



/* Optional Section Styling */
.optional-section {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.optional-section .section-title small {
    color: #666;
    font-weight: normal;
    font-size: 12px;
}

.form-hint {
    display: block;
    font-size: 11px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.ip-input {
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.ip-input.valid {
    border-color: #4CAF50;
    background-color: #f8fff8;
}

.ip-input.error {
    border-color: #f44336;
    background-color: #fff8f8;
}

.popup-section {
    border-top: 1px solid #eee;
    margin-top: 10px;
    padding-top: 10px;
}




/*css popup additional */

/*========================== */


/* Site Popup Specific Styling */
.popup-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
    position: relative;
}

.popup-title-section {
    flex: 1;
    margin-right: 10px;
}

.detail-toggle-btn {
    background: #2196F3 !important;
    color: white !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    display: flex !important;
    align-items: center !important;
    gap: 4px !important;
    transition: all 0.3s ease !important;
    min-width: 80px !important;
    justify-content: center !important;
    position: relative !important;
    z-index: 1001 !important;
    flex-shrink: 0 !important;
}

.detail-toggle-btn:hover {
    background: #1976D2 !important;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.detail-icon {
    font-size: 14px;
}

.detail-text {
    font-weight: 500;
    font-size: 11px;
}

/* Ensure the button is always visible */
.popup-content .detail-toggle-btn {
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

/* Debug border - remove in production */
.detail-toggle-btn {
    border: 2px solid red !important; /* TEMPORARY - remove this line in production */
}

/*===========================*/





/* Enhanced Popup Styling */
.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.popup-title-section {
    flex: 1;
}

.popup-title-section h4 {
    margin: 0 0 5px 0;
    color: #333;
    font-size: 16px;
    line-height: 1.3;
}

.detail-toggle-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 70px;
    justify-content: center;
}

.detail-toggle-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.detail-icon {
    font-size: 14px;
}

.detail-text {
    font-weight: 500;
}

/* Enhanced Detail Sections */
.detail-section {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

.section-header {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.popup-details-extended {
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
    border-top: 1px solid #eee;
}

.popup-details-extended::-webkit-scrollbar {
    width: 6px;
}

.popup-details-extended::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.popup-details-extended::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.popup-details-extended::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* IP Value Styling */
.ip-value {
    font-family: 'Courier New', monospace;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
}

/* Notes Value Styling */
.notes-value {
    font-style: italic;
    color: #555;
    background: #f9f9f9;
    padding: 8px;
    border-radius: 4px;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Priority Styling */
.priority-critical {
    color: #d32f2f;
    font-weight: bold;
}

.priority-high {
    color: #f57c00;
    font-weight: bold;
}

.priority-medium {
    color: #388e3c;
}

.priority-low {
    color: #757575;
}

/* Enhanced Badge Styling */
.site-type-badge, .connection-type-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    background: #4CAF50;
    margin-top: 2px;
}

/* Animation for Toggle */
.popup-details-extended {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Enhanced Popup Buttons */
.popup-btn-info {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.popup-btn-info:hover {
    background-color: #138496;
    border-color: #117a8b;
}

/* Responsive Design for Popups */
@media (max-width: 768px) {
    .popup-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .detail-toggle-btn {
        align-self: flex-end;
        min-width: 80px;
    }
    
    .popup-details-extended {
        max-height: 250px;
    }
}

/* FIXED: Enhanced detail toggle button */
.detail-toggle-btn {
    background: #2196F3;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    min-width: 80px;
    justify-content: center;
    z-index: 1000;
    position: relative;
}

.detail-toggle-btn:hover {
    background: #1976D2;
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.detail-toggle-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Ensure button doesn't trigger popup close */
.popup-header {
    position: relative;
    z-index: 10;
}

/* Enhanced detail sections with better spacing */
.detail-section {
    margin-bottom: 15px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 3px solid #4CAF50;
}

/* Better styling for unspecified values */
.detail-value:contains("Not specified"),
.detail-value:contains("Not configured"),
.detail-value:contains("No notes available") {
    font-style: italic;
    color: #888;
}

/* Debug helper - remove in production */
.popup-content {
    position: relative;
}

.popup-content * {
    pointer-events: auto;
}

/* Ensure proper z-indexing */
.leaflet-popup-content-wrapper {
    z-index: 1000 !important;
}

.leaflet-popup {
    z-index: 1000 !important;
}


/* Enhanced Location Section Styling */
.location-section {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 1px solid #0891b2;
    border-left: 4px solid #0891b2;
}

.coordinate-input {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
}

.coordinate-input:focus {
    border-color: #0891b2;
    box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.1);
    background: #f8fafc;
}

.coordinate-input.valid {
    border-color: #059669;
    background: #f0fdf4;
}

.coordinate-input.error {
    border-color: #dc2626;
    background: #fef2f2;
    animation: shake 0.5s ease-in-out;
}

.coordinate-actions {
    display: flex;
    gap: 8px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.coordinate-actions .btn-small {
    padding: 6px 12px;
    font-size: 12px;
    min-width: 120px;
}

.coordinate-info {
    margin-top: 15px;
    padding: 12px;
    background: rgba(8, 145, 178, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(8, 145, 178, 0.2);
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 13px;
}

.info-item:last-child {
    margin-bottom: 0;
}

.info-item strong {
    color: #334155;
}

.info-item span {
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
}

.status-valid {
    background: #dcfce7;
    color: #166534;
}

.status-invalid {
    background: #fef2f2;
    color: #dc2626;
}

.status-warning {
    background: #fef3c7;
    color: #92400e;
}

/* Map Selection Mode */
.map-container.selecting-location {
    cursor: crosshair;
}

.map-container.selecting-location::before {
    content: 'Click on map to select location';
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #0891b2;
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    z-index: 1000;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Location Marker for Selection */
.temp-location-marker {
    width: 20px;
    height: 20px;
    background: #dc2626;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Responsive Design for Location Section */
@media (max-width: 768px) {
    .coordinate-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .coordinate-actions .btn-small {
        min-width: auto;
        width: 100%;
    }
    
    .coordinate-input {
        font-size: 16px; /* Prevent zoom on iOS */
    }
}
/* ===== UTILITY CLASSES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; } /* Reduced from 0.5rem */
.mb-2 { margin-bottom: 0.5rem; } /* Reduced from 1rem */
.mb-3 { margin-bottom: 0.75rem; } /* Reduced from 1.5rem */
.mb-4 { margin-bottom: 1rem; } /* Reduced from 2rem */

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; } /* Reduced from 0.5rem */
.mt-2 { margin-top: 0.5rem; } /* Reduced from 1rem */
.mt-3 { margin-top: 0.75rem; } /* Reduced from 1.5rem */
.mt-4 { margin-top: 1rem; } /* Reduced from 2rem */

.p-0 { padding: 0; }
.p-1 { padding: 0.25rem; } /* Reduced from 0.5rem */
.p-2 { padding: 0.5rem; } /* Reduced from 1rem */
.p-3 { padding: 0.75rem; } /* Reduced from 1.5rem */
.p-4 { padding: 1rem; } /* Reduced from 2rem */

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }

.flex-column { flex-direction: column; }
.flex-row { flex-direction: row; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.text-primary { color: var(--primary-color); }
.text-secondary { color: var(--secondary-color); }
.text-danger { color: var(--danger-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }

.bg-primary { background-color: var(--primary-color); }
.bg-secondary { background-color: var(--secondary-color); }
.bg-light { background-color: var(--light-color); }
.bg-dark { background-color: var(--dark-color); }

.border { border: 1px solid var(--border-color); }
.border-0 { border: none; }
.rounded { border-radius: var(--border-radius); }
.shadow { box-shadow: var(--shadow); }
.shadow-hover { box-shadow: var(--shadow-hover); }