/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a9eff;
    --secondary-color: #ff8c42;
    --accent-color: #ffa726;
    --text-dark: #e0e0e0;
    --text-light: #b0b0b0;
    --bg-dark: #000000;
    --bg-dark-alt: #0a0a0a;
    --bg-card: #1a1a1a;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.8);
    --glow-orange: rgba(255, 138, 66, 0.3);
    --glow-blue: rgba(74, 158, 255, 0.4);
    --house-default: rgba(255, 255, 255, 0.8);
}

body {
    font-family: 'Crimson Text', serif;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-dark);
    font-size: 18px;
    /* Performance optimizations */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 {
    font-family: 'Crimson Text', serif;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* Language Switcher */
.language-switcher {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 1001;
    display: flex;
    gap: 10px;
    background: var(--bg-card);
    padding: 10px 15px;
    border-radius: 25px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.lang-link {
    color: var(--text-light);
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 15px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 600;
}

.lang-link:hover {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.lang-link.active {
    color: var(--white);
    background: var(--primary-color);
}

.lang-separator {
    color: var(--text-light);
    font-weight: 300;
    pointer-events: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 80px 0;
}

/* Hero Section */
.hero {
    height: 70vh;
    min-height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-bg-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.5));
}

.hero-overlay {
    position: relative;
    text-align: center;
    color: var(--white);
    z-index: 1;
}

.hero-title {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.hero-subtitle {
    font-size: 1.5rem;
    font-weight: 300;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Navigation */
.navbar {
    background-color: var(--bg-dark-alt);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    backface-visibility: hidden;
    transform: translateZ(0);
}

.navbar .container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    position: relative;
}

.navbar-brand {
    position: absolute;
    left: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 1px;
    opacity: 0;
    transition: opacity 0.3s ease;
    will-change: opacity;
}

.navbar.scrolled .navbar-brand {
    opacity: 1;
}

.navbar-links {
    display: flex;
    gap: 40px;
}

.nav-link {
    color: var(--text-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link:hover::after {
    width: 100%;
}

/* Welcome Section */
.welcome-section {
    background-color: var(--bg-dark);
    text-align: center;
}

.welcome-section h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    color: var(--white);
}

.intro-text {
    font-size: 1.2rem;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    color: var(--text-light);
}

/* History Section */
.history-section {
    background-color: var(--bg-dark-alt);
    position: relative;
}

.history-section h2 {
    font-size: 3rem;
    margin-bottom: 80px;
    text-align: center;
    color: var(--white);
}

/* Timeline */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 60px auto;
    padding: 40px 0;
    overflow: visible;
}

.timeline-info-btn {
    position: absolute;
    right: -10%;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px 15px;
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    z-index: 10;
}

.timeline-info-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* History info button (for English version with grid layout) */
.history-info-btn {
    padding: 10px 15px;
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-info-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.timeline-line {
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 4px;
    background: var(--white);
    transform: translateY(-50%);
    border-radius: 2px;
}

.timeline-events {
    display: flex;
    justify-content: space-around;
    align-items: center;
    position: relative;
    padding: 0 10%;
}

.timeline-event {
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    will-change: transform;
}

.timeline-event:hover .timeline-dot {
    transform: scale(1.5);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

.timeline-event:hover .timeline-year {
    color: var(--accent-color);
    transform: translateY(-5px);
}

.timeline-dot {
    width: 20px;
    height: 20px;
    background: var(--white);
    border-radius: 50%;
    margin: 0 auto 15px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

.timeline-year {
    color: var(--white);
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

/* Timeline Popup */
.timeline-popup {
    position: fixed;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 30px;
    max-width: 500px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transform: scale(0.9);
    transition: all 0.15s ease;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    will-change: transform, opacity;
}

.timeline-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.timeline-popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 28px;
    cursor: pointer;
    transition: color 0.3s;
    width: 30px;
    height: 30px;
    padding: 0;
    line-height: 1;
}

.timeline-popup-close:hover {
    color: var(--white);
}

.timeline-popup h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 10px;
    padding-right: 30px;
}

.timeline-popup-year {
    color: var(--accent-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.timeline-popup p {
    color: var(--text-light);
    line-height: 1.7;
    font-size: 1.1rem;
}

.timeline-popup-sources {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-popup-sources h4 {
    color: var(--white);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.timeline-popup-sources ul {
    list-style: none;
    padding: 0;
}

.timeline-popup-sources li {
    padding: 5px 0;
}

.timeline-popup-sources a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.timeline-popup-sources a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Gallery Section */
.gallery-section {
    background-color: var(--bg-dark);
}

.gallery-section h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--white);
}

.gallery-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #e0e0e0;
    aspect-ratio: 4/3;
    will-change: transform;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-lg);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    padding: 30px 15px 15px;
    font-size: 0.9rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow: hidden;
    flex-direction: column;
}

.modal.show {
    display: flex;
}

.modal-content-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    padding: 60px 80px 20px;
}

.modal-content {
    max-width: 100%;
    max-height: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 5px;
}

.close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: var(--white);
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    z-index: 3001;
    transition: color 0.3s;
}

.close:hover {
    color: var(--accent-color);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    font-size: 30px;
    padding: 20px;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s;
    z-index: 3001;
}

.modal-nav:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

.modal-nav.prev {
    left: 20px;
}

.modal-nav.next {
    right: 20px;
}

.modal-caption {
    text-align: center;
    color: var(--white);
    padding: 10px 20px;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.modal-source {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 0 20px 15px;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.modal-source a {
    color: var(--primary-color);
    text-decoration: none;
}

.modal-source a:hover {
    text-decoration: underline;
}

/* Quiz Section */
.quiz-section {
    background-color: var(--bg-dark-alt);
}

.quiz-section h2 {
    font-size: 3rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--white);
}

.quiz-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
}

.quiz-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz-question {
    font-size: 1.4rem;
    margin-bottom: 30px;
    color: var(--text-dark);
    font-weight: 600;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.quiz-option {
    background-color: var(--bg-dark-alt);
    padding: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.1);
    font-size: 1.1rem;
}

.quiz-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(74, 158, 255, 0.1);
}

.quiz-option.selected {
    border-color: var(--primary-color);
    background-color: #e6f2ff;
}

.quiz-option.correct {
    border-color: #28a745;
    background-color: #d4edda;
}

.quiz-option.incorrect {
    border-color: #dc3545;
    background-color: #f8d7da;
}

.quiz-option.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.quiz-btn {
    background-color: transparent;
    color: var(--white);
    padding: 15px 40px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto 0;
}

.quiz-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.quiz-btn:disabled {
    background-color: transparent;
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.4);
    cursor: not-allowed;
}

.quiz-result {
    margin-top: 20px;
    font-size: 1.1rem;
    text-align: center;
    font-weight: 600;
}

.quiz-score {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-card);
    padding: 40px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz-score h3 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.quiz-score p {
    font-size: 1.5rem;
    margin-bottom: 30px;
}

.quiz-score span {
    color: var(--accent-color);
    font-weight: 700;
}

.hidden {
    display: none;
}

/* Footer */
.footer {
    background-color: var(--bg-dark-alt);
    color: var(--white);
    padding: 40px 0;
    text-align: center;
}

.footer a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s;
}

.footer a:hover {
    color: var(--white);
}

.footer-info {
    margin-top: 15px;
}

.footer-contact {
    margin-top: 15px;
    font-size: 0.95rem;
}

.footer-contact a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-contact a:hover {
    color: var(--accent-color);
}

/* 3D Map Section */
.map-section {
    background-color: var(--bg-dark);
    min-height: 600px;
    position: relative;
}

.map-section h2 {
    font-size: 3rem;
    margin-bottom: 30px;
    text-align: center;
    color: var(--white);
}

.map-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 40px;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

#map-container {
    width: 100%;
    height: 600px;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#map-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

/* House Popup */
/* Popup entrance animation */
@keyframes popupEntrance {
    0% {
        opacity: 0;
        transform: scale(0.85) translateY(10px);
    }
    60% {
        transform: scale(1.03) translateY(0);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.house-popup {
    position: fixed;
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 20px;
    min-width: 300px;
    max-width: 350px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    transform: scale(0.85) translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.house-popup.show {
    pointer-events: auto;
    opacity: 1;
    animation: popupEntrance 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.house-popup.expanded {
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    pointer-events: auto;
    opacity: 1;
    /* Better scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Ensure padding at bottom so content isn't cut off */
    padding-bottom: 30px;
}

/* Fullscreen modal for "Meer Info" */
.house-popup.fullscreen {
    position: fixed;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%) !important;
    max-width: 95vw;
    width: 1200px;
    max-height: 95vh;
    height: auto;
    overflow-y: auto;
    pointer-events: auto;
    opacity: 1;
    z-index: 2000;
    padding: 40px;
    /* Better scrolling on mobile */
    -webkit-overflow-scrolling: touch;
    /* Ensure padding at bottom so content isn't cut off */
    padding-bottom: 50px;
    /* Add backdrop */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
}

.house-popup.fullscreen .popup-close {
    display: block;
    font-size: 32px;
    width: 40px;
    height: 40px;
}

/* Hide "Meer Info" button - clicking directly shows fullscreen */
.popup-btn-primary {
    display: none;
}

/* Custom scrollbar styling for popup */
.house-popup.expanded::-webkit-scrollbar {
    width: 8px;
}

.house-popup.expanded::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.house-popup.expanded::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.house-popup.expanded::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.popup-close {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: none;
    transition: color 0.3s;
}

.house-popup.expanded .popup-close {
    display: block;
}

.popup-close:hover {
    color: var(--white);
}

.popup-house-info h3 {
    margin: 0 0 5px 0;
    color: var(--white);
    font-size: 1.3rem;
}

.popup-house-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.popup-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin: 15px 0;
}

.popup-description {
    color: var(--text-dark);
    line-height: 1.6;
    margin-bottom: 15px;
    display: none;
}

.house-popup.expanded .popup-description,
.house-popup.fullscreen .popup-description {
    display: block;
}

.popup-buttons {
    display: none;
    gap: 10px;
    margin-top: 15px;
}

.house-popup.expanded .popup-buttons,
.house-popup.fullscreen .popup-buttons {
    display: flex;
}

.popup-btn {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s ease;
    background-color: transparent;
    color: var(--white);
}

.popup-btn-primary {
    border-color: rgba(255, 255, 255, 0.4);
}

.popup-btn-primary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.popup-btn-secondary {
    border-color: rgba(255, 255, 255, 0.3);
}

.popup-btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Expanded Popup Content */
.popup-expanded-content {
    display: none;
}

.house-popup.expanded .popup-expanded-content,
.house-popup.fullscreen .popup-expanded-content {
    display: block;
}

.popup-gallery {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 20px 0;
}

.popup-gallery img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.3s;
}

.popup-gallery img:hover {
    transform: scale(1.05);
}

.popup-facts {
    margin: 20px 0;
}

.popup-facts h4 {
    color: var(--white);
    margin-bottom: 10px;
}

.popup-facts ul {
    list-style: none;
    padding: 0;
}

.popup-facts li {
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-dark);
}

.popup-facts li:before {
    content: "▸ ";
    color: var(--accent-color);
    font-weight: bold;
    margin-right: 8px;
}

/* Sources Section */
.popup-sources {
    margin: 20px 0;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-sources h4 {
    color: var(--white);
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.popup-sources ul {
    list-style: none;
    padding: 0;
}

.popup-sources li {
    padding: 5px 0;
}

.popup-sources a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s ease;
}

.popup-sources a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* Info Submission Modal */
.info-submit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.info-submit-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.info-submit-content {
    background: var(--bg-card);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 40px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.info-submit-content .popup-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 32px;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: block;
    transition: color 0.3s;
    z-index: 1;
}

.info-submit-content .popup-close:hover {
    color: var(--white);
}

.info-submit-content h3 {
    color: var(--white);
    font-size: 1.8rem;
    margin-bottom: 25px;
    padding-right: 40px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-dark);
    font-weight: 600;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px;
    background: var(--bg-dark-alt);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-dark);
    font-family: inherit;
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.captcha-container {
    background: var(--bg-dark-alt);
    padding: 15px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.captcha-question {
    flex: 1;
    color: var(--text-dark);
}

.captcha-input {
    width: 80px !important;
    text-align: center;
}

.form-buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.form-submit {
    flex: 1;
    padding: 12px;
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.form-submit:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.form-submit:disabled {
    background-color: #666;
    cursor: not-allowed;
}

.form-cancel {
    flex: 1;
    padding: 12px;
    background-color: transparent;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.form-cancel:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

/* Changelog Section */
.changelog-section {
    background-color: var(--bg-dark-alt);
    padding: 60px 0;
}

.changelog-section h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--white);
}

.changelog-intro {
    text-align: center;
    color: var(--text-light);
    margin-bottom: 10px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.changelog-btn {
    background-color: transparent;
    color: var(--white);
    padding: 12px 30px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.changelog-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
}

.rss-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
    text-decoration: none;
    margin-left: 10px;
    transition: color 0.3s ease;
}

.rss-link:hover {
    color: var(--accent-color);
}

.rss-link svg {
    vertical-align: middle;
}

.changelog-list {
    max-width: 800px;
    margin: 0 auto;
}

.changelog-entry {
    background: rgba(255, 255, 255, 0.03);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 15px;
    align-items: start;
}

.changelog-date {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.changelog-description {
    color: var(--text-light);
    line-height: 1.6;
}

.changelog-source {
    grid-column: 2;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .changelog-entry {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .changelog-source {
        grid-column: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 3rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .section {
        padding: 50px 0;
    }

    /* Mobile navbar: brand row on top, menu links below */
    .navbar .container {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        padding: 15px 20px;
    }

    /* When scrolled, show brand to the left of language switcher */
    .navbar.scrolled .navbar-brand {
        position: fixed;
        left: 20px;
        top: 12px;
        z-index: 1002;
    }

    .navbar-brand {
        position: relative;
        left: auto;
        display: none;
    }

    .navbar.scrolled .navbar-brand {
        display: block;
    }

    /* Add left padding to menu when brand is visible (scrolled) */
    .navbar.scrolled .navbar-links {
        padding-left: 100px;
    }

    .navbar-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        padding-top: 5px;
    }

    /* Vertical timeline for mobile - dot | line | year layout */
    .timeline-container {
        display: flex;
        flex-direction: column;
        position: relative;
        padding-left: 80px;
    }

    .timeline-events {
        flex-direction: column;
        gap: 0;
        padding: 0;
        position: relative;
    }

    .timeline-line {
        position: absolute;
        left: 45px;
        right: auto;
        top: 0;
        bottom: 0;
        height: 100%;
        width: 4px;
        transform: none;
    }

    .timeline-event {
        display: flex;
        align-items: center;
        padding: 25px 0;
        position: relative;
    }

    .timeline-dot {
        position: absolute;
        left: -72px;
        margin: 0;
        flex-shrink: 0;
    }

    .timeline-year {
        text-align: left;
        font-size: 1.2rem;
    }

    /* Info button at bottom of timeline */
    .timeline-info-btn {
        position: static;
        transform: none;
        display: block;
        margin: 30px auto 0;
        order: 1;
    }

    .timeline-events {
        order: 0;
    }

    /* Timeline popup - wider on mobile */
    .timeline-popup {
        width: 90vw;
        max-width: 400px;
        max-height: 80vh;
        overflow-y: auto;
        padding: 25px;
    }

    .timeline-popup h3 {
        font-size: 1.3rem;
        padding-right: 30px;
    }

    h2 {
        font-size: 2rem !important;
    }

    .history-grid {
        grid-template-columns: 1fr;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .modal-nav {
        padding: 10px;
        font-size: 20px;
    }

    .quiz-container {
        padding: 25px;
    }

    .quiz-question {
        font-size: 1.2rem;
    }

    .quiz-option {
        font-size: 1rem;
        padding: 15px;
    }

    /* House popup - centered on mobile */
    .house-popup {
        left: 50% !important;
        top: 50% !important;
        transform: translate(-50%, -50%) !important;
        max-width: 90vw;
        width: 320px;
    }

    .house-popup.show {
        animation: none;
        opacity: 1;
        transform: translate(-50%, -50%) !important;
    }

    .house-popup.expanded {
        width: 95vw;
        max-width: 95vw;
        max-height: 85vh;
    }

    .house-popup.fullscreen {
        width: 95vw;
        max-width: 95vw;
        padding: 25px;
        padding-bottom: 40px;
    }

    .info-submit-content {
        padding: 25px;
        max-height: 95vh;
    }

    .form-buttons {
        flex-direction: column;
    }

    .history-section h2 {
        font-size: 2.5rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .container {
        padding: 0 15px;
    }

    .timeline-info-btn,
    .history-info-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

/* History Card Sources (for English version) */
.history-card-sources {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.history-card-sources a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.history-card-sources a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}
