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

:root {
    /* Vintage Color Palette */
    --parchment: #f4f1e8;
    --parchment-dark: #e8e2d5;
    --aged-paper: #f0ead6;
    --sepia-brown: #8b7355;
    --antique-gold: #d4af37;
    --deep-burgundy: #800020;
    --forest-green: #355e3b;
    --royal-blue: #4169e1;
    --burnt-orange: #cc5500;
    --charcoal: #36454f;
    --cream: #fffdd0;
    
    /* Fonts */
    --font-display: 'Playfair Display', serif;
    --font-body: 'Crimson Text', serif;
    
    /* Shadows */
    --vintage-shadow: 0 2px 8px rgba(139, 115, 85, 0.3);
    --paper-shadow: 0 4px 12px rgba(139, 115, 85, 0.2);
}

body {
    font-family: var(--font-body);
    background: linear-gradient(145deg, var(--parchment) 0%, var(--aged-paper) 100%);
    color: var(--charcoal);
    min-height: 100vh;
    position: relative;
}

/* Parchment Texture */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 25% 25%, transparent 0%, transparent 50%, rgba(139, 115, 85, 0.05) 60%, transparent 80%),
        radial-gradient(circle at 75% 75%, transparent 0%, transparent 50%, rgba(139, 115, 85, 0.05) 60%, transparent 80%);
    pointer-events: none;
    z-index: 1;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--deep-burgundy) 0%, #a0002a 100%);
    color: var(--cream);
    padding: 1rem;
    text-align: center;
    box-shadow: var(--vintage-shadow);
    position: relative;
    z-index: 1000;
}

.header-title {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.9;
}

/* Controls Container */
.controls-container {
    background: var(--aged-paper);
    border-bottom: 2px solid var(--sepia-brown);
    padding: 1rem;
    box-shadow: var(--paper-shadow);
    position: relative;
    z-index: 999;
}

/* Search */
.search-container {
    position: relative;
    margin-bottom: 1rem;
}

.search-input {
    width: 100%;
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--sepia-brown);
    border-radius: 25px;
    background: var(--cream);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    box-shadow: inset 2px 2px 4px rgba(139, 115, 85, 0.1);
}

.search-input:focus {
    border-color: var(--antique-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--sepia-brown);
    pointer-events: none;
}

/* Filter Chips */
.filter-container {
    margin-bottom: 1rem;
}

.filter-chips {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--sepia-brown) transparent;
}

.filter-chip {
    background: var(--cream);
    border: 2px solid var(--sepia-brown);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    text-transform: capitalize;
}

.filter-chip:hover {
    background: var(--parchment-dark);
    transform: translateY(-1px);
}

.filter-chip.active {
    background: var(--antique-gold);
    color: white;
    border-color: var(--antique-gold);
}

/* Era Filter */
.era-filter {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.era-label {
    font-family: var(--font-body);
    font-weight: 600;
    color: var(--charcoal);
}

.era-slider-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.era-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 6px;
    background: var(--sepia-brown);
    border-radius: 3px;
    outline: none;
}

.era-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--antique-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.era-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--antique-gold);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.era-min, .era-max, .era-value {
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--sepia-brown);
    font-weight: 600;
}

.era-value {
    min-width: 70px;
    text-align: right;
}

/* Map Container */
.map-container {
    height: calc(100vh - 200px);
    width: 100%;
    position: relative;
    z-index: 1;
    border: 3px solid var(--sepia-brown);
    border-radius: 10px;
    margin: 0 1rem 1rem 1rem;
    overflow: hidden;
    box-shadow: var(--vintage-shadow);
}

/* Map Controls Styling */
.leaflet-control-zoom {
    border: 2px solid var(--sepia-brown) !important;
    border-radius: 8px !important;
    overflow: hidden;
    box-shadow: var(--paper-shadow) !important;
}

.leaflet-control-zoom a {
    background: var(--aged-paper) !important;
    color: var(--charcoal) !important;
    border: none !important;
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    transition: all 0.3s ease !important;
}

.leaflet-control-zoom a:hover {
    background: var(--antique-gold) !important;
    color: white !important;
}

/* Custom Marker Styles */
.custom-marker {
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.custom-marker:hover {
    transform: scale(1.1);
    z-index: 1000 !important;
}

.custom-marker.selected {
    animation: bounce 0.6s ease;
    transform: scale(1.2);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0) scale(1.2); }
    40% { transform: translateY(-10px) scale(1.2); }
    60% { transform: translateY(-5px) scale(1.2); }
}

/* Monument Panel */
.monument-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--cream);
    border-top: 3px solid var(--sepia-brown);
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(139, 115, 85, 0.3);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2000;
    max-height: 70vh;
    overflow: hidden;
}

.monument-panel.active {
    transform: translateY(0);
}

.panel-header {
    padding: 1rem;
    border-bottom: 2px solid var(--parchment-dark);
    position: relative;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--deep-burgundy);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: var(--font-display);
}

.close-btn:hover {
    background: var(--antique-gold);
    transform: rotate(90deg);
}

.panel-content {
    padding: 0 1rem 1rem 1rem;
    overflow-y: auto;
    max-height: calc(70vh - 60px);
}

.monument-header {
    margin-bottom: 1rem;
}

.monument-name {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--charcoal);
    margin-bottom: 0.3rem;
}

.monument-name-hindi {
    font-family: var(--font-body);
    font-size: 1.2rem;
    color: var(--sepia-brown);
    margin-bottom: 0.5rem;
    font-style: italic;
}

.monument-badges {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.year-badge, .dynasty-badge {
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font-body);
}

.year-badge {
    background: var(--antique-gold);
    color: white;
}

.dynasty-badge {
    background: var(--forest-green);
    color: white;
}

/* Image Carousel */
.image-carousel {
    margin-bottom: 1rem;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 0.5rem 0;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.carousel-image {
    flex-shrink: 0;
    width: 250px;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--sepia-brown);
    scroll-snap-align: start;
    box-shadow: var(--paper-shadow);
    transition: transform 0.3s ease;
}

.carousel-image:hover {
    transform: scale(1.05);
}

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 0.5rem;
}

.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--sepia-brown);
    opacity: 0.5;
    cursor: pointer;
    transition: all 0.3s ease;
}

.carousel-dot.active {
    background: var(--antique-gold);
    opacity: 1;
    transform: scale(1.2);
}

/* Description */
.description-text {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--charcoal);
    text-align: justify;
}

/* Legend */
.legend {
    position: fixed;
    bottom: 2rem;
    left: 1rem;
    background: var(--cream);
    border: 2px solid var(--sepia-brown);
    border-radius: 10px;
    padding: 0.8rem;
    box-shadow: var(--vintage-shadow);
    z-index: 1500;
    max-width: 200px;
}

.legend-title {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    color: var(--charcoal);
    margin-bottom: 0.5rem;
    text-align: center;
}

.legend-items {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    font-family: var(--font-body);
}

.legend-color {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid white;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Loading Indicator */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--cream);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--vintage-shadow);
    text-align: center;
    z-index: 3000;
    border: 2px solid var(--sepia-brown);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--parchment-dark);
    border-top: 4px solid var(--antique-gold);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-indicator p {
    font-family: var(--font-body);
    color: var(--charcoal);
    font-size: 1rem;
    margin: 0;
}

/* Marker Cluster Styling */
.marker-cluster {
    background: var(--antique-gold) !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    color: white !important;
    font-family: var(--font-display) !important;
    font-weight: 600 !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3) !important;
}

.marker-cluster-small {
    background: var(--forest-green) !important;
}

.marker-cluster-medium {
    background: var(--burnt-orange) !important;
}

.marker-cluster-large {
    background: var(--deep-burgundy) !important;
}

/* Responsive Design */
@media (min-width: 768px) {
    .header-title {
        font-size: 2.5rem;
    }
    
    .header-subtitle {
        font-size: 1rem;
    }
    
    .controls-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        align-items: end;
    }
    
    .search-container {
        margin-bottom: 0;
    }
    
    .filter-container {
        margin-bottom: 0;
    }
    
    .era-filter {
        grid-column: 1 / -1;
        flex-direction: row;
        align-items: center;
        gap: 1rem;
    }
    
    .era-label {
        flex-shrink: 0;
    }
    
    .monument-panel {
        max-width: 500px;
        left: auto;
        right: 1rem;
        border-radius: 20px;
        border: 3px solid var(--sepia-brown);
    }
    
    .legend {
        bottom: auto;
        top: 200px;
    }
    
    .map-container {
        height: calc(100vh - 180px);
    }
}

@media (min-width: 1024px) {
    .controls-container {
        grid-template-columns: 2fr 2fr 3fr;
    }
    
    .era-filter {
        grid-column: auto;
        flex-direction: row;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .controls-container,
    .monument-panel,
    .legend,
    .loading-indicator {
        display: none;
    }
    
    .map-container {
        height: 80vh;
        margin: 0;
        border: 2px solid black;
    }
}