/* Reset e base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #000;
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Container principal */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-weight: bold;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }

/* Botões básicos */
.btn {
    display: inline-block;
    padding: 12px 30px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.3s ease;
}

.btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.btn-primary {
    background-color: #007bff;
}

.btn-secondary {
    background-color: #6c757d;
}

/* Seções */
section {
    padding: 60px 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding: 0 20px; /* mais respiro lateral no mobile */
    }
    
    section {
        padding: 40px 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px; /* evita conteúdo colado nas bordas */
    }
    
    section {
        padding: 30px 0;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

/* ===========================================
   PORTFÓLIO SECTION - RESPONSIVO
   =========================================== */

.portfolio-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 30px;
    margin-top: 50px;
}

.project-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: stretch;
    min-height: 365px; /* 30% maior que os 280px anteriores */
}

/* Estado expandido do card - altura dinâmica */
.project-card.expanded {
    min-height: 600px; /* Altura mínima maior quando expandido */
    align-items: stretch;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.project-image {
    flex: 0 0 40%;
    position: relative;
    background: #f0f0f0;
    overflow: hidden;
    height: 250px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    align-self: center; /* Alinha a imagem com o centro do conteúdo */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center; /* Mostra a parte superior inicialmente */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card:hover .project-image img {
    transform: scale(1.05);
}

/* Estado expandido da imagem */
.project-card.expanded .project-image {
    flex: 0 0 60%; /* Aumenta de 40% para 60% da largura */
    height: auto; /* Altura automática para acompanhar o conteúdo */
    min-height: 600px; /* Altura mínima generosa */
    align-self: stretch; /* Estica para ocupar toda altura disponível */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    background: #ffffff; /* Fundo branco para destacar a imagem completa */
    padding: 10px; /* Padding para criar um "frame" */
    border-radius: 20px; /* Bordas mais arredondadas */
}

.project-card.expanded .project-image img {
    transform: scale(1.0); /* Remove o zoom para mostrar mais conteúdo */
    object-position: top center; /* Mantém foco no topo mas mostra mais */
    filter: brightness(1.05) contrast(1.02);
    object-fit: contain; /* Mostra a imagem completa */
    border-radius: 10px; /* Bordas arredondadas na imagem */
}

.project-card.expanded .project-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, 
        rgba(0, 123, 255, 0.03) 0%, 
        rgba(233, 30, 99, 0.03) 50%,
        rgba(0, 123, 255, 0.05) 100%);
    pointer-events: none;
    opacity: 0;
    animation: fadeInOverlay 0.8s ease-in-out 0.4s forwards;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.project-content {
    flex: 1;
    padding: 25px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ajusta o conteúdo quando expandido */
.project-card.expanded .project-content {
    flex: 0 0 40%; /* Reduz para 40% quando imagem estiver expandida */
}

.project-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 15px;
    line-height: 1.3;
}

.project-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.project-tags .tag {
    background: rgba(0, 123, 255, 0.1);
    color: #007bff;
    border: 1px solid rgba(0, 123, 255, 0.2);
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.project-tags .tag:hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: rgba(0, 123, 255, 0.3);
    transform: translateY(-1px);
}

.project-tags .tag.tag-live {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
    border-color: rgba(40, 167, 69, 0.2);
}

.project-tags .tag.tag-live:hover {
    background: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.3);
}

/* ===========================================
   SISTEMA DE EXPANSÃO DE TEXTO
   =========================================== */

/* Controle de versões desktop/mobile */
.project-description.full-description {
    line-height: 1.7; /* Aumenta espaçamento entre linhas */
    margin-bottom: 15px;
    font-size: 1.0rem; /* Fonte ligeiramente maior */
}

.mobile-content {
    display: none;
}

.desktop-content {
    display: none; /* Por padrão oculto */
}

/* Quando expandido, mostra o conteúdo correto baseado no tamanho da tela */
.project-card.expanded .desktop-content {
    display: block;
}

.project-card.expanded .mobile-content {
    display: none;
}

/* Oculta conteúdo desktop/mobile quando full-description está oculta */
.full-description[style*="display: none"] .desktop-content,
.full-description[style*="display: none"] .mobile-content {
    display: none !important;
}

.highlight-block {
    display: inline-block;
    background: rgba(0, 115, 238, 0.08); /* Fundo glassmorphism sutil */
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 115, 238, 0.2); /* Borda sutil */
    color: #0073EE;
    padding: 12px 20px; /* Padding maior */
    border-radius: 25px; /* Mais arredondado */
    font-size: 1.1rem; /* Fonte maior */
    font-weight: 700; /* Mais bold */
    margin-bottom: 15px; /* Mais espaço abaixo */
    letter-spacing: 0.5px; /* Espaçamento entre letras */
    box-shadow: 0 4px 15px rgba(0, 115, 238, 0.1); /* Sombra sutil */
    transition: all 0.3s ease;
}

.highlight-block:hover {
    background: rgba(0, 115, 238, 0.12);
    border-color: rgba(0, 115, 238, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 115, 238, 0.15);
}

.color-highlight {
    background: linear-gradient(135deg, #007bff, #e91e63);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 600;
}

.roi-highlight {
    background: rgba(40, 167, 69, 0.1); /* Glassmorphism verde */
    backdrop-filter: blur(6px);
    border: 1px solid rgba(40, 167, 69, 0.25);
    color: #28a745;
    padding: 6px 14px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 0.95rem;
    box-shadow: 0 3px 10px rgba(40, 167, 69, 0.15);
}

.read-more-btn {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 12px 0;
    box-shadow: 0 3px 12px rgba(0, 123, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.btn-icon {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.read-more-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.read-more-btn.expanded {
    background: linear-gradient(135deg, #6c757d, #495057);
}

.read-more-btn.expanded:hover {
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.read-more-btn.expanded .btn-icon {
    transform: rotate(180deg);
}

/* Responsivo para tablets */
@media (max-width: 768px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        gap: 25px;
        margin-top: 40px;
    }
    
    .project-card {
        margin: 0 10px;
        flex-direction: column;
        min-height: auto;
    }
    
    .project-image {
        flex: none;
        height: 200px;
        width: 100%;
    }
    
    .project-image img {
        border-radius: 15px 15px 0 0;
    }
    
    /* Ajustes para expansão em tablets */
    .project-card.expanded .project-image {
        height: 350px; /* Altura maior em tablets para mostrar mais conteúdo */
    }
    
    .project-content {
        padding: 20px;
    }
    
    .project-title {
        font-size: 1.2rem;
    }
    
    .project-description {
        font-size: 0.9rem;
    }
    
    /* Ajustes para sistema de expansão em tablets */
    .highlight-block {
        font-size: 1.0rem; /* Ligeiramente menor em tablets */
        padding: 10px 16px;
        margin-bottom: 12px;
    }
    
    .read-more-btn {
        font-size: 0.85rem;
        padding: 9px 20px;
        gap: 6px;
    }
}

/* Responsivo para mobile */
@media (max-width: 480px) {
    .portfolio-section {
        padding: 60px 0;
    }
    
    .portfolio-grid {
        gap: 20px;
        margin-top: 30px;
    }
    
    .project-card {
        margin: 0 5px;
        border-radius: 12px;
        flex-direction: column;
    }
    
    .project-image {
        height: 160px;
    }
    
    /* Ajustes para expansão em mobile */
    .project-card.expanded .project-image {
        height: 350px; /* Altura fixa menor para permitir scroll */
        align-self: flex-start; /* Alinha no topo ao invés de stretch */
        overflow-y: auto; /* Permite scroll vertical */
        scrollbar-width: thin; /* Firefox */
        scrollbar-color: rgba(0, 123, 255, 0.3) transparent; /* Firefox */
    }
    
    /* Estilização da scrollbar para WebKit browsers */
    .project-card.expanded .project-image::-webkit-scrollbar {
        width: 4px;
    }
    
    .project-card.expanded .project-image::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .project-card.expanded .project-image::-webkit-scrollbar-thumb {
        background: rgba(0, 123, 255, 0.3);
        border-radius: 2px;
    }
    
    .project-image img {
        border-radius: 12px 12px 0 0;
    }
    
    .project-content {
        padding: 15px;
    }
    
    .project-title {
        font-size: 1.1rem;
        margin-bottom: 10px;
    }
    
    .project-description {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .project-tags .tag {
        padding: 5px 10px;
        font-size: 0.75rem;
    }
    
    /* Ajustes para sistema de expansão em mobile */
    .highlight-block {
        font-size: 0.95rem; /* Menor mas ainda legível */
        padding: 8px 14px;
        margin-bottom: 10px;
        letter-spacing: 0.3px;
    }
    
    .read-more-btn {
        font-size: 0.8rem;
        padding: 8px 20px;
        margin: 15px auto 0 auto; /* Centraliza o botão */
        position: relative;
        transform: translateY(10px); /* Move o botão para fora do card */
        background: rgba(0, 123, 255, 0.95);
        backdrop-filter: blur(10px);
        box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
        min-width: 140px;
    }
    
    /* Container para o botão ficar fora do card no mobile */
    .project-card {
        margin-bottom: 25px; /* Espaço extra para o botão */
    }
    
    .project-description.full-description {
        line-height: 1.5;
    }
    
    .color-highlight {
        font-size: 0.85rem;
    }
    
    .roi-highlight {
        font-size: 0.8rem;
        padding: 1px 6px;
    }
}

/* Ajustes específicos para telas pequenas (< 700px) */
@media (max-width: 700px) {
    /* Em mobile, quando expandido, mostra versão mobile */
    .project-card.expanded .desktop-content {
        display: none !important;
    }
    
    .project-card.expanded .mobile-content {
        display: block !important;
    }
    
    /* Ajustes na imagem para scroll */
    .project-card.expanded .project-image {
        height: 320px !important; /* Altura ainda menor para telas muito pequenas */
        max-height: 50vh; /* Não ultrapassa 50% da altura da tela */
    }
    
    /* Card tem altura controlada */
    .project-card.expanded {
        min-height: auto; /* Remove altura mínima fixa */
        max-height: 90vh; /* Limita altura total do card */
        overflow: hidden; /* Evita overflow do card */
    }
    
    /* Ajustes no conteúdo mobile */
    .mobile-content .highlight-block {
        font-size: 0.85rem;
        padding: 6px 12px;
        margin-bottom: 8px;
    }
    
    .mobile-content {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

/* ===========================================
   MODAL SITE AO VIVO
   =========================================== */

.site-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.modal-container {
    width: 95%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
}

.modal-header {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.modal-title {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
}

.site-live-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.site-url {
    font-size: 0.9rem;
    opacity: 0.9;
    font-family: 'JetBrains Mono', monospace;
}

.modal-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-voltar,
.btn-nova-aba {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-voltar:hover,
.btn-nova-aba:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.modal-content {
    flex: 1;
    overflow: hidden;
}

.modal-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Responsivo para modal */
@media (max-width: 768px) {
    .site-modal {
        padding: 10px;
    }
    
    .modal-container {
        width: 100%;
        height: 95%;
        border-radius: 8px;
    }
    
    .modal-header {
        padding: 12px 15px;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .modal-title {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 8px;
    }
    
    .modal-controls {
        justify-content: center;
    }
    
    .btn-voltar,
    .btn-nova-aba {
        flex: 1;
        min-width: 120px;
    }
}