/* Modern Design System with Glassmorphism & Premium UI */

:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-dark: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #10b981;
    --font-outfit: 'Outfit', sans-serif;
    --font-inter: 'Inter', sans-serif;
}

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

body {
    font-family: var(--font-inter);
    background-color: var(--bg-dark);
    color: var(--text-primary);
    overflow: hidden;
}

#app {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* Sidebar Styling */
.sidebar {
    width: 380px;
    height: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    padding: 2rem;
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 2rem;
}

.brand-name {
    font-family: var(--font-outfit);
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #818cf8, #c084fc);
    -webkit-background-clip: text;
    background-clip: text;
    /* Compatibility fix */
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.brand-tagline {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.upload-section {
    margin-bottom: 1.5rem;
}

.upload-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.filter-section {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.glass-select {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    padding: 0.5rem;
    border-radius: 8px;
    margin-left: 0.5rem;
    outline: none;
    flex-grow: 1;
}

.image-list {
    flex-grow: 1;
    overflow-y: auto;
    margin-top: 1rem;
    padding-right: 0.5rem;
}

.image-list::-webkit-scrollbar {
    width: 6px;
}

.image-list::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

.image-item {
    display: flex;
    padding: 1.25rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    margin-bottom: 1.25rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 1.25rem;
    align-items: center;
}

.image-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.image-thumb {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    background: #1e293b;
    flex-shrink: 0;
}

.image-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.image-date {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.image-coords {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
    margin-bottom: 0.75rem;
}

.animate-btn {
    padding: 0.6rem 1.25rem;
    background: linear-gradient(135deg, var(--accent), #059669);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.animate-btn:hover {
    background: #059669;
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

/* Map Container */
.map-container {
    flex-grow: 1;
    position: relative;
}

#map {
    height: 100%;
    width: 100%;
    background: #1e293b;
}

/* Leaflet Overrides for Dark UI */
.leaflet-container {
    background: #1e293b !important;
}

.leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.9) !important;
    backdrop-filter: blur(10px);
    color: white !important;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0;
}

.leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.9) !important;
}

.popup-image {
    width: 100%;
    max-width: 320px;
    min-width: 280px;
    height: auto;
    border-radius: 12px;
    display: block;
    margin-bottom: 1rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.map-popup {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

/* Modal for Animation */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    transition: opacity 0.3s ease;
}

.modal.hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    padding: 2rem;
    border-radius: 20px;
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

#animation-viewport {
    width: 600px;
    height: 400px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.close-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

/* Animation Effect: Ken Burns */
.ken-burns-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: kenburns 2s ease-in-out forwards;
}

/* Custom Marker Styling */
.custom-marker {
    background: transparent;
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s ease;
}

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

.custom-marker div {
    border: 3px solid white !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4) !important;
}

@keyframes kenburns {
    0% {
        transform: scale(1) translate(0, 0);
    }

    100% {
        transform: scale(1.1) translate(-2%, -2%);
    }
}