@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&display=swap');

body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: #e7e7e7;
    color: #181818;
}

h1, h2, h5 {
    font-weight: 600;
    color: #111;
}

.container {
    
    margin: 0 auto;
    padding: 2rem 1rem;
}

.project-list {
    display: flex;
    flex-direction: column;
    gap: 2.2rem;
    align-items: flex-start;
    padding: 0;
    background: none;
    min-height: 60vh;
}

/* PROJETO COMO BLOCO DE TEXTO */
.project {
    background: none;
    border: none;
    border-radius: 18px;
    box-shadow: none;
    max-width: 600px;
    min-width: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 1.5rem 2rem 1.5rem 2rem;
    position: relative;
    animation: fadeInUp 0.6s cubic-bezier(.4,2,.6,1);
    background-color: #f5f5f5;
    /* Mais espaço interno */
}

.project-card {
    width: 340px;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 4px 24px #0002;
    background: #fff;
    cursor: pointer;
    transition: box-shadow 0.2s;
    margin-bottom: 1.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    
}

.project-card:hover {
    box-shadow: 0 8px 32px #0003;
    translate: 0 -2px;
}

.project-header {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 0.2rem;
    letter-spacing: 0.2px;
    text-align: left;
    position: relative;
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.project-header::before {
    content: "";
    display: inline-block;
    width: 26px;
    height: 26px;
    margin-right: 2px;
    background: url('../img/360icon.webp') no-repeat center center;
    background-size: contain;
    vertical-align: middle;
    flex-shrink: 0;
}

.project-header::after {
    content: "";
    display: block;
    width: 36px;
    height: 2px;
    background: #111;
    border-radius: 2px;
    margin-top: 6px;
    transition: width 0.3s cubic-bezier(.4,2,.6,1), background 0.3s;
    opacity: 0.15;
}

.project-header:hover {
    color: #000;
}

.project-header:hover::after {
    width: 60px;
    background: #000;
    opacity: 0.25;
}

.project-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.project-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s;
    z-index: 2;
}

.project-card:hover .project-overlay {
    opacity: 0;
}

.icon-360 {
    width: 54px;
    height: 54px;
    opacity: 0.92;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px #0006);
}

.project-info {
    padding: 1.1rem 1.3rem 0.7rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.project-title {
    font-size: 1.18rem;
    font-weight: 700;
    color: #181818;
    margin-bottom: 0.2rem;
    letter-spacing: 0.2px;
}

.project-description {
    color: #444;
    font-size: 1rem;
    margin-bottom: 0.7rem;
    text-align: left;
    min-height: 0;
    line-height: 1.5;
}

/* SALAS EM COLUNA, LINKS COM PERSONALIDADE */
.room-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    width: 100%;
    max-height: 0;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.4s cubic-bezier(.4,2,.6,1), opacity 0.3s;
    overflow: hidden;
    margin-top: 0;
    padding: 0;
}

.project.open .room-list {
    max-height: 500px;
    opacity: 1;
    pointer-events: auto;
    margin-top: 0.5rem;
    padding-top: 0.2rem;
}

.room-list a {
    color: #111;
    background: #f5f5f5;
    border-radius: 5px;
    padding: 0.18rem 1.5rem;
    font-size: 0.98rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: color 0.16s, background 0.16s, border 0.16s;
    display: inline-block;
    cursor: pointer;
    min-width: 120px;
    text-align: center;
    height: 2rem;
    line-height: 1.7rem;
}

.room-list a.active,
.room-list a[aria-current="true"] {
    background: #111;
    color: #fff;
    border: 1px solid #111;
    cursor: default;
    pointer-events: none;
}

.room-list a:hover, .room-list a:focus {
    color: #fff;
    background: #111;
    border: 1px solid #111;
    text-decoration: none;
    outline: none;
}

/* ANIMAÇÃO SUAVE DE ENTRADA */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px);}
    to { opacity: 1; transform: translateY(0);}
}

.viewer, #panorama {
    width: 100vw;
    height: 100vh;
    min-height: 400px;
    background: #000;
}

/* Barra superior */
#viewer-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    z-index: 2000;
    pointer-events: none;
}

#viewer-actions {
    display: flex;
    gap: 0.7rem;
    align-items: center;
    margin-right: 1.5rem;
    pointer-events: auto;
}

/* Botões no topo direito */
#home-button, #share-button {
    background: rgba(255,255,255,0.92);
    color: #111;
    border: none;
    border-radius: 6px;
    padding: 0.38rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    margin: 0;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, box-shadow 0.18s;
    box-shadow: 0 1px 4px #0001;
    outline: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
  z-index: 1001; /* muito elevado para garantir visibilidade */

}

#home-button::before {
    content: "";
    display: inline-block;
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.2em;
    background: url('data:image/svg+xml;utf8,<svg fill="black" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M10.707 2.293a1 1 0 00-1.414 0l-7 7A1 1 0 003 11h1v6a1 1 0 001 1h4a1 1 0 001-1v-4h2v4a1 1 0 001 1h4a1 1 0 001-1v-6h1a1 1 0 00.707-1.707l-7-7z"/></svg>') no-repeat center center;
    background-size: contain;
    vertical-align: middle;
}

#home-button:hover, #share-button:hover, #home-button:focus, #share-button:focus {
    background: #111;
    color: #fff;
}

#home-button:hover::before {
    filter: brightness(0) invert(1);
}

/* --- SELECIONAR SALA --- */
#room-selector-container {
    position: fixed;
    left: 2.2rem;
    bottom: 2.2rem;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    z-index: 2001;
}

#current-room {
    background: #111;
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px 8px 8px 0;
    padding: 0.6rem 1.2rem;
    margin-bottom: 0.4rem;
    box-shadow: 0 2px 8px #0002;
    user-select: none;
    pointer-events: none;
}

#select-room-btn {
    background: #fff;
    color: #111;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.4rem 1.1rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.16s, color 0.16s, border 0.16s;
    box-shadow: 0 1px 4px #0001;
    outline: none;
}

#select-room-btn:hover, #select-room-btn:focus {
    background: #111;
    color: #fff;
    border: 1px solid #111;
}

#room-switcher {
    position: fixed;
    left: 2.2rem;
    bottom: 2.2rem;
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    z-index: 2001;
    background: none;
    box-shadow: none;
    padding: 0;
    opacity: 1;
    pointer-events: auto;
}

#room-switcher a {
    color: #111;
    background: #f5f5f5;
    border-radius: 5px;
    padding: 0.32rem 0.85rem;
    font-size: 0.98rem;
    font-weight: 500;
    text-decoration: none;
    border: 1px solid #e0e0e0;
    transition: color 0.16s, background 0.16s, border 0.16s;
    display: inline-block;
    cursor: pointer;
    min-width: 45px;
    text-align: center;
}


#room-switcher a.active,
#room-switcher a[aria-current="true"] {
    background: #111;
    color: #fff;
    border: 1px solid #111;
    cursor: default;
    pointer-events: none;
}

#room-switcher a:hover, #room-switcher a:focus {
    color: #fff;
    background: #111;
    border: 1px solid #111;
    text-decoration: none;
    outline: none;
}

/* --- MENSAGEM LINK COPIADO --- */
#share-feedback {
    position: fixed;
    top: 70px;
    right: 2rem;
    background: #111;
    color: #fff;
    padding: 0.5rem 1.2rem;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    z-index: 20;
}
#share-feedback.visible {
    opacity: 1;
    pointer-events: auto;
}

/* ANIMAÇÃO SUAVE DE SAÍDA */
@keyframes fadeOutDown {
    from { opacity: 1; transform: translateY(0);}
    to { opacity: 0; transform: translateY(30px);}
}

/* Efeito de transição suave para a barra superior ao entrar/sair da sala */
#viewer-bar {
    animation: fadeInUp 0.4s cubic-bezier(.4,2,.6,1) forwards;
}

.project.open ~ #viewer-bar {
    animation: fadeOutDown 0.4s cubic-bezier(.4,2,.6,1) forwards;
}

/* Desktop: room-switcher sempre visível em linha */
@media (min-width: 769px) {
    #room-switcher {
        display: flex !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: none !important;
        position: fixed;
        left: 2.2rem;
        bottom: 2.2rem;
        flex-direction: row;
        background: none;
        box-shadow: none;
        padding: 0;
        z-index: 2001;
    }
    #room-switcher-toggle {
        display: none !important;
    }
}

/* Hamburger button */
#room-switcher-toggle {
    display: none;
    position: fixed;
    right: 1.2rem;
    bottom: 1.2rem;
    z-index: 2002;
    width: 48px;
    height: 48px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 50%;
    box-shadow: 0 2px 12px #0003;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
    padding: 0;
}

#room-switcher-toggle:hover {
    background-color: #f0f0f0;
    border-color: #bbb;
}

/* Linhas do hamburger */
#room-switcher-toggle span {
    display: block;
    width: 28px;
    height: 3.5px;
    background: #222;
    border-radius: 3px;
    margin: 1px 0;
    transition: all 0.4s ease;
}

/* Se quiseres animação ao abrir, podes usar a classe 'open' para transformar o hamburger num X */
#room-switcher-toggle.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

#room-switcher-toggle.open span:nth-child(2) {
    opacity: 0;
}

#room-switcher-toggle.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Responsivo: mostra hamburger e esconde botões em mobile */
@media (max-width: 768px) {
    #room-switcher {
        display: none;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 70px;
        max-height: 50vh;
        flex-direction: column;
        gap: 0.3rem;
        background: #fff;
        box-shadow: 0 -4px 24px #0003;
        border-radius: 16px 16px 0 0;
        padding: 1rem 1.2rem 0.8rem;
        min-width: unset;
        width: auto;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 2001;
    }
    #room-switcher.open {
        display: flex;
    }
    #room-switcher-toggle {
        display: flex;
        right: 1.2rem;
        bottom: 1.2rem;
        width: 48px;
        height: 48px;
    }
    #room-switcher a {
        min-width: unset;
        width: 100%;
        font-size: 1rem;
        padding: 0.6rem 0.9rem;
        margin: 0;
        text-align: left;
        box-sizing: border-box;
    }

    /* Botões do topo mais compactos em mobile */
    #viewer-actions {
        margin-right: 0.8rem;
        gap: 0.4rem;
    }
    #topview-button,
    #images-button,
    #share-button {
        font-size: 12px;
        padding: 0 0.7rem;
        height: 32px;
    }
    #topview-button {
        width: auto;
    }
}

/* Esconde botões em mobile quando menu está fechado */
#topview-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999;
    animation: zoomIn 0.5s ease forwards;
    overflow: hidden;
}

#topview-overlay.active {
    display: flex;
}

#topview-image {
    min-width: 110%;
    min-height: 110%;
    transition: transform 0.25s ease;
    transform-origin: center center;
    will-change: transform;
}


/* Hotspot clickável com ícone 360º */
.topview-hotspot {
     width: 24px;
    height: 24px;
    background: white;
    border: 2px solid black;
    border-radius: 50%;
    position: absolute;
    z-index: 1000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.topview-hotspot::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background: url('../img/360icon.webp') no-repeat center center;
    background-size: contain;
    vertical-align: middle;
}
.topview-hotspot:hover {
    transform: scale(1.2);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}



/* Zoom animation */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(1.05);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#topview-button {
    position: relative;
    left: 0rem;
    top: 0rem;
    z-index: 30;
    width: 80px;
    height: 35px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3); /* contorno subtil */
    color: #fff;
    background: linear-gradient(145deg, #444, #1a1a1a); /* gradiente suave */
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6); /* melhora leitura */
    background-size: 0% 00%;
    background-repeat: no-repeat;
    background-position: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}

#topview-button:hover {
    background: linear-gradient(145deg, #555, #222); /* ligeiramente mais claro no hover */
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}







/* ===== IMAGES BUTTON ===== */
#images-button {
    position: relative;
    left: 0;
    top: 0;
    z-index: 30;
    height: 35px;
    padding: 0 1.1rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    background: linear-gradient(145deg, #444, #1a1a1a);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.4px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.6);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.3s ease;
}
#images-button:hover {
    background: linear-gradient(145deg, #555, #222);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0,0,0,0.6);
}

/* ===== GALLERY OVERLAY ===== */
#gallery-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10,10,10,0.96);
    z-index: 3000;
    flex-direction: column;
    animation: fadeInGallery 0.25s ease;
}
#gallery-overlay.active {
    display: flex;
}
@keyframes fadeInGallery {
    from { opacity: 0; }
    to { opacity: 1; }
}

#gallery-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 1.8rem 0.7rem 1.8rem;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}
#gallery-title {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}
#gallery-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.2rem;
    transition: color 0.2s;
}
#gallery-close:hover {
    color: #fff;
}

#gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: max-content;
    align-items: start;
    gap: 1rem;
    padding: 1.5rem 1.8rem;
    overflow-y: auto;
    flex: 1;
    align-content: start;
}

.gallery-item {
    background: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    height: fit-content;
}
.gallery-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}
.gallery-item-thumb {
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    position: relative;
    overflow: hidden;
    background: #111;
}
.gallery-item-thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.gallery-item:hover .gallery-item-thumb img {
    opacity: 0.85;
}
.gallery-item-caption {
    padding: 0.45rem 0.7rem 0.5rem;
    color: #bbb;
    font-size: 0.82rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* ===== LIGHTBOX ===== */
#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.97);
    z-index: 4000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    animation: fadeInGallery 0.2s ease;
}
#lightbox.active {
    display: flex;
}

#lightbox-img-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    width: 100%;
    position: relative;
}

#lightbox-img {
    max-width: 92vw;
    max-height: 82vh;
    object-fit: contain;
    border-radius: 4px;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.08s ease;
    transform-origin: center center;
}

#lightbox-close {
    position: fixed;
    top: 1.2rem;
    right: 1.5rem;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 2rem;
    line-height: 1;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
}
#lightbox-close:hover {
    background: rgba(255,255,255,0.18);
}

#lightbox-prev, #lightbox-next {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 2.4rem;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 10;
    user-select: none;
}
#lightbox-prev { left: 1.2rem; }
#lightbox-next { right: 1.2rem; }
#lightbox-prev:hover, #lightbox-next:hover {
    background: rgba(255,255,255,0.2);
}

#lightbox-caption {
    color: #888;
    font-size: 0.9rem;
    padding: 0.7rem 1rem 1rem;
    text-align: center;
    flex-shrink: 0;
}


/* Página 360 */
.projects-page {
    max-width: 1180px;
}

.projects-page h1 {
    font-size: clamp(2.2rem, 6vw, 4.8rem);
    line-height: 0.95;
    margin: 0 0 0.8rem 0;
    letter-spacing: -0.06em;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    font-weight: 700;
    color: #666;
    margin-bottom: 0.7rem;
}

.page-intro {
    max-width: 620px;
    color: #555;
    font-size: 1.05rem;
    margin-bottom: 2.5rem;
}

.projects-page .project-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.projects-page .project-card {
    width: 100%;
    text-decoration: none;
    color: inherit;
    margin-bottom: 0;
}

.viewer-error {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
    font: 600 1.2rem 'Inter', sans-serif;
    text-align: center;
    background: #e7e7e7;
    color: #181818;
}
