/* =====================================================
   MODAL STYLES - BEHANCE INSPIRED
   ===================================================== */

/* Modal Container */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.modal.active {
    display: block;
}

/* Dark Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(37, 33, 38, 0.95); /* #252126 with 95% opacity */
    z-index: 1;
}

/* Modal Container - Centralizado e scrollável */
.modal-container {
    position: relative;
    width: 1400px;
    max-width: calc(100% - 40px);
    margin: 60px auto 50px; /* MARGIN-BOTTOM DE 50px APLICADA */
    background: #3c343e;
    z-index: 2;
    max-height: calc(100vh - 110px);
    overflow-y: auto;
    overflow-x: hidden; /* Previne scroll horizontal */
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
}

/* Scrollbar Styling */
.modal-container::-webkit-scrollbar {
    width: 8px;
}

.modal-container::-webkit-scrollbar-track {
    background: #252126;
}

.modal-container::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 4px;
}

.modal-container::-webkit-scrollbar-thumb:hover {
    background: #888;
}

/* Modal Header - POSIÇÃO FIXA */
.modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    text-align: center;
    padding: 20px 0;
    background: transparent;
    z-index: 10;
}

.modal-header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

/* Close Button - POSIÇÃO FIXA AJUSTADA - 60px à direita */
.modal-close {
    position: fixed;
    top: 10px;
    right: calc(50% - 800px + 30px); /* Alinhado com a seta direita */
    width: 56px;
    height: 56px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
}

.modal-close img {
    width: 100%;
    height: 100%;
}

.modal-close .close-hover {
    display: none;
}

.modal-close:hover .close-normal {
    display: none;
}

.modal-close:hover .close-hover {
    display: block;
}

/* Navigation Arrows - POSIÇÃO FIXA */
.modal-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 10;
    padding: 0;
    opacity: 0.3; /* OPACIDADE REDUZIDA PARA 50% */
    transition: opacity 0.3s ease;
}

.modal-nav:hover {
    opacity: 1;
}

.modal-nav img {
    width: 100%;
    height: 100%;
}

.modal-prev {
    left: calc(50% - 750px);
}

.modal-next {
    right: calc(50% - 750px);
}

/* Modal Content */
.modal-content {
    width: 100%;
    background: #3c343e;
    padding: 0;
    min-height: 400px;
}

/* CTA Section */
.modal-cta {
    background: #000000;
    padding: 55px 0;
    text-align: center;
    width: 100%;
}

.modal-cta p {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 15px 0;
}

/* BOTÃO CTA CORRIGIDO com animação */
.btn-cta {
    background: white;
    border: none;
    padding: 10px 18px;
    border-radius: 4px;
    font-family: 'Cairo', sans-serif;
    font-size: 20px;
    font-weight: 400;
    color: #000;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0; /* Sem gap inicial */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-cta span {
    display: inline-block;
    transition: all 0.3s ease;
}

.btn-cta .icon {
    width: 0; /* Largura 0 no estado normal */
    height: 20px;
    opacity: 0;
    transition: all 0.3s ease;
    margin-left: 0;
}

.btn-cta:hover {
    background: #3c343e; /* Cor de fundo do modal no hover */
    color: #fff;
    gap: 10px; /* Gap aparece no hover */
}

.btn-cta:hover .icon {
    width: 20px; /* Largura normal no hover */
    opacity: 1;
    margin-left: 10px;
}

/* View More Projects Section */
.modal-more-projects {
    background: #3c343e;
    padding: 40px 0;
    text-align: center;
    width: 100%;
}

.modal-more-projects h3 {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
    margin: 0 0 15px 0;
    text-align: left;
    padding: 0 200px;
}

.more-projects-grid {
    display: flex;
    gap: 20px;
    justify-content: center;
    padding: 0 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.more-project-card {
    cursor: pointer;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.more-project-card:hover {
    transform: translateY(-5px);
}

.more-project-card img {
    width: 190px;
    height: 130px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 15px;
}

.more-project-card h4 {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: #cccccc;
    line-height: 1.2;
    text-align: left;
    margin: 0;
    max-width: 190px;
    word-wrap: break-word;
}

/* =====================================================
   CONTENT COMPONENTS STYLES
   ===================================================== */

/* Images - Full width without padding */
.modal-content img.full-width {
    width: 100%;
    max-width: 1400px;
    display: block;
    margin: 0;
    padding: 0;
}

/* Text Content */
.modal-content .text-content {
    padding: 60px 200px;
    margin: 0;
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #ffffff;
}

/* Headings - COM MARGEM NEGATIVA PARA APROXIMAR DO TEXTO */
.modal-content h1,
.modal-content h2,
.modal-content h3,
.modal-content h4,
.modal-content h5,
.modal-content h6 {
    padding: 60px 200px 0 200px; /* Removido padding bottom */
    margin: 0 0 -40px 0 !important; /* MARGEM NEGATIVA para aproximar do texto */
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
}

.modal-content h1 { font-size: 36px; font-weight: 700; }
.modal-content h2 { font-size: 30px; font-weight: 600; }
.modal-content h3 { font-size: 24px; font-weight: 600; }
.modal-content h4 { font-size: 20px; font-weight: 500; }
.modal-content h5 { font-size: 18px; font-weight: 500; }
.modal-content h6 { font-size: 16px; font-weight: 500; }


/* =====================================================
   YOUTUBE CUSTOM THUMBNAIL STYLES
   ===================================================== */

.youtube-custom {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 1400px;
    cursor: pointer;
    margin: 0;
}

.youtube-custom .custom-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.youtube-custom::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0);
    transition: background 0.3s ease;
    z-index: 2;
}

.youtube-custom:hover::before {
    background: rgba(0, 0, 0, 0.3);
}

.youtube-custom:hover .custom-thumb {
    transform: scale(1.05);
}

.youtube-custom .play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(255, 0, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.youtube-custom:hover .play-button {
    transform: translate(-50%, -50%) scale(1.1);
    background: rgba(255, 0, 0, 1);
}

.youtube-custom .play-button::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid white;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}

.youtube-custom iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: none;
}

.youtube-custom.playing .custom-thumb,
.youtube-custom.playing .play-button,
.youtube-custom.playing .video-title {
    display: none;
}

.youtube-custom.playing iframe {
    display: block;
}

.youtube-custom .video-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 20px 20px 15px;
    font-size: 18px;
    font-weight: 600;
    z-index: 3;
    font-family: 'Poppins', sans-serif;
}


/* YouTube Embed */
.modal-content .youtube-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    width: 100%;
    max-width: 1400px;
}

.modal-content .youtube-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Sketchfab Embed - CENTRALIZADO COM 1000px */
.modal-content .sketchfab-embed {
    width: 1000px;
    height: 650px;
    margin: 0 auto;
    padding: 0;
}

.modal-content .sketchfab-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Construct3 Embed */
.modal-content .construct3-embed {
    width: 100%;
    max-width: 1400px;
    height: 600px;
    margin: 0;
    padding: 0;
}

.modal-content .construct3-embed iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* =====================================================
   ADDITIONAL CONTENT COMPONENTS
   ===================================================== */

/* Image Grids */
.image-grid {
    display: grid;
    gap: 0;
    width: 100%;
    max-width: 1400px;
    margin: 0;
    padding: 0;
}

.image-grid.cols-2 {
    grid-template-columns: repeat(2, 1fr);
}

.image-grid.cols-3 {
    grid-template-columns: repeat(3, 1fr);
}

.image-grid img {
    width: 100%;
    height: auto;
    display: block;
}

/* Quotes */
.quote {
    padding: 60px 200px;
    margin: 0;
    border-left: 4px solid #FFD700;
    background: rgba(255, 215, 0, 0.05);
}

.quote p {
    font-family: 'Poppins', sans-serif;
    font-size: 24px;
    font-style: italic;
    color: #FFD700;
    line-height: 1.6;
    margin: 0 0 20px 0;
}

.quote cite {
    font-family: 'Cairo', sans-serif;
    font-size: 16px;
    color: #cccccc;
    font-style: normal;
}

/* Specifications List */
.specs-list {
    padding: 60px 200px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.spec-item {
    display: flex;
    flex-direction: column;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.spec-label {
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spec-value {
    font-family: 'Cairo', sans-serif;
    font-size: 18px;
    color: #ffffff;
}

/* =====================================================
   RESPONSIVE STYLES
   ===================================================== */

@media (max-width: 1440px) {
    .modal-container {
        width: calc(100% - 40px);
    }
    
    .modal-close {
        right: 30px;
    }
    
    .modal-prev {
        left: 20px;
    }
    
    .modal-next {
        right: 20px;
    }
}

@media (max-width: 768px) {
    .modal-content .text-content {
        padding: 40px 20px;
    }
    
    .modal-content h1,
    .modal-content h2,
    .modal-content h3,
    .modal-content h4,
    .modal-content h5,
    .modal-content h6 {
        padding: 40px 20px 0 20px;
        margin: 0 0 -10px 0;
    }
    
    .modal-more-projects h3 {
        padding: 0 20px;
    }
    
    .more-projects-grid {
        flex-wrap: wrap;
    }
    
    .modal-close {
        width: 40px;
        height: 40px;
        top: 10px;
        right: 10px;
    }
    
    .modal-nav {
        width: 36px;
        height: 36px;
    }
    
    .modal-container {
        margin: 70px 10px 30px;
    }
    
    .modal-content .sketchfab-embed {
        width: 100%;
        max-width: calc(100vw - 20px);
    }
}