@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@300;400;700&family=Space+Grotesk:wght@300;400&display=swap');

/* Rich Deep Teal Color Variables */
:root {
    /* Core dark backgrounds */
    --space-black: #010a09;
    --space-deep: #011a16;
    --space-dark: #013220;

    /* Rich teal gradient spectrum */
    --nebula-deep: #003333;
    --nebula-primary: #004B49;
    --nebula-glow: #005855;
    --nebula-accent: #007872;
    --nebula-light: #00a89d;
    --nebula-bright: #00d4c8;

    /* Complementary forest greens */
    --forest-deep: #012b1d;
    --forest-primary: #013220;
    --forest-accent: #024d30;
    --jewel-emerald: #015f3d;

    /* Luminous highlights */
    --star-white: #e8f5f4;
    --star-glow: #b8ece8;
    --star-dim: #7fb8b5;
}

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

body {
    font-family: 'Space Grotesk', sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    position: relative;
}

/* Main container */
#aladin-lite-div {
    width: 100vw;
    height: 100vh;
    position: relative;
    transition: filter 0.6s ease, transform 0.6s ease;
}

/* When photo viewer is active, add subtle blur to background */
body.photo-viewer-active #aladin-lite-div {
    filter: blur(3px);
    transform: scale(1.05);
}

/* Loading state */
.loading-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(0, 120, 114, 0.3);
    z-index: 3000;
    text-align: center;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 120, 114, 0.2);
    border-top: 3px solid var(--nebula-light);
    border-radius: 50%;
    margin: 0 auto 20px;
    animation: spin 1s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

/* Brand overlay */
.brand-overlay {
    position: absolute;
    top: 100px;
    left: 30px;
    z-index: 999;
    /* Below Aladin controls */
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    padding: 15px 25px;
    border-radius: 15px;
    border: 1px solid rgba(0, 120, 114, 0.2);
}

/* Move brand down on screens where it might overlap with controls */
@media (max-width: 1400px) {
    .brand-overlay {
        top: 100px;
        /* Move below Aladin controls */
    }
}

.brand-overlay * {
    pointer-events: auto;
}

.brand-logo {
    font-family: 'Orbitron', monospace;
    font-size: 1.4em;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    background: linear-gradient(45deg, var(--nebula-light), var(--nebula-bright));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.tagline {
    font-size: 0.8em;
    opacity: 0.8;
    letter-spacing: 0.1em;
    font-weight: 300;
}

/* Control panel */
.control-panel {
    position: absolute;
    top: 100px;
    right: 30px;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 25px;
    z-index: 1000;
    min-width: 320px;
    max-width: 400px;
}

.panel-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.panel-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.panel-section h3 {
    font-family: 'Orbitron', monospace;
    font-size: 1em;
    margin-bottom: 15px;
    font-weight: 400;
    color: var(--nebula-light);
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search functionality */
.search-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.search-input {
    flex: 1;
    padding: 10px 15px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9em;
}

.search-button {
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* My captures section */
.captures-stats {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
}

.stat-box {
    flex: 1;
    padding: 15px;
    background: rgba(0, 75, 73, 0.15);
    border-radius: 10px;
    border: 1px solid rgba(0, 120, 114, 0.25);
    text-align: center;
}

.stat-number {
    font-size: 2em;
    font-weight: 700;
    color: var(--nebula-light);
    font-family: 'Orbitron', monospace;
}

.stat-label {
    font-size: 0.75em;
    opacity: 0.8;
    margin-top: 3px;
}

.action-button {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, var(--nebula-primary), var(--nebula-accent));
    border: none;
    border-radius: 8px;
    color: var(--star-white);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95em;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: 'Orbitron', monospace;
    box-shadow: 0 4px 15px rgba(0, 120, 114, 0.3);
}

.action-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 168, 157, 0.5);
    background: linear-gradient(135deg, var(--nebula-accent), var(--nebula-light));
}

.action-button.secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: none;
}

.action-button.secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Photo list */
.photo-list {
    max-height: 200px;
    overflow-y: auto;
    margin-top: 10px;
}

.photo-list-item {
    padding: 8px 12px;
    margin-bottom: 5px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    font-size: 0.85em;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.photo-list-item:hover {
    background: rgba(0, 120, 114, 0.15);
    border-color: rgba(0, 168, 157, 0.3);
    padding-left: 16px;
}

.photo-status {
    font-size: 0.75em;
    opacity: 0.6;
}

/* Survey selector */
.survey-select {
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: #fff;
    font-size: 0.9em;
}

/* Bottom controls */
.bottom-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 10px 20px;
    z-index: 1000;
    display: flex;
    gap: 20px;
    align-items: center;
}

.control-hint {
    font-size: 0.85em;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Photo viewer modal */
.photo-viewer {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
    pointer-events: none;
}

.photo-viewer.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Clickable backdrop */
.photo-viewer-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
    z-index: 1;
}

.photo-viewer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    max-width: 90vw;
    max-height: 90vh;
    text-align: center;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 2;
    pointer-events: none;
}

.photo-viewer.active .photo-viewer-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    transition-delay: 0.2s;
    pointer-events: auto;
}

.photo-viewer img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(0, 168, 157, 0.3);
    opacity: 0;
    transform: scale(0.95);
    transition: all 0.4s ease 0.3s;
}

.photo-viewer.active img {
    opacity: 1;
    transform: scale(1);
}

/* Photo viewer info styling */
.photo-viewer-info {
    margin-top: 20px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    background: rgba(0, 0, 0, 0.8);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.photo-viewer-info h2 {
    font-family: 'Orbitron', monospace;
    font-size: 2em;
    margin-bottom: 10px;
    color: var(--nebula-light);
    font-weight: 400;
    letter-spacing: 0.1em;
}

.photo-viewer-info p {
    opacity: 0.8;
    line-height: 1.6;
    margin-bottom: 5px;
}

.photo-details {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 168, 157, 0.2);
    font-size: 0.9em;
    opacity: 0.7;
}

.close-viewer {
    position: fixed;
    top: 40px;
    right: 40px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--nebula-accent), var(--nebula-light));
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 28px;
    font-weight: bold;
    color: var(--space-black);
    opacity: 0;
    transform: scale(0.8) rotate(-90deg);
    box-shadow: 0 4px 20px rgba(0, 168, 157, 0.5);
    z-index: 2001;
}

.photo-viewer.active .close-viewer {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    transition-delay: 0.4s;
}

.close-viewer:hover {
    background: linear-gradient(135deg, var(--nebula-light), var(--nebula-bright));
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 30px rgba(0, 212, 200, 0.7);
}

/* Add click instruction */
.click-to-close {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 16px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2001;
}

.photo-viewer.active .click-to-close {
    opacity: 1;
    transition-delay: 1s;
}

/* Custom marker animation */
@keyframes photoBeacon {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.15);
        opacity: 0.9;
    }
}

@keyframes pulseRing {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

    100% {
        transform: scale(2.5);
        opacity: 0;
    }
}

/* Hide Aladin grid elements */
.aladin-cooGrid {
    display: none !important;
    visibility: hidden !important;
}

/* Hide grid canvas specifically */
canvas.aladin-cooGrid {
    display: none !important;
}

/* Hide all coordinate grid related elements */
[class*="cooGrid"] {
    display: none !important;
}

/* Make location indicator more subtle */
.aladin-location-indicator {
    opacity: 0.5;
}

/* Override any inline styles for grid */
#aladin-lite-div canvas:nth-child(2),
#aladin-lite-div canvas:nth-child(3) {
    opacity: 1 !important;
    /* Keep opacity but check in JS */
}

::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 168, 157, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 168, 157, 0.5);
}

/* Responsive close button */
@media (max-width: 768px) {
    .close-viewer {
        top: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 24px;
    }

    .control-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        max-height: 50vh;
        overflow-y: auto;
        border-radius: 20px 20px 0 0;
    }

    .bottom-controls {
        bottom: auto;
        top: 20px;
        font-size: 0.8em;
        padding: 8px 15px;
    }

    .brand-overlay {
        top: auto;
        bottom: 20px;
        left: 20px;
        padding: 10px 20px;
    }

    .brand-logo {
        font-size: 1.2em;
    }
}

/* For screens where Aladin controls might overlap */
@media (max-width: 1200px) {
    .brand-overlay {
        top: 100px;
        /* Move below Aladin controls */
    }
}

/* Alternative position for very small screens */
@media (max-width: 600px) {
    .brand-overlay {
        top: auto;
        bottom: 20px;
        left: 20px;
    }
}