/* Modern Art Gallery Theme */
@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700&family=Playfair+Display:ital,wght@0,400;0,700;1,400&display=swap');

:root {
    --primary-bg: #ffffff;
    --secondary-bg: #f8f9fa;
    --text-main: #212529;
    --text-muted: #495057;
    --accent-color: #d4a373; /* Elegant Gold/Bronze */
    --accent-hover: #b08d55;
    --dark-accent: #111111;
    --border-color: #e9ecef;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--primary-bg);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--dark-accent);
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 { font-size: 3.5rem; letter-spacing: -1px; }
h2 { font-size: 2.5rem; }
h3 { font-size: 1.75rem; }

a {
    color: var(--dark-accent);
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* Navbar */
.navbar-gallery {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 2rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skip-link {
    position: absolute;
    left: 16px;
    top: -40px;
    background: #111827;
    color: #f9fafb;
    padding: 8px 12px;
    border-radius: 4px;
    z-index: 2000;
    text-decoration: none;
    font-size: 0.9rem;
}

.skip-link:focus {
    top: 16px;
}

.navbar-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 24px;
    height: 18px;
    background: transparent;
    border: none;
    padding: 0;
    margin-right: 0.5rem;
    cursor: pointer;
}

.navbar-toggle span {
    display: block;
    height: 2px;
    width: 100%;
    background: var(--dark-accent);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.navbar-toggle.is-open span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.navbar-toggle.is-open span:nth-child(2) {
    opacity: 0;
}

.navbar-toggle.is-open span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

.navbar-brand {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-accent);
    text-transform: uppercase;
    letter-spacing: 2px;
}

.nav-links a {
    margin-left: 2rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 400;
    color: var(--text-main);
}

.nav-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

@media (max-width: 768px) {
    .navbar-gallery {
        padding: 0.75rem 1.25rem;
    }

    .navbar-toggle {
        display: flex;
    }

    .nav-links {
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        display: none;
        flex-direction: column;
        background: rgba(0, 0, 0, 0.9);
        padding: 0.75rem 1.25rem 1rem;
        text-align: left;
    }

    .nav-links a {
        margin: 0.35rem 0;
        color: #ffffff;
    }

    .nav-links.nav-open {
        display: flex;
    }
}

/* Hero Section */
.hero-section {
    position: relative;
    height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-size: cover;
    background-position: center;
    color: #fff;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.4); /* Darken for text readability */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    padding: 2rem;
}

.hero-title {
    font-size: 4rem;
    color: #fff;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2rem;
    font-weight: 300;
}

/* Buttons */
.btn-gallery {
    display: inline-block;
    padding: 12px 30px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border: 2px solid #fff;
    color: #fff;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-gallery:hover {
    background: #fff;
    color: var(--dark-accent);
}

.btn-gallery-dark {
    border-color: var(--dark-accent);
    color: var(--dark-accent);
}

.btn-gallery-dark:hover {
    background: var(--dark-accent);
    color: #fff;
}

.btn-gallery-white {
    border-color: #ffffff;
    color: #ffffff;
}

.btn-gallery-white:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Gallery Grid */
.gallery-container {
    padding: 4rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.audio-guide {
    margin-bottom: 3rem;
    padding: 1.5rem 1.75rem;
    border-radius: 16px;
    background: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.audio-guide-title {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #000000;
}

.audio-guide-text {
    margin-bottom: 1rem;
    font-size: 0.98rem;
    color: #000000;
}

.audio-guide-player {
    width: 100%;
    max-width: 420px;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
    padding-bottom: 1rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background-color: var(--accent-color);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.gallery-card {
    background: var(--primary-bg);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.gallery-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.gallery-image-wrapper {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.gallery-image {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-card:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-info {
    padding: 1.5rem;
    text-align: center;
}

.gallery-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--dark-accent);
}

.gallery-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Footer */
.footer-gallery {
    background-color: #111;
    color: #fff;
    padding: 4rem 2rem;
    text-align: center;
}

.footer-links a {
    color: #aaa;
    margin: 0 10px;
}

.footer-links a:hover {
    color: #fff;
}

/* Utility */
.museu-origem-text {
    margin-bottom: 1rem;
}

.museu-origem-dark {
    display: none;
}

.text-center { text-align: center; }
.mb-4 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1.5rem; }

/* Dark Theme */
[data-theme="dark"] {
    --primary-bg: #0f1418;
    --secondary-bg: #172026;
    --text-main: #e6e6e6;
    --text-muted: #b8bec5;
    --accent-color: #e0b66a;
    --accent-hover: #f0c478;
    --dark-accent: #f5f5f5;
    --border-color: #2a3138;
}

[data-theme="dark"] body {
    background-color: var(--primary-bg);
    color: var(--text-main);
}

[data-theme="dark"] .navbar-gallery {
    background-color: rgba(16, 22, 28, 0.95);
    border-bottom-color: var(--border-color);
}

[data-theme="dark"] .navbar-brand {
    color: var(--dark-accent);
}

[data-theme="dark"] .nav-links a {
    color: var(--text-main);
}

[data-theme="dark"] .gallery-card {
    background: var(--secondary-bg);
}

[data-theme="dark"] .gallery-title {
    color: var(--dark-accent);
}

[data-theme="dark"] .gallery-meta {
    color: var(--text-muted);
}

[data-theme="dark"] .objetivos-titulo,
[data-theme="dark"] .objetivos-lista .list-group-item {
    color: #ffffff;
}

[data-theme="dark"] .museu-origem-light {
    display: none;
}

[data-theme="dark"] .museu-origem-dark {
    display: block;
    color: #ffffff;
}

/* Floating Chat Button */
.museum-chat-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1300;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.museum-chat-fab img {
    width: 70%;
    height: 70%;
    object-fit: contain;
}

.museum-chat-fab:hover {
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.6);
    background: rgba(0, 0, 0, 0.8);
}

@media (max-width: 768px) {
    .museum-chat-fab {
        right: 16px;
        bottom: 16px;
        width: 56px;
        height: 56px;
    }
}

/* Chat Overlay + Glassmorphic Modal */
.museum-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: none;
    align-items: center;
    justify-content: center;
}

.museum-chat-overlay.is-open {
    display: flex;
}

.museum-chat-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 5, 5, 0.65);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.museum-chat-modal {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    background: rgba(25, 25, 30, 0.55);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    padding: 16px 18px 18px 18px;
    display: flex;
    flex-direction: column;
    color: #f9fafb;
}

.museum-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.museum-chat-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.museum-chat-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
}

.museum-chat-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: contain;
}

.museum-chat-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.museum-chat-subtitle {
    font-size: 0.8rem;
    color: #e5e7eb;
    opacity: 0.85;
}

.museum-chat-close {
    background: transparent;
    border: none;
    color: #e5e7eb;
    font-size: 1rem;
    cursor: pointer;
    padding: 4px 8px;
}

.museum-chat-close:hover {
    color: #f97316;
}

.museum-chat-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 14px;
    background: radial-gradient(circle at 0 0, rgba(255, 234, 0, 0.12), transparent 55%),
                radial-gradient(circle at 100% 100%, rgba(170, 0, 255, 0.16), transparent 60%),
                rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(148, 163, 184, 0.3);
    padding: 10px;
}

.museum-chat-messages {
    flex: 1;
    max-height: 260px;
    overflow-y: auto;
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.museum-chat-input-row {
    display: flex;
    gap: 8px;
}

.museum-chat-input-row input[type="text"] {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 10px 14px;
    font-size: 0.9rem;
}

.museum-chat-input-row button {
    border-radius: 999px;
}

.museum-chat-message {
    margin-bottom: 6px;
}

.museum-chat-message strong {
    font-weight: 600;
}
