:root {
    --primary-color: turquoise;
    --secondary-color: #ff00ff;
    --text-color: white;
    --background-color: #000;
    --card-background-color: rgba(0, 0, 0, 0.2);
    --card-background-hover-color: rgba(0, 0, 0, 0.1);
    --border-color: #1abc9c;
    --font-family-main: "Fira Code", monospace;
}

body {
    font-family: var(--font-family-main);
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--background-color);
    perspective: 500px;
    z-index: -2;
    overflow: hidden;
}

.star {
    position: absolute;
    width: 4px;
    height: 4px;
    background: white;
    clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
    z-index: -1;
    opacity: 0.8;
}

@keyframes twinkle {
    0% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
    100% { opacity: 0.7; transform: scale(1); }
}

.star:nth-child(odd) {
    animation-delay: 0.5s;
}

/* Linha base de separação visual */
.line {
    width: 100%;
    height: 1px;
    background-color: var(--text-color);
}

header {
    text-align: center;
    padding: 20px 0;
}

.profile-img {
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    width: 150px;
    height: 150px;
    object-fit: cover;
    margin-bottom: 10px;
    transition: transform 0.3s ease, border-color 0.5s ease;
}

.profile-img:hover {
    transform: scale(1.1);
    border-color: var(--secondary-color);
}

h1:hover, h2:hover {
    text-shadow: 0 0 10px var(--text-color);
    transition: text-shadow 0.3s ease;
}

main {
    padding: 50px 20px;
    padding-bottom: 80px;
}

footer {
    position: static;
    width: 100%;
    text-align: center;
    background-color: var(--background-color);
    padding: 20px 0;
    color: var(--text-color);
    margin-top: 40px;
}

.social-icons {
    margin-top: 10px;
}

.social-icons a {
    margin-right: 10px;
    color: #ccc;
    font-size: 24px;
    text-decoration: none;
    transition: color 0.3s ease;
}

.social-icons a:hover {
    color: var(--primary-color);
}

.social-icons a i {
    font-size: 40px !important;
    margin-right: 10px;
}

.menu {
    background-color: var(--card-background-color);
    border-radius: 10px;
    padding: 10px;
}

.menu a:hover {
    color: var(--primary-color);
}

.menu ul {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
}

.menu li {
    list-style-type: none;
    color: var(--text-color);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.menu li i {
    margin-right: 10px;
}

.menu a {
    color: var(--text-color);
    text-decoration: none;
}

.content {
    display: none;
    background-color: var(--card-background-color);
    border-radius: 10px;
    padding: 20px;
    margin-top: 10px;
    text-align: justify;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.content.active {
    display: block;
}

#servicos h2, #hard-skills h2 {
    text-align: center;
}

#servicos {
    padding: 50px 0;
    background-color: var(--card-background-color);
}

.skills-soft-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    margin-top: 30px;
    padding: 0 40px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hard-skills-list {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    margin-top: 30px;
    padding: 0 40px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.skill-soft {
    width: 100%;
    min-height: 220px;
    padding: 25px;
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.skill-soft:hover {
    background-color: var(--card-background-hover-color);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.skill-soft h3 {
    color: var(--text-color);
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 15px;
    text-align: center;
    transition: color 0.3s ease;
}

.skill-soft:hover h3 {
    color: var(--secondary-color);
}

.skill-soft p {
    color: var(--primary-color);
    font-size: 1rem;
    line-height: 1.6;
}

.skill-hard {
    width: 100%;
    height: 180px;
    padding: 25px 20px;
    background-color: var(--card-background-color);
    border: 1px solid var(--border-color);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    text-align: center;
    word-wrap: break-word;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    box-sizing: border-box;
}

/* Animação de entrada escalonada */
.skill-hard:nth-child(1) { animation-delay: 0.1s; }
.skill-hard:nth-child(2) { animation-delay: 0.2s; }
.skill-hard:nth-child(3) { animation-delay: 0.3s; }
.skill-hard:nth-child(4) { animation-delay: 0.4s; }
.skill-hard:nth-child(5) { animation-delay: 0.5s; }
.skill-hard:nth-child(6) { animation-delay: 0.6s; }
.skill-hard:nth-child(7) { animation-delay: 0.7s; }
.skill-hard:nth-child(8) { animation-delay: 0.8s; }

.skill-hard:hover {
    background-color: var(--card-background-hover-color);
    transform: translateY(-8px) scale(1.02);
    border-color: var(--secondary-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

.skill-hard img {
    width: 70px;
    height: 70px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
}

.skill-hard:hover img {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.2));
}

.skill-hard h4 {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 5px;
    text-align: center;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.skill-hard:hover h4 {
    color: var(--secondary-color);
}

.skill-hard p {
    color: var(--primary-color);
    font-size: 1rem;
}

#projetos {
    padding: 50px 20px;
    background-color: var(--card-background-color);
    text-align: center;
}

.github-link {
    color: var(--primary-color);
    font-size: 1rem;
    text-decoration: none;
    margin-top: 10px;
    display: inline-block;
}

.github-link .fab.fa-github {
    font-size: 24px;
    color: var(--primary-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

.github-link:hover .fab.fa-github {
    transform: scale(1.1);
    color: var(--secondary-color);
}

/* ===== SEÇÃO DE PROJETOS - DESIGN MODERNO ===== */
.projetos-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    padding: 1rem 0;
    width: 100%;
    align-items: stretch;
    overflow: visible; /* Permite expansão dos cards */
}

.projeto-card {
    background: var(--card-background-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    border: 1px solid var(--border-color);
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    flex-direction: column;
    min-height: 520px; /* Altura mínima para uniformidade */
    height: auto; /* Permite que o card se ajuste ao conteúdo */
    height: auto; /* Permite que o card se ajuste ao conteúdo */
}

.projeto-card.expanded {
    /* A altura já é 'auto' e a min-height já está definida no seletor .projeto-card. */
    /* Esta regra pode ser removida ou mantida para futuros estilos de expansão. */
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.projeto-card:nth-child(1) { animation-delay: 0.1s; }
.projeto-card:nth-child(2) { animation-delay: 0.2s; }
.projeto-card:nth-child(3) { animation-delay: 0.3s; }
.projeto-card:nth-child(4) { animation-delay: 0.4s; }
.projeto-card:nth-child(5) { animation-delay: 0.5s; }

.projeto-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    border-color: var(--primary-color);
}

.projeto-image {
    position: relative;
    height: 200px;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.projeto-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.projeto-card:hover .projeto-image img {
    transform: scale(1.1);
}

.projeto-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1rem;
    opacity: 0;
    transition: all 0.4s ease;
    transform: translateY(10px);
}

.projeto-card:hover .projeto-overlay {
    opacity: 1;
    transform: translateY(0);
}

.projeto-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.tag:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.projeto-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: visible; /* Permite que o conteúdo expandido seja visível */
}

.projeto-header h3 {
    font-size: 1.4rem;
    margin-bottom: 0.25rem;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
}

.projeto-header h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    transition: width 0.4s ease;
}

.projeto-card:hover .projeto-header h3::after {
    width: 100%;
}

.project-subtitle {
    font-size: 0.9rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.projeto-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Esconde overflow no estado normal */
}

.projeto-card.expanded .projeto-description {
    overflow: visible; /* Permite overflow quando expandido */
}

.btn-read-more {
    background: none;
    border: none;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.5rem 0;
    margin-top: 0.75rem;
    transition: all 0.3s ease;
    text-align: left;
    align-self: flex-start;
    border-radius: 4px;
}

.btn-read-more:hover {
    color: var(--secondary-color);
    transform: translateX(5px);
    background: rgba(0, 150, 136, 0.1);
    padding-left: 0.5rem;
}

.btn-read-more.expanded {
    background: rgba(0, 150, 136, 0.15);
    color: var(--secondary-color);
    font-weight: 700;
    padding: 0.5rem;
    margin-top: 1rem; /* Adiciona o margin-top de volta quando expandido */
    position: static; /* Volta à posição normal quando expandido */
    left: auto; /* Reseta o left */
    bottom: auto; /* Reseta o bottom */
}

.btn-read-more::after {
    content: ' →';
    transition: transform 0.3s ease;
    font-weight: bold;
}

.btn-read-more.expanded::after {
    content: ' ↑';
}

.btn-read-more:hover::after {
    transform: translateX(3px);
}

.projeto-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: auto;
    padding-top: 1rem;
}

.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: none;
    cursor: pointer;
    flex: 1;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 150, 136, 0.2);
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--secondary-color), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 150, 136, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-color);
    border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 150, 136, 0.3);
}

/* Media Query para Tablets */
@media (max-width: 1024px) and (min-width: 769px) {
    .skills-soft-list {
        grid-template-columns: 1fr;
        gap: 25px;
        max-width: 700px;
        padding: 0 30px;
    }

    .skill-soft {
        min-height: 180px;
    }

    .hard-skills-list {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
        max-width: 900px;
    }

    .skill-hard {
        height: 170px;
        padding: 22px 18px;
    }

    .skill-hard img {
        width: 65px;
        height: 65px;
    }
}

/* Responsividade */
@media (max-width: 768px) {
    .projetos-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0.5rem 0;
    }
    
    .projeto-card {
        margin: 0 0.5rem;
        transform: none;
        min-height: 480px; /* Altura mínima para garantir consistência */
        height: auto; /* Permite que o card cresça se o conteúdo precisar */
    }
    
    .projeto-card.expanded {
        /* A altura já é 'auto' na regra .projeto-card em mobile, então não é mais necessária aqui. */
    }
    
    .projeto-card:hover {
        transform: translateY(-5px);
    }
    
    .projeto-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
    
    .projeto-image {
        height: 160px; /* Imagem menor no mobile */
    }
    
    .btn-read-more {
        font-size: 0.8rem;
    }
    
    .btn-read-more.expanded {
        margin-top: 0.75rem;
        padding: 0.4rem;
    }

    /* Responsividade Skills e Serviços */
    .skills-soft-list {
        grid-template-columns: 1fr;
        padding: 0 15px;
        gap: 15px;
        max-width: 100%;
    }

    .skill-soft {
        min-height: 160px;
        padding: 20px 15px;
        margin-bottom: 10px;
    }

    .skill-soft h3 {
        font-size: 1.2rem;
        margin-bottom: 12px;
    }

    .skill-soft p {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .hard-skills-list {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 15px;
        gap: 15px;
        max-width: 600px;
    }

    .skill-hard {
        height: 160px;
        padding: 20px 15px;
    }

    .skill-hard img {
        width: 60px;
        height: 60px;
        margin-bottom: 10px;
    }

    .skill-hard h4 {
        font-size: 1rem;
        line-height: 1.2;
    }
}

#btnTopo {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    background-color: transparent;
    border: none;
    padding: 10px;
    font-size: 44px;
    color: var(--primary-color);
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

#btnTopo:hover {
    background-color: var(--card-background-hover-color);
    transform: scale(1.1);
    color: var(--secondary-color);
}

/* ===== MODAIS - ESTILO MODERNO ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    background-color: var(--card-background-color);
    margin: 5% auto;
    padding: 2rem;
    width: 90%;
    max-width: 900px;
    position: relative;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: translateY(0);
}

.fechar {
    color: var(--text-color);
    font-size: 32px;
    font-weight: bold;
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.fechar:hover {
    color: var(--secondary-color);
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal iframe {
    width: 100%;
    height: 450px;
    border: none;
    border-radius: 12px;
    margin-top: 1rem;
}

/* Responsividade dos Modais */
@media screen and (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 1.5rem;
    }
    
    .modal iframe {
        height: 250px;
    }
    
    .fechar {
        right: 1rem;
        top: 0.5rem;
        font-size: 28px;
        width: 35px;
        height: 35px;
    }
}

/* Responsividade extra para smartphones pequenos */
@media screen and (max-width: 480px) {
    .skills-soft-list {
        padding: 0 10px;
        gap: 12px;
    }

    .skill-soft {
        min-height: 140px;
        padding: 15px 12px;
        margin-bottom: 8px;
    }

    .skill-soft h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .skill-soft p {
        font-size: 0.85rem;
        line-height: 1.4;
    }

    .hard-skills-list {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 10px;
    }

    .skill-hard {
        height: 140px;
        padding: 15px 10px;
    }

    .skill-hard img {
        width: 50px;
        height: 50px;
        margin-bottom: 8px;
    }

    .skill-hard h4 {
        font-size: 0.9rem;
        line-height: 1.1;
    }
}



    .menu ul {
        flex-direction: column;
    }

    .modal-content {
        width: 90%;
        margin: 5% auto;
    }
}