:root {
    --bg-color: #f5f5f5;
    --sidebar-bg: #2c3e50;
    --sidebar-text: #ecf0f1;
    --accent-color: #e74c3c;
    --text-color: #333;
    --light-gray: #bdc3c7;
    --modal-bg: #fff;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-color);
    height: 100vh;
    overflow: hidden;
    /* Prevent body scroll, handle inside containers */
}

/* Layout */
.main-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

.floor-plan-container {
    flex: 1;
    background-color: #e0e0e0;
    /* Gray background as requested when modal closed */
    position: relative;
    overflow: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease;
}

.sidebar {
    width: 350px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Sidebar Content */
.sidebar header {
    text-align: center;
    margin-bottom: 2rem;
}

.nav-logo {
    width: 80px;
    cursor: pointer;
    margin-bottom: 1rem;
    transition: transform 0.2s;
}

.nav-logo:hover {
    transform: scale(1.1);
}

.sidebar h1 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar h2 {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.8;
}

.project-description {
    flex: 1;
    line-height: 1.6;
    font-size: 0.95rem;
}

.project-description p {
    margin-bottom: 1rem;
}

.sidebar footer {
    text-align: center;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 1rem;
}

.footer-logo {
    height: 40px;
    margin-bottom: 0.5rem;
}

/* Floor Plan */
.floor-plan-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.floor-plan-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

/* Object Buttons */
.obj-btn {
    position: absolute;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    z-index: 5;
}

.obj-btn img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.obj-btn:hover {
    transform: scale(1.2);
    box-shadow: 0 0 15px var(--accent-color);
    background-color: #fff;
    z-index: 6;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    /* Dark background when modal open */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--modal-bg);
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    padding: 3rem;
    border-radius: 8px;
    position: relative;
    z-index: 1001;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    animation: slideUp 0.4s ease-out;
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close-modal-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.close-modal-btn:hover {
    color: var(--accent-color);
}

.modal-body {
    text-align: left;
}

.story-metadata {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #7f8c8d;
}

.meta-tag {
    background: #f0f2f5;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
}

.modal h3 {
    font-family: var(--font-heading);
    font-size: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    color: #2c3e50;
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 1rem;
    display: inline-block;
    width: 100%;
}

.story-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 2rem;
}

.story-text p {
    margin-bottom: 1.2rem;
    text-align: justify;
}

.story-author {
    text-align: right;
    font-style: italic;
    font-weight: 600;
    color: #555;
    margin-top: 2rem;
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

/* Media Queries */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
        overflow: auto;
    }

    body {
        overflow: auto;
    }

    .sidebar {
        width: 100%;
        order: 2;
    }

    .floor-plan-container {
        height: 60vh;
        /* Adjust as needed */
        order: 1;
    }

    .modal-content {
        padding: 1.5rem;
        width: 95%;
    }
}

/* QR Button */
.footer-qr-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.6);
    padding: 5px 10px;
    font-size: 0.8rem;
    margin-top: 15px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-qr-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: #fff;
}