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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
}

#map {
    height: 100vh;
    width: 100%;
    z-index: 1;
}

.custom-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8B4513;
    border: 3px solid #D2691E;
    border-radius: 50%;
    color: white;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.modal-close:hover {
    opacity: 1;
}

.modal-body {
    padding: 25px;
    overflow-y: auto;
    max-height: calc(90vh - 150px);
}

.site-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.info-section {
    margin-bottom: 20px;
}

.info-section h3 {
    color: #8B4513;
    font-size: 1rem;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #D2691E;
}

.info-row {
    display: flex;
    margin-bottom: 8px;
}

.info-label {
    font-weight: 600;
    color: #555;
    min-width: 120px;
}

.info-value {
    color: #333;
}

.description-text {
    line-height: 1.6;
    color: #444;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.gallery-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 3px solid transparent;
    transition: border-color 0.2s;
}

.gallery-item:hover {
    border-color: #8B4513;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-item .badge {
    position: absolute;
    bottom: 5px;
    right: 5px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
}

.artifacts-list {
    list-style: none;
}

.artifacts-list li {
    padding: 10px;
    background: #f9f9f9;
    margin-bottom: 8px;
    border-radius: 6px;
    border-left: 4px solid #8B4513;
}

.artifacts-list li strong {
    color: #8B4513;
}

.no-image {
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #888;
    font-size: 0.9rem;
}

.toolbar {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toolbar button, .toolbar .btn {
    background: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    cursor: pointer;
    font-weight: 500;
    color: #333;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.toolbar button:hover, .toolbar .btn:hover {
    background: #8B4513;
    color: white;
}

.toolbar button.active {
    background: #8B4513;
    color: white;
}

.search-box {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 10px 15px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.search-box input {
    border: 1px solid #ddd;
    padding: 10px 15px;
    border-radius: 6px;
    width: 300px;
    font-size: 14px;
}

.search-box input:focus {
    outline: none;
    border-color: #8B4513;
}

.search-box button {
    background: #8B4513;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.search-box button:hover {
    background: #A0522D;
}

.filters {
    position: absolute;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 15px;
    display: none;
    flex-direction: column;
    gap: 15px;
    width: 400px;
}

.filters.active {
    display: flex;
}

.filter-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.filter-row select {
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 6px;
    width: 100%;
}

.filter-row select:focus {
    outline: none;
    border-color: #8B4513;
}

.legend {
    position: absolute;
    bottom: 30px;
    left: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 15px;
}

.legend h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-size: 13px;
}

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

.site-count {
    position: absolute;
    bottom: 30px;
    right: 20px;
    z-index: 1000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    padding: 15px 20px;
    text-align: center;
}

.site-count .number {
    font-size: 2rem;
    font-weight: bold;
    color: #8B4513;
}

.site-count .label {
    font-size: 0.9rem;
    color: #666;
}

/* Form Modal Styles */
.form-group {
    margin-bottom: 15px;
}

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

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #8B4513;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

.btn-primary {
    background: #8B4513;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}

.btn-primary:hover {
    background: #A0522D;
}

.image-upload {
    border: 2px dashed #ddd;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.image-upload:hover {
    border-color: #8B4513;
}

.image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.image-preview img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
}

.tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 5px;
}

.tab {
    padding: 10px 20px;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    border-radius: 6px 6px 0 0;
    transition: all 0.2s;
}

.tab:hover {
    color: #8B4513;
    background: #f5f5f5;
}

.tab.active {
    color: #8B4513;
    background: #f5f5f5;
    border-bottom: 2px solid #8B4513;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.loading {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3000;
    background: white;
    padding: 30px 50px;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    display: none;
}

.loading.active {
    display: block;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #eee;
    border-top-color: #8B4513;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.coordinates-display {
    position: absolute;
    bottom: 100px;
    right: 20px;
    z-index: 1000;
    background: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 13px;
    color: #666;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .search-box {
        left: 10px;
        right: 10px;
        transform: none;
        width: auto;
    }

    .search-box input {
        width: 100%;
    }

    .toolbar {
        top: auto;
        bottom: 100px;
        right: 20px;
        left: auto;
    }

    .site-info {
        grid-template-columns: 1fr;
    }

    .filter-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
    }
}