/* Estilos Gerais */
:root {
    --primary-color: #0800a0;
    --secondary-color: #2e36cd;
    --dark-color: #333;
    --light-color: #f8f9fa;
    --transition: all 0.3s ease;
}
:root {
    --azul-escuro: rgb(1, 1, 81);
    --azul-medio: #05009a;
    --azul-claro: #00183b;
    --dourado: gold;
    --branco: #fff;
    --fundo: #fffbf5;
}

* {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-color);
    color: var(--dark-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
.btn-voltar {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(#060271, #1f1c85);
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 5px;
    transition: all 0.3s ease;
    z-index: 10; /* Garante que fique acima de outros elementos */
    border: 1px solid white; /* Opcional: para melhor contraste */
}

.btn-voltar:hover {
    background-color: var(--secondary);
    transform: translate(-50%, -2px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}


/* Header */
.portfolio-header {
    background: #00183b;
    color: white;
    text-align: center;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
    border: solid gold 10px;
    border-top: none;
    border-left: none;
    border-right: none;
}

.portfolio-header::selection {
    background-color: gold;
    color: #0800a0;
}

.header-content h1 {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 1rem;
    animation: fadeInDown 1s ease;
}

.header-content p {
    font-size: clamp(1rem, 3vw, 1.2rem);
    opacity: 0.9;
    animation: fadeIn 1.5s ease;
}

/* Filtros */
.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin: 2rem auto;
    max-width: 1200px;
    padding: 0 1rem;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 50px;
    background-color: #f0f0f0;
    color: var(--dark-color);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    font-size: clamp(0.7rem, 2vw, 0.9rem);
}

.filter-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Grid de Projetos - Totalmente Responsivo com Proporções Corrigidas */
.projects-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    width: 95%;
    margin: 0 auto;
    padding: 1rem;
}

.project-card {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    cursor: pointer;
    border: solid transparent;
    background-image: linear-gradient(white, white), linear-gradient(45deg, #0800a0, white, gold);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    position: relative;
    text-align: center;
    justify-content: center;
    min-width: 0;
    padding: 2%;
    gap: 2%;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Container da imagem com proporção fixa */
.project-image-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Proporção 16:9 (altere conforme necessário) */
    overflow: hidden;
}

.project-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Mantém a proporção e cobre o container */
}
.project-preview {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s;
}

.project-card:hover .project-preview img {
    transform: scale(1.05);
}


.project-info {
    padding: 1.2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
    font-size: clamp(1rem, 1.2vw, 1.2rem);
}

.project-info p {
    color: #666;
    font-size: clamp(0.8rem, 1vw, 0.9rem);
    margin-bottom: 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.project-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background-color: #e0e0e0;
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
}

/* Modal */
.project-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
}

.project-preview {
    width: 100%;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s;
}

.project-card:hover .project-preview img {
    transform: scale(1.05);
}

.modal-content {
    background-color: white;
    margin: 3% auto;
    padding: 2rem;
    justify-content: center;
    align-content: center;
    align-items: center;
    border-radius: 10px;
    border: solid transparent 10px;
    background-image: linear-gradient(white, white), linear-gradient(45deg, #0800a0, gold);
    background-origin: border-box;
    background-clip: padding-box, border-box;
    max-width: 35%;
    width: auto;
    gap: 0%;
    max-height: 100%;
    position: relative;
    animation: modalFadeIn 0.3s ease;
}

.modal-content::selection {
    background-color: gold;
    color: #0800a0;
}

.close-modal {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
    transition: var(--transition);
}

.close-modal:hover {
    color: var(--dark-color);
}

#modal-image {
    width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

/* Estilo para o visualizador de arquivos */
.file-viewer {
    width: 100%;
    height: 60vh;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    background: #f9f9f9 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100" fill="none" stroke="%23e0e0e0" stroke-width="2"><rect x="25" y="25" width="50" height="50" rx="5" ry="5"/><path d="M30 30 L70 30 L70 70 L30 70 Z M35 35 L35 65 L65 65 L65 35 Z"/></svg>') no-repeat center;
    background-size: 80px;
}

.file-viewer:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
    border-color: #6e48aa;
}

.file-viewer.loading {
    opacity: 0.8;
    filter: blur(1px);
}


.video-viewer {
    width: 100%;
    max-height: 60vh;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
}

video.file-viewer {
    width: 100%;
    height: auto;
    max-height: 60vh;
    display: block;
    margin: 0 auto;
}

/* Conteúdo do Modal */
.project-modal h2 {
    margin-bottom: 1rem;
    color: #0800a0;
    text-decoration: underline gold 3px;
    font-size: clamp(1.3rem, 2vw, 1.8rem);
}

.project-modal p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
    font-size: clamp(0.9rem, 1.2vw, 1rem);
}

/* Botão de download */
.download-pdf {
    display: inline-block;
    margin-top: 10px;
    padding: 8px 16px;
    background-color: #6e48aa;
    color: white;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.download-pdf:hover {
    background-color: #9d50bb;
    transform: translateY(-2px);
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Rodapé */
footer {
    background-color: #00204f;
    color: white;
    padding: 70px 300px 0;
    border: none;
    border-left: none;
    border-right: none;
    border-top: solid gold 10px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.footer-logo {
    margin-bottom: 20px;
}

.footer-logo img {
    height: 50px;
    margin-bottom: 15px;
}

.footer-logo h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--yellow);
}

.footer-logo p {
    color: #aaa;
}

#links-sociais {
    display: flex;
    gap: 200px;
}

.footer-links h4,
.footer-social h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: var(--yellow);
}

.footer-links ul {
    list-style: none;
}

.footer-links ul li {
    margin-bottom: 10px;
}

.footer-links ul li a {
    color: #aaa;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-links ul li a:hover {
    color: gold;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: #333;
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    background-color: gold;
    color: #00183b;
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid #333;
    color: #aaa;
    font-size: 0.9rem;
}

footer .copy {
    color: rgba(255, 255, 255, 0.728);
    text-decoration: none;
    transition: 1.2s;
}

footer .copy:hover {
    color: #FFEB3B;
}

/* Media Queries para Responsividade Avançada */
@media (max-width: 1024px) {
    .portfolio-header{
        height: 30vh;
        margin-bottom: 1.1rem;
    }
    .portfolio-header h1{
        margin-top: 15%;
    }
    .projects-container {
        grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
        gap: 1.2rem;
        width: 95%;
        margin: 0% auto 10%;
    }
    
    .project-card {
        border-width: 3px; /* Espessura da borda para mobile */
        background-image: linear-gradient(white, white), 
                          linear-gradient(45deg, var(--primary-color), white, gold);
        background-origin: border-box;
        background-clip: padding-box, border-box;
    }

    .project-image-container {
        padding-top: 100%; /* Alterado para proporção 1:1 em mobile */
    }
    .project-preview {
    width: 100%;
    height: 22vh !important;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.project-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    transition: transform 0.3s;
}

.project-card:hover .project-preview img {
    transform: scale(1.05);
}

    
    .project-modal {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        justify-content: center;
        align-content: center;
        background-color: rgba(0, 0, 0, 0.8);
        z-index: 1000;
        overflow-y: auto;
    }

    .modal-content {
        background-color: white;
        margin: 2% auto;
        padding: 1rem;
        border-radius: 10px;
        border-width: 5px; /* Espessura menor para mobile */
        border: solid transparent 10px;
        background-image: linear-gradient(white, white), linear-gradient(45deg, #0800a0, gold);
        background-origin: border-box;
        background-clip: padding-box, border-box;
        max-width: 90%;
        width: 90%;
        height: auto;
        max-height: 90%;
        position: relative;
        animation: modalFadeIn 0.3s ease;
    }

    .file-viewer {
        width: 100%;
        height: 50vh !important;
    }
    .footer {
        background-color: var(--azul-claro);
        color: var(--branco);
        padding: 50px 5%;
        border-top: solid var(--dourado) 10px;
        margin-top: 5vh;
    }

    .footer-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-logo {
        margin-bottom: 20px;
        text-align: center;
    }

    .footer-logo img {
        height: 50px;
        margin-bottom: 15px;
    }

    .footer-logo h3 {
        font-size: 1.5rem;
        margin-bottom: 10px;
        color: var(--dourado);
    }

    .footer-logo p {
        color: #aaa;
    }

    #links-sociais {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-links h4, .footer-social h4 {
        font-size: 1.2rem;
        margin-bottom: 20px;
        color: var(--dourado);
        text-align: center;
    }

    .footer-links ul {
        list-style: none;
        text-align: center;
    }

    .footer-links ul li {
        margin-bottom: 10px;
    }

    .footer-links ul li a {
        color: #aaa;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .footer-links ul li a:hover {
        color: var(--dourado);
    }

    .social-icons {
        display: flex;
        justify-content: center;
        gap: 15px;
    }

    .social-icons a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background-color: #333;
        border-radius: 50%;
        color: var(--branco);
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .social-icons a:hover {
        background-color: var(--dourado);
        color: var(--azul-claro);
        transform: translateY(-3px);
    }

    .footer-bottom {
        text-align: center;
        padding: 20px 0;
        border-top: 1px solid #333;
        color: #aaa;
        font-size: 0.9rem;
    }

    .copy {
        color: rgba(255, 255, 255, 0.728);
        text-decoration: none;
        transition: 1.2s;
    }

    .copy:hover {
        color: var(--dourado);
    }
}

@media (max-width: 768px) {
    .portfolio-header {
        padding: 3rem 1rem;
    }
    
    .category-filter {
        gap: 0.5rem;
        padding: 0 0.5rem;
    }
    
    /* ALTERAÇÃO PRINCIPAL: Grid de 2 colunas */
    .projects-container {
        grid-template-columns: repeat(2, 1fr); /* 2 colunas */
        gap: 0.8rem;
        width: 95%;
        max-width: none;
        padding: 0 0.5rem;
    }
    
    .project-card {
        width: 100%;
        min-height: 180px;
    }
    
    .project-preview {
        height: 120px;
    }
    
    .project-title {
        font-size: 0.9rem;
        padding: 0 0.3rem;
    }
    
    .modal-content {
        margin: 5% auto;
        width: 95%;
        padding: 0.8rem;
    }
    
    .file-viewer {
        height: 40vh !important;
    }
    
}

@media (max-width: 480px) {
     .portfolio-header {
        padding: 2rem 1rem;
        border-width: 5px;
    }
    
    .header-content h1 {
        font-size: 1.6rem;
    }
    
    .filter-btn {
        padding: 0.5rem 0.8rem;
        font-size: 0.7rem;
    }
    
    /* Refinamento para 2 colunas em telas pequenas */
    .projects-container {
        gap: 0.6rem;
    }
    
    .project-preview {
        height: 100px;
    }
    
    .project-title {
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 0.6rem;
    }
    
    .project-modal h2 {
        font-size: 1.3rem;
    }
    
    .close-modal {
        top: 0.5rem;
        right: 0.8rem;
        font-size: 1.5rem;
    }
    
    .file-viewer {
        height: 35vh !important;
    }
    .footer {
        background-color: var(--azul-claro);
        color: var(--branco);
        padding: 50px 5%;
        border-top: solid var(--dourado) 10px;
        margin-top: 5vh;
    }

    .footer-content {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
        margin-bottom: 30px;
    }

    .footer-logo {
        margin-bottom: 20px;
        text-align: center;
    }

    .footer-logo img {
        height: 50px;
        margin-bottom: 15px;
    }

    .footer-logo h3 {
        font-size: 1.5rem;
        margin-bottom: 10px;
        color: var(--dourado);
    }

    .footer-logo p {
        color: #aaa;
    }

    #links-sociais {
        display: grid;
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .footer-links h4, .footer-social h4 {
        font-size: 1.2rem;
        margin-bottom: 20px;
        color: var(--dourado);
        text-align: center;
    }

    .footer-links ul {
        list-style: none;
        text-align: center;
    }

    .footer-links ul li {
        margin-bottom: 10px;
    }

    .footer-links ul li a {
        color: #aaa;
        text-decoration: none;
        transition: color 0.3s ease;
    }

    .footer-links ul li a:hover {
        color: var(--dourado);
    }

    .social-icons {
        display: flex;
        justify-content: center;
        gap: 15px;
    }

    .social-icons a {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        background-color: #333;
        border-radius: 50%;
        color: var(--branco);
        text-decoration: none;
        transition: all 0.3s ease;
    }

    .social-icons a:hover {
        background-color: var(--dourado);
        color: var(--azul-claro);
        transform: translateY(-3px);
    }

    .footer-bottom {
        text-align: center;
        padding: 20px 0;
        border-top: 1px solid #333;
        color: #aaa;
        font-size: 0.9rem;
    }

    .copy {
        color: rgba(255, 255, 255, 0.728);
        text-decoration: none;
        transition: 1.2s;
    }

    .copy:hover {
        color: var(--dourado);
    }
}