/* ===== Projeto Page Mobile Styles ===== */
/* Ana Claudia Costa Arquitetura - Página de Projeto Mobile */

/* Header dark styles for projeto page */
.header.header-dark {
    background: #1a1a2e;
}

.header.header-dark .nav-link {
    color: rgba(255, 255, 255, 0.85);
}

.header.header-dark .nav-link:hover {
    color: #c9a962;
}

.header.header-dark .logo-white {
    display: block;
}

.header.header-dark .logo-dark {
    display: none;
}

.header.header-dark.scrolled {
    background: #fff;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.header.header-dark.scrolled .nav-link {
    color: #1a1a2e;
}

.header.header-dark.scrolled .nav-link:hover {
    color: #c9a962;
}

.header.header-dark.scrolled .logo-white {
    display: none;
}

.header.header-dark.scrolled .logo-dark {
    display: block;
}

.header.header-dark .header-cta {
    background: #c9a962;
    color: #fff;
    border: none;
}

.header.header-dark .mobile-toggle span {
    background: #fff;
}

.header.header-dark.scrolled .mobile-toggle span {
    background: #1a1a2e;
}

@media (max-width: 768px) {
    
    /* Mobile menu for dark header */
    .header.header-dark .header-cta {
        display: none !important;
    }
    
    .header.header-dark .nav.active {
        display: block !important;
        position: fixed !important;
        top: 64px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: calc(100vh - 64px) !important;
        height: calc(100dvh - 64px) !important;
        background: #ffffff !important;
        padding: 0 !important;
        margin: 0 !important;
        z-index: 99999 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        visibility: visible !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .header.header-dark .nav.active .nav-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
        padding: 24px 20px !important;
        margin: 0 !important;
        list-style: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .header.header-dark .nav.active .nav-list li {
        display: block !important;
        border-bottom: 1px solid #f0f0f0;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .header.header-dark .nav.active .nav-list li:last-child {
        border-bottom: none;
    }
    
    .header.header-dark .nav.active .nav-link {
        display: block !important;
        padding: 18px 0 !important;
        font-size: 1.125rem !important;
        font-weight: 500 !important;
        color: #1a1a2e !important;
        text-decoration: none !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .header.header-dark .nav.active .nav-link:active {
        color: #c9a962 !important;
    }
    
    /* ===== Project Hero Mobile ===== */
    .project-hero {
        min-height: 50vh;
        padding: 80px 0 40px;
    }
    
    .project-hero-content {
        text-align: center;
        padding: 0 8px;
    }
    
    .back-link {
        display: inline-flex;
        justify-content: center;
        margin-bottom: 20px;
        font-size: 0.875rem;
        padding: 10px 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .project-category {
        font-size: 0.75rem;
        padding: 6px 14px;
        margin-bottom: 12px;
    }
    
    .project-title {
        font-size: 1.75rem;
        line-height: 1.2;
        margin-bottom: 12px;
    }
    
    .project-client {
        font-size: 1rem;
        margin-bottom: 20px;
    }
    
    .project-meta {
        flex-direction: column;
        gap: 12px;
        align-items: center;
    }
    
    .project-meta-item {
        font-size: 0.875rem;
        padding: 8px 16px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
    }
    
    /* ===== Project Content Mobile ===== */
    .project-content {
        padding: 40px 0;
    }
    
    .project-description {
        padding: 0 8px;
        margin-bottom: 40px;
    }
    
    .project-description h2 {
        font-size: 1.5rem;
        margin-bottom: 16px;
        text-align: center;
    }
    
    .project-description p {
        font-size: 1rem;
        line-height: 1.8;
        text-align: left;
    }
    
    /* ===== Gallery Mobile - Instagram Carousel Style ===== */
    .gallery-section {
        padding: 16px 0 !important;
    }
    
    .gallery-section h2 {
        font-size: 1.5rem !important;
        margin-bottom: 12px !important;
        text-align: center !important;
        padding: 0 16px !important;
    }
    
    /* Override grid layout for carousel */
    .project-gallery,
    .gallery-grid {
        display: block !important;
        grid-template-columns: none !important;
        gap: 0 !important;
    }
    
    /* Gallery Carousel Container */
    .gallery-carousel {
        position: relative !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    .gallery-slides {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        scroll-snap-type: x mandatory !important;
        -webkit-overflow-scrolling: touch !important;
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
        gap: 0 !important;
        padding: 0 !important;
    }
    
    .gallery-slides::-webkit-scrollbar {
        display: none !important;
    }
    
    /* Gallery Slide - Large 500x500 responsive */
    .gallery-slide {
        flex: 0 0 100% !important;
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
        scroll-snap-align: start !important;
        scroll-snap-stop: always !important;
        position: relative !important;
        aspect-ratio: 1/1 !important;
        border-radius: 16px !important;
        overflow: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .gallery-slide img {
        width: 100% !important;
        height: 100% !important;
        min-height: 300px !important;
        max-height: 500px !important;
        object-fit: cover !important;
        display: block !important;
        border-radius: 16px !important;
    }
    
    /* Zoom icon */
    .gallery-slide .zoom-icon {
        position: absolute;
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }
    
    .gallery-slide .zoom-icon i {
        font-size: 1.1rem;
        color: #1a1a2e;
    }
    
    /* Gallery Dots - Instagram style */
    .gallery-dots {
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 6px;
        padding: 12px 0;
    }
    
    .gallery-dot {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        background: #d1d5db;
        transition: all 0.3s ease;
        cursor: pointer;
    }
    
    .gallery-dot.active {
        width: 8px;
        height: 8px;
        background: #c9a962;
    }
    
    /* Gallery Counter */
    .gallery-counter {
        position: absolute;
        top: 12px;
        right: 12px;
        background: rgba(0, 0, 0, 0.6);
        color: #fff;
        font-size: 0.75rem;
        font-weight: 500;
        padding: 4px 10px;
        border-radius: 12px;
        z-index: 10;
    }
    
    /* Legacy support for gallery-item */
    .gallery-item {
        flex: 0 0 100%;
        width: 100%;
        scroll-snap-align: start;
        position: relative;
        aspect-ratio: 1/1;
    }
    
    .gallery-item img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }
    
    .gallery-item .zoom-icon {
        position: absolute;
        bottom: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        background: rgba(255, 255, 255, 0.95);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
    }
    
    .gallery-item .zoom-icon i {
        font-size: 1.1rem;
        color: #1a1a2e;
    }
    
    /* ===== Before/After Section Mobile ===== */
    .before-after-section,
    .unified-section {
        padding: 24px 0;
    }
    
    .before-after-section h2,
    .unified-section h2 {
        font-size: 1.5rem;
        margin-bottom: 16px;
        text-align: center;
    }
    
    /* Transformation section - reduce bottom spacing */
    #beforeAfterSection {
        padding-bottom: 16px;
    }
    
    .transformation-timeline {
        margin-bottom: 0;
    }
    
    .timeline-content {
        margin-bottom: 0;
    }
    
    /* Timeline Tabs Mobile - Linha única */
    .timeline-tabs {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-bottom: 16px;
        padding: 0 8px;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .timeline-tab {
        padding: 8px 14px;
        font-size: 0.75rem;
        border-radius: 6px;
        min-width: auto;
        white-space: nowrap;
        text-align: center;
        flex-shrink: 0;
    }
    
    .timeline-tab.active {
        background: #c9a962;
        color: white;
    }
    
    /* Timeline Panels Mobile - Imagens grandes e responsivas */
    .timeline-panel {
        padding: 0;
        display: none;
        flex-direction: column;
        align-items: center;
        position: relative;
        width: 100%;
    }
    
    .timeline-panel.active {
        display: flex;
    }
    
    /* Imagens do Antes/Depois - ocupam largura total */
    .timeline-panel > img {
        width: 100%;
        height: auto;
        min-height: 250px;
        max-height: 70vh;
        object-fit: cover;
        object-position: center;
        border-radius: 0;
    }
    
    /* Label para painéis */
    .timeline-panel-label {
        display: block;
        text-align: center;
        font-size: 0.9375rem;
        font-weight: 700;
        color: #1a1a2e;
        padding: 12px 0;
        text-transform: uppercase;
        letter-spacing: 1.5px;
        background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,1));
        width: 100%;
    }
    
    /* During Gallery Mobile - Grid otimizado */
    .during-gallery {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
        width: 100%;
        padding: 0;
    }
    
    .during-gallery img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        object-fit: cover;
        cursor: pointer;
        border-radius: 0;
    }
    
    /* Durante panel - ajuste para galeria */
    #duringPanel {
        padding: 0;
    }
    
    #duringPanel .timeline-panel-label {
        margin-top: 0;
        padding-top: 16px;
    }
    
    /* Compare Slider Mobile - Largura total */
    .compare-mode {
        padding: 0 !important;
        width: 100%;
    }
    
    .before-after-slider {
        width: 100%;
        height: auto;
        min-height: 300px;
        max-height: 70vh;
        position: relative;
        overflow: hidden;
        border-radius: 0;
    }
    
    .before-after-slider .ba-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .ba-label {
        font-size: 0.875rem;
        font-weight: 700;
        padding: 8px 16px;
        background: rgba(0, 0, 0, 0.7);
        color: #fff;
        text-transform: uppercase;
        letter-spacing: 1px;
    }
    
    .ba-handle-circle {
        width: 44px;
        height: 44px;
        background: #c9a962;
        border: 3px solid #fff;
        box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    }
    
    .compare-container {
        border-radius: 0;
        overflow: hidden;
        touch-action: pan-y;
    }
    
    .compare-slider-handle {
        width: 44px;
        height: 44px;
    }
    
    /* ===== Videos Section Mobile ===== */
    .videos-section {
        padding: 40px 0;
    }
    
    .videos-section h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
        text-align: center;
    }
    
    .videos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 8px;
    }
    
    .video-item {
        border-radius: 12px;
        overflow: hidden;
        aspect-ratio: 16/9;
    }
    
    .video-play-btn {
        width: 56px;
        height: 56px;
    }
    
    .video-play-btn i {
        font-size: 1.25rem;
    }
    
    .video-badge {
        font-size: 0.625rem;
        padding: 4px 8px;
    }
    
    /* ===== Panorama Section Mobile - Retangular e Centralizado ===== */
    .panorama-section,
    .pano-wrapper {
        padding: 12px 0;
    }
    
    .panorama-section h2,
    .pano-wrapper h2 {
        font-size: 1.5rem;
        margin-bottom: 8px;
        text-align: center;
    }
    
    .pano-container {
        border-radius: 12px;
        height: 450px;
        width: calc(100% - 32px);
        margin: 0 auto 8px auto;
    }
    
    .pano-controls {
        bottom: 12px;
        right: 12px;
        gap: 8px;
    }
    
    .pano-controls button {
        width: 40px;
        height: 40px;
    }
    
    /* ===== Stats Section Mobile ===== */
    .stats-section {
        padding: 40px 0;
    }
    
    .stats-section h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 8px;
    }
    
    .stat-card {
        padding: 20px 16px;
        border-radius: 12px;
        text-align: center;
    }
    
    .stat-card .stat-value {
        font-size: 1.75rem;
        margin-bottom: 4px;
    }
    
    .stat-card .stat-label {
        font-size: 0.8125rem;
    }
    
    /* ===== Related Projects Mobile - Outros Projetos ===== */
    .related-section,
    #relatedProjects {
        padding: 40px 0;
        display: block !important;
    }
    
    .related-section h2,
    #relatedProjects h2 {
        font-size: 1.5rem;
        margin-bottom: 24px;
        text-align: center;
        color: #1a1a2e;
    }
    
    .related-grid {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 16px;
    }
    
    .related-card {
        border-radius: 12px;
        overflow: hidden;
        background: #fff;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
        display: block !important;
    }
    
    .related-card-image {
        height: 180px;
        width: 100%;
        overflow: hidden;
    }
    
    .related-card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    
    .related-card-info {
        padding: 16px;
        text-align: center;
    }
    
    .related-card h3 {
        font-size: 1.0625rem;
        color: #1a1a2e;
        margin-bottom: 4px;
    }
    
    .related-card p {
        font-size: 0.8125rem;
        color: #6b7280;
    }
    
    /* ===== CTA Section Mobile ===== */
    .cta-section {
        padding: 48px 0;
        text-align: center;
    }
    
    .cta-section h2 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }
    
    .cta-section p {
        font-size: 1rem;
        margin-bottom: 24px;
    }
    
    .cta-section .btn {
        width: 100%;
        max-width: 300px;
        padding: 16px 24px;
    }
    
    /* ===== Image Modal Mobile ===== */
    .image-modal {
        padding: 0;
    }
    
    .image-modal-content {
        max-width: 100%;
        max-height: 100%;
        border-radius: 0;
    }
    
    .image-modal-close {
        top: 16px;
        right: 16px;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
    }
    
    .image-modal-nav {
        width: 44px;
        height: 44px;
    }
    
    .image-modal-prev {
        left: 8px;
    }
    
    .image-modal-next {
        right: 8px;
    }
    
    .image-modal-counter {
        bottom: 20px;
        font-size: 0.875rem;
        padding: 8px 16px;
    }
    
    /* ===== Video Modal Mobile ===== */
    .video-modal-content {
        width: 100%;
        max-width: 100%;
        padding: 0;
        border-radius: 0;
    }
    
    .video-modal-content iframe,
    .video-modal-content video {
        width: 100%;
        height: 56.25vw;
        max-height: 100vh;
    }
    
    .video-modal-close {
        top: 8px;
        right: 8px;
        width: 44px;
        height: 44px;
    }
}

/* ===== Extra Small Devices ===== */
@media (max-width: 375px) {
    .project-title {
        font-size: 1.5rem;
    }
    
    .project-description h2,
    .gallery-section h2,
    .videos-section h2,
    .related-section h2 {
        font-size: 1.375rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-tabs {
        flex-direction: column;
        align-items: stretch;
    }
    
    .timeline-tab {
        width: 100%;
    }
    
    .during-gallery {
        grid-template-columns: 1fr;
    }
}

/* ===== Touch Optimizations ===== */
@media (hover: none) and (pointer: coarse) {
    .gallery-item:active {
        transform: scale(0.98);
    }
    
    .video-item:active {
        transform: scale(0.98);
    }
    
    .related-card:active {
        transform: scale(0.99);
    }
    
    .timeline-tab:active {
        transform: scale(0.95);
    }
}

/* ===== Safe Area for Notched Devices ===== */
@supports (padding: max(0px)) {
    .project-hero {
        padding-top: max(80px, calc(64px + env(safe-area-inset-top)));
    }
    
    .image-modal-close {
        top: max(16px, env(safe-area-inset-top));
        right: max(16px, env(safe-area-inset-right));
    }
    
    .video-modal-close {
        top: max(8px, env(safe-area-inset-top));
        right: max(8px, env(safe-area-inset-right));
    }
}

/* ===== Landscape Mode ===== */
@media (max-width: 896px) and (orientation: landscape) {
    .project-hero {
        min-height: auto;
        padding: 70px 0 30px;
    }
    
    .project-meta {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .pano-container {
        height: 60vh;
    }
}
