/* Singleton Scavenger Hunt Tour - Styles */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #10b981;
    --accent-color: #f59e0b;
    --danger-color: #ef4444;
    --background: #f0f9ff;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--background);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    z-index: 1000;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.score-display {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 2rem;
    font-weight: 600;
}

.score-display #score {
    font-size: 1.25rem;
    color: var(--accent-color);
}

/* Progress Bar */
.progress-container {
    background: var(--card-bg);
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.progress-bar {
    height: 8px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.5s ease;
    width: 0%;
}

.progress-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    display: block;
}

/* Map */
#map {
    flex: 1;
    min-height: 300px;
    z-index: 1;
}

/* Custom Markers */
.custom-marker {
    background: none;
    border: none;
}

.marker-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1rem;
    box-shadow: var(--shadow);
    border: 3px solid white;
}

.marker-found {
    background: var(--secondary-color);
    color: white;
}

.marker-current {
    background: var(--accent-color);
    color: white;
    animation: pulse 2s infinite;
}

.marker-hidden {
    background: var(--text-secondary);
    color: white;
    opacity: 0.5;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.7);
    }
    50% {
        transform: scale(1.1);
        box-shadow: 0 0 0 15px rgba(245, 158, 11, 0);
    }
}

.user-marker-inner {
    font-size: 24px;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Challenge Panel */
.challenge-panel {
    background: var(--card-bg);
    padding: 1.5rem;
    border-top: 3px solid var(--primary-color);
    box-shadow: var(--shadow-lg);
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.challenge-number {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.challenge-points {
    color: var(--accent-color);
    font-weight: 600;
}

.challenge-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.clue-box {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1rem;
    border-radius: 0.75rem;
    border-left: 4px solid var(--accent-color);
    margin-bottom: 1rem;
}

.clue-text {
    font-style: italic;
    line-height: 1.6;
    color: #92400e;
}

/* Hint Section */
.hint-section {
    margin-bottom: 1rem;
}

.hint-btn {
    background: none;
    border: 2px dashed var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.hint-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.hint-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hint-text {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: #e0f2fe;
    border-radius: 0.5rem;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

/* Buttons */
.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

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

.btn-success {
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--card-bg);
    border-radius: 1rem;
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    padding: 1.5rem;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.found-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--secondary-color), #059669);
    color: white;
    padding: 0.25rem 1rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    background: none;
    border: none;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: var(--border-color);
}

.location-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
}

.fun-fact {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 0.75rem;
    margin: 1rem 0;
}

.fun-fact-label {
    font-weight: 600;
    color: #92400e;
}

.fun-fact p {
    margin-top: 0.5rem;
    color: #78350f;
}

/* Trivia Section */
.trivia-section {
    background: #f0fdf4;
    padding: 1rem;
    border-radius: 0.75rem;
    margin-top: 1rem;
}

.trivia-section h3 {
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.trivia-options {
    display: grid;
    gap: 0.5rem;
    margin-top: 1rem;
}

.trivia-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 0.5rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
}

.trivia-btn:hover:not(:disabled) {
    border-color: var(--primary-color);
    background: #eff6ff;
}

.trivia-btn.correct {
    border-color: var(--secondary-color);
    background: #d1fae5;
}

.trivia-btn.incorrect {
    border-color: var(--danger-color);
    background: #fee2e2;
}

.trivia-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 600;
}

.trivia-result.correct {
    background: #d1fae5;
    color: #065f46;
}

.trivia-result.incorrect {
    background: #fee2e2;
    color: #991b1b;
}

.trivia-answered {
    color: var(--secondary-color);
    font-weight: 600;
}

.modal-content > .btn {
    margin: 1rem;
    width: calc(100% - 2rem);
}

/* Victory Modal */
.victory-content {
    text-align: center;
    padding: 2rem;
}

.victory-content h1 {
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.victory-trophy {
    font-size: 5rem;
    animation: bounce 1s infinite;
}

.final-score {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    padding: 1.5rem;
    border-radius: 1rem;
    margin: 1.5rem 0;
}

.final-score p:first-child {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

#rank-text {
    font-size: 1.25rem;
    color: var(--primary-color);
    margin-top: 0.5rem;
}

.achievements {
    text-align: left;
    margin: 1.5rem 0;
}

.achievements h3 {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.achievement-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    margin-bottom: 0.5rem;
}

.achievement-icon {
    font-size: 2rem;
}

.achievement-info strong {
    display: block;
    color: var(--text-primary);
}

.achievement-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.victory-content .btn {
    margin: 0.5rem;
}

/* Sidebar */
.sidebar {
    position: fixed;
    right: -280px;
    top: 0;
    bottom: 0;
    width: 280px;
    background: var(--card-bg);
    box-shadow: var(--shadow-lg);
    z-index: 1500;
    transition: right 0.3s ease;
}

.sidebar.open {
    right: 0;
}

.sidebar-toggle {
    position: absolute;
    left: -50px;
    top: 100px;
    width: 50px;
    height: 50px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0.5rem 0 0 0.5rem;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.sidebar-content {
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.sidebar-content h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

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

.found-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.found-list li:hover {
    background: #f1f5f9;
}

.found-icon {
    width: 28px;
    height: 28px;
    background: var(--secondary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.found-name {
    font-weight: 500;
    color: var(--text-primary);
}

.empty-list {
    color: var(--text-secondary);
    font-style: italic;
    text-align: center;
    padding: 2rem 0;
}

/* Popup Content */
.popup-content h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.popup-content p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        padding: 0.75rem 1rem;
    }

    .header h1 {
        font-size: 1.2rem;
    }

    .challenge-panel {
        padding: 1rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }

    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .sidebar {
        width: 100%;
        right: -100%;
    }

    .sidebar.open {
        right: 0;
    }

    .sidebar-toggle {
        left: -45px;
        width: 45px;
        height: 45px;
    }
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 0.75rem;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    margin: 1rem;
}

/* Animation Classes */
.animate-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
