/* Global Styles */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    padding: 0;
}

/* Header styling */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid #e9ecef;
    z-index: 1100;
    display: flex;
    align-items: center;
    padding: 0 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-logo {
    height: 60px;
    margin-right: 30px;
}

.header-nav {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
}

.nav-links a {
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #0f8b56;
}

.nav-links a.active {
    color: #0f8b56;
    font-weight: 600;
}

.language-switcher {
    display: flex;
    gap: 10px;
    margin-left: 20px;
}

.language-switcher a {
    padding: 5px 10px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.language-switcher a:hover,
.language-switcher a.active {
    border-color: #0f8b56;
    color: #0f8b56;
    background-color: rgba(15, 139, 86, 0.1);
}

.header-search {
    max-width: 300px;
}

.header-search .input-group {
    display: flex;
}

.header-search .form-control {
    flex: 1;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-right: none;
    border: 2px solid #e9ecef;
    padding: 0.5rem 0.75rem;
}

.header-search .form-control:focus {
    border-color: #0f8b56;
    box-shadow: none;
}

.header-search .btn {
    border-top-left-radius: 0 !important;
    border-bottom-left-radius: 0 !important;
    white-space: nowrap;
    background: #0f8b56;
    border-color: #0f8b56;
    padding: 0.5rem 1rem;
}

.header-search .btn:hover {
    background: #0c6b42;
    border-color: #0c6b42;
}

/* Sidebar styling */
.sidebar {
    position: fixed;
    top: 70px;
    left: 0;
    width: 250px;
    height: calc(100vh - 70px);
    background-color: #f8f9fa;
    padding-top: 20px;
    border-right: 1px solid #ddd;
    overflow-y: auto;
}

.sidebar ul {
    list-style: none;
    padding: 0;
}

.sidebar ul li {
    margin: 10px 0;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.sidebar ul li a:hover {
    background-color: #0f8b56;
    color: #fff;
}

.sidebar ul li a.active {
    background-color: #0f8b56;
    color: #fff;
}

.sidebar ul li a i {
    margin-right: 10px;
}

/* Button Styles */
.btn-primary {
    background: #0f8b56;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(15, 139, 86, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 139, 86, 0.4);
    background: #0c6b42;
}

.btn-outline-secondary {
    border: 2px solid #0f8b56;
    color: #0f8b56;
    border-radius: 12px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline-secondary:hover {
    background: #0f8b56;
    border-color: #0f8b56;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(15, 139, 86, 0.3);
}

.btn-link {
    color: #0f8b56 !important;
    text-decoration: none !important;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-link:hover {
    color: #0c6b42 !important;
    transform: translateY(-1px);
}

/* Form Styles */
.form-control {
    border: 2px solid #e9ecef;
    border-radius: 12px !important;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
    width: 100%;
    box-sizing: border-box;
}

.form-control:focus {
    border-color: #0f8b56;
    box-shadow: 0 0 0 0.2rem rgba(15, 139, 86, 0.25);
    background: #ffffff;
}

.form-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.5rem;
    display: block;
    text-align: left;
}

.mb-3, .mb-4 {
    margin-bottom: 1rem;
    width: 100%;
}

.text-start {
    text-align: left !important;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 20000 !important;
}

.modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(0,0,0,0.3), rgba(0,0,0,0.7));
    backdrop-filter: blur(5px);
}

.modal-dialog {
    margin: 0;
    position: relative;
    max-width: 450px;
    width: 95vw;
    min-width: 320px;
    transform: none;
}

.modal-content {
    border-radius: 20px;
    border: none;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    overflow: hidden;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.modal-header {
    border-bottom: none;
    background: linear-gradient(135deg, #0f8b56 0%, #0c6b42 100%);
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    position: relative;
}

.modal-title {
    font-weight: 600;
    color: #ffffff;
    width: 100%;
    text-align: center;
    margin: 0;
    font-size: 1.4rem;
}

.modal-body {
    padding: 2rem 1.5rem;
    background: #ffffff;
}

.login-icon {
    width: 60px;
    height: 60px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem auto;
}

.btn-close {
    width: 2rem;
    height: 2rem;
    background-color: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    font-size: 0.9rem;
    color: #ffffff;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-weight: bold;
}

.btn-close:hover {
    opacity: 1;
    background-color: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
    color: #ffffff;
    transform: scale(1.1);
}

/* Card Styles (for My Maps page) */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.card-img-top {
    border-radius: 12px 12px 0 0;
    height: 200px;
    object-fit: cover;
}

.card-img-placeholder {
    height: 200px;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 3rem;
}

.card-img-placeholder i {
    opacity: 0.7;
}

/* Main Content Area */
.main-content {
    margin-left: 250px;
    margin-top: 80px;
    padding: 30px;
    min-height: calc(100vh - 80px);
}

/* Typography */
h1 {
    color: #495057;
    font-weight: 600;
    margin-bottom: 2rem;
}

.text-muted {
    font-size: 0.9rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-state i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: #6c757d;
    margin-bottom: 1rem;
}

.empty-state p {
    color: #868e96;
    font-size: 1.1rem;
}

/* Responsive Design */
@media (max-width: 500px) {
    .modal-dialog {
        max-width: 98vw;
    }
    .modal-header {
        padding: 1.5rem 1rem 1rem 1rem;
    }
    .modal-body {
        padding: 1.5rem 1rem;
    }
}

/* Footer Language Switcher */
.language-switcher-footer a {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
}

.language-switcher-footer a:hover {
    color: #0f8b56;
}

.language-switcher-footer a.active {
    color: #0f8b56;
    font-weight: bold;
}

/* Enhanced Shapefile Popup Styles */
.shapefile-popup .leaflet-popup-content {
    margin: 0;
    line-height: 1.4;
}

.shapefile-popup-content {
    font-family: 'Roboto', sans-serif;
    font-size: 13px;
}

.shapefile-popup-content .popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #e9ecef;
}

.shapefile-popup-content .color-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shapefile-popup-content .coordinates {
    margin-bottom: 8px;
    font-size: 11px;
}

.shapefile-popup-content .coordinates i {
    margin-right: 4px;
    color: #0f8b56;
}

.shapefile-popup-content .popup-body > div {
    margin-bottom: 4px;
    font-size: 12px;
}

.shapefile-popup-content .admin-details {
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 11px;
}

.shapefile-popup-content .admin-details > div {
    margin-bottom: 3px;
    color: #6c757d;
}

.shapefile-popup-content .popup-controls {
    border-top: 1px solid #e9ecef;
    padding-top: 10px;
}

.shapefile-popup-content .radius-control .form-label {
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 500;
    color: #6c757d;
}

.shapefile-popup-content .radius-control .form-label i {
    margin-right: 4px;
    color: #0f8b56;
}

.shapefile-popup-content .radius-control .form-control {
    height: 28px;
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #f8f9fa;
}

.shapefile-popup-content .radius-control .form-control:focus {
    border-color: #0f8b56;
    box-shadow: 0 0 0 0.1rem rgba(15, 139, 86, 0.25);
    background: #ffffff;
}

.shapefile-popup-content .popup-buttons .btn {
    font-size: 11px;
    padding: 6px 12px;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.shapefile-popup-content .popup-buttons .btn i {
    margin-right: 4px;
    font-size: 10px;
}

.shapefile-popup-content .popup-buttons .btn-primary {
    background: #0f8b56;
    border-color: #0f8b56;
}

.shapefile-popup-content .popup-buttons .btn-primary:hover {
    background: #0c6b42;
    border-color: #0c6b42;
    transform: translateY(-1px);
}

.shapefile-popup-content .popup-buttons .btn-outline-secondary {
    border: 1px solid #6c757d;
    color: #6c757d;
    background: transparent;
}

.shapefile-popup-content .popup-buttons .btn-outline-secondary:hover {
    background: #6c757d;
    border-color: #6c757d;
    color: white;
    transform: translateY(-1px);
}

/* Responsive popup styles */
@media (max-width: 480px) {
    .leaflet-popup-content-wrapper {
        max-width: 280px !important;
    }
    
    .shapefile-popup-content .popup-buttons {
        flex-direction: column;
    }
    
    .shapefile-popup-content .popup-buttons .btn {
        margin-bottom: 4px;
    }
}

/* Shapefile Data Table Highlighting */
.highlight-row {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
}

.highlight-row td {
    background-color: #fff3cd !important;
    border-color: #ffc107 !important;
}

.table-warning {
    animation: highlightPulse 2s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { background-color: #fff3cd; }
    50% { background-color: #ffeaa7; }
}