@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Fira+Code:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Cores do Editor de Código */
    --primary-color: #61dafb; /* Azul claro - strings, links */
    --secondary-color: #f8f8f2; /* Branco suave - texto normal */
    --accent-color: #ff79c6; /* Rosa - keywords */
    --keyword-color: #ff79c6; /* Rosa - keywords */
    --string-color: #f1fa8c; /* Amarelo - strings */
    --comment-color: #6272a4; /* Cinza azulado - comentários */
    --function-color: #50fa7b; /* Verde - funções */
    --variable-color: #bd93f9; /* Roxo - variáveis */
    --number-color: #ffb86c; /* Laranja - números */
    --operator-color: #ff79c6; /* Rosa - operadores */
    --tag-color: #ff79c6; /* Rosa - tags HTML */
    --attribute-color: #50fa7b; /* Verde - atributos */
    
    /* Cores de fundo */
    --bg-primary: #282a36; /* Fundo principal - Dracula theme */
    --bg-secondary: #44475a; /* Fundo secundário */
    --bg-tertiary: #6272a4; /* Fundo terciário */
    
    /* Cores de texto */
    --text-primary: #f8f8f2; /* Texto principal */
    --text-secondary: #6272a4; /* Texto secundário */
    --text-muted: #6272a4; /* Texto muted */
    
    /* Glass effect */
    --glass-bg: rgba(68, 71, 90, 0.3);
    --glass-border: rgba(248, 248, 242, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.5);
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #61dafb, #50fa7b);
    --gradient-secondary: linear-gradient(135deg, #ff79c6, #bd93f9);
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    overflow-x: hidden;
    position: relative;
}

/* Glass Effect Mixin */
.glass {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    transition: all 0.3s ease;
}

/* Hover apenas para projetos */
.projects-grid .glass:hover,
.project-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.7);
    border-color: rgba(97, 218, 251, 0.3);
}

/* Remover hover dos outros elementos glass */
header.glass:hover,
section.glass:hover,
.glass:hover:not(.projects-grid .glass):not(.project-item) {
    transform: none;
    box-shadow: var(--glass-shadow);
    border-color: var(--glass-border);
}

/* Estilos para tags HTML visíveis */
.code-tag {
    color: var(--tag-color);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-weight: 600;
    font-size: 0.9em;
    opacity: 0.8;
}

.code-tag::before {
    content: '<';
    color: var(--operator-color);
    font-weight: 700;
}

.code-tag::after {
    content: '>';
    color: var(--operator-color);
    font-weight: 700;
}

/* Estilos para texto com sintaxe de código */
.code-text {
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
    color: var(--text-primary);
}

.code-text .tag {
    color: var(--tag-color);
    font-weight: 600;
}

.code-text .attribute {
    color: var(--attribute-color);
}

.code-text .string {
    color: var(--string-color);
    font-style: normal;
}

.code-text .comment {
    color: var(--comment-color);
    font-style: italic;
}

.code-text .keyword {
    color: var(--keyword-color);
    font-weight: 600;
}

.code-text .function {
    color: var(--function-color);
}

.code-text .variable {
    color: var(--variable-color);
}

.code-text .number {
    color: var(--number-color);
}

/* Melhorar a aparência dos títulos com tags */
section h2 .code-tag {
    font-size: 0.6em;
    vertical-align: middle;
    margin: 0 0.5rem;
}

section h2 .code-tag::before,
section h2 .code-tag::after {
    font-size: 0.8em;
}

/* Estilo para o texto dentro das tags */
.code-text .string {
    color: var(--string-color);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Header Styles */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 3rem 2rem;
    position: relative;
    margin: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    transition: none;
}

/* Remover hover do header */
header:hover {
    transform: none;
    box-shadow: var(--glass-shadow);
    border-color: var(--glass-border);
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(97, 218, 251, 0.05) 0%, rgba(80, 250, 123, 0.03) 100%);
    border-radius: 24px;
    z-index: -1;
}

header h1 {
    font-size: 4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    text-shadow: 0 0 30px rgba(97, 218, 251, 0.3);
    position: relative;
}

header h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

header img {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 2rem;
    border: 3px solid var(--glass-border);
    box-shadow: 0 0 30px rgba(97, 218, 251, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

header img::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    background: var(--gradient-primary);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
}

header img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 50px rgba(97, 218, 251, 0.4);
    border-color: var(--primary-color);
}

header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: none;
    line-height: 1.6;
    padding: 1.5rem 2rem;
    border-radius: 12px;
    background: rgba(68, 71, 90, 0.3);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    white-space: nowrap;
}

/* Main Content */
main {
    padding: 4rem 2rem;
    max-width: 1400px; /* Aumentado de 1200px para 1400px para mais espaço horizontal */
    margin: 0 auto;
}

section {
    margin-bottom: 4rem;
    padding: 2.5rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    transition: all 0.3s ease;
}

/* Remover hover das seções */
section:hover {
    transform: none;
    box-shadow: var(--glass-shadow);
    border-color: var(--glass-border);
}

section h2 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

section h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

section p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(68, 71, 90, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(97, 218, 251, 0.1);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* Projects Grid */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem; /* Aumentado de 2rem para 2.5rem para melhor espaçamento */
    margin-top: 2rem;
    align-items: stretch;
    justify-items: center;
    width: 100%; /* Garantir que ocupe toda a largura disponível */
    max-width: 100%; /* Remover limitação de largura */
}

/* Project Cards */
.card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    min-width: 0;
    min-height: 25rem; /* 400px */
    display: flex;
    flex-direction: column;
    width: 100%; /* Garantir que ocupe toda a largura da coluna do grid */
    max-width: 100%; /* Remover limitação de largura */
}

.card:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.7);
    border-color: rgba(97, 218, 251, 0.3);
}

.project-link-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

.project-link-overlay:hover {
    background: rgba(97, 218, 251, 0.1);
}

.project-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.card-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    background: var(--bg-primary);
}

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

/* Ícone de edição */
.edit-icon {
    position: absolute;
    top: 0.625rem; /* 10px */
    right: 0.625rem; /* 10px */
    background: rgba(97, 218, 251, 0.9);
    color: var(--bg-primary);
    width: 2rem; /* 32px */
    height: 2rem; /* 32px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 20;
    font-size: 0.875rem; /* 14px */
    border: 2px solid rgba(97, 218, 251, 0.3);
}

.edit-icon:hover {
    background: rgba(97, 218, 251, 1);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(97, 218, 251, 0.4);
}

.card:hover .edit-icon {
    opacity: 1;
}

/* Posicionamento relativo para o card-image */
.card-image {
    position: relative;
}

.card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0.25rem 0 0.5rem 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.card-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    flex: 1;
}

/* Style Separator */
#style-separator {
    display: block;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 3rem 0;
    border-radius: 1px;
    position: relative;
}

#style-separator::before {
    content: '';
    position: absolute;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    width: 10px;
    height: 6px;
    background: var(--primary-color);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    header img {
        width: 150px;
        height: 150px;
    }
    
    header p {
        font-size: 1rem;
        padding: 0.8rem 1.5rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    section p {
        font-size: 1rem;
        padding: 1.5rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gradient-secondary);
}

/* Melhorar a responsividade */
@media (max-width: 768px) {
    header {
        margin: 1rem;
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 2.5rem;
    }
    
    header h1::after {
        width: 100px;
    }
    
    header img {
        width: 150px;
        height: 150px;
    }
    
    header p {
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
    
    section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    section h2 {
        font-size: 2rem;
    }
    
    section p {
        font-size: 1rem;
        padding: 1rem;
    }
    
    main {
        padding: 2rem 1rem;
    }
    
    .projects-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1.5rem;
        width: 100%;
    }

    /* Skills: rolagem interna para caber todo o conteúdo */
    .section-content.expanded .skills-container {
        max-height: 65vh;
        overflow-y: auto;
    }
}

/* Melhorar a acessibilidade */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Efeitos de foco para acessibilidade */
.glass:focus,
header:focus,
section:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Melhorar o contraste para leitores de tela */
@media (prefers-contrast: high) {
    :root {
        --text-primary: #ffffff;
        --text-secondary: #e5e5e5;
        --glass-bg: rgba(255, 255, 255, 0.1);
        --glass-border: rgba(255, 255, 255, 0.2);
    }
}

/* Efeitos de loading */
.loading {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Melhorar a performance */
.glass {
    will-change: transform;
}

header img {
    will-change: transform;
}

/* Efeitos de hover mais suaves */
.glass:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.7);
    border-color: rgba(255, 255, 255, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Adicionar mais profundidade aos elementos */
section {
    position: relative;
}

section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.02) 0%, rgba(229, 229, 229, 0.01) 100%);
    border-radius: 20px;
    z-index: -1;
}

/* Efeito de digitação para o título */
.typing-effect {
    font-size: 3.2rem;
    font-weight: 700;
    margin-bottom: 2rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
    text-shadow: 0 0 30px rgba(97, 218, 251, 0.3);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: blink-caret 0.75s step-end infinite;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

/* Estilos para a lista de hard skills */
.skills-container {
    margin-top: 2rem;
}

.skills-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.5rem;
}

.skill-item {
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(68, 71, 90, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(97, 218, 251, 0.1);
    position: relative;
    transition: all 0.3s ease;
}

.skill-item:hover {
    background: rgba(68, 71, 90, 0.2);
    border-color: rgba(97, 218, 251, 0.3);
    transform: translateX(10px);
}

.skill-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-name {
    color: var(--string-color);
    font-weight: 600;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    line-height: 1.6;
}

.skill-level {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(97, 218, 251, 0.2);
}

.level-label {
    color: var(--comment-color);
    font-size: 0.9rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    min-width: 60px;
}

.level-bars {
    display: flex;
    gap: 4px;
    align-items: center;
}

.level-bar {
    width: 20px;
    height: 8px;
    background: rgba(68, 71, 90, 0.3);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.level-bar.active {
    background: linear-gradient(90deg, var(--primary-color), var(--function-color));
    box-shadow: 0 0 8px rgba(97, 218, 251, 0.4);
}

.level-text {
    color: var(--primary-color);
    font-weight: 600;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Responsividade para skills */
@media (max-width: 768px) {
    .skills-list {
        gap: 1rem;
    }
    
    .skill-item {
        padding: 1rem;
    }
    
    .skill-item:hover {
        transform: translateX(5px);
    }
    
    .skill-level {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .level-text {
        margin-left: 0;
    }
}

/* Seções expansíveis */
.collapsible-section {
    overflow: hidden;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 2rem 2.5rem;
    transition: all 0.3s ease;
    position: relative;
    border-bottom: 1px solid transparent;
}

.section-header:hover {
    background: rgba(97, 218, 251, 0.05);
    border-radius: 16px 16px 0 0;
}

.section-header.expanded {
    border-bottom: 1px solid rgba(97, 218, 251, 0.2);
    border-radius: 16px 16px 0 0;
}

.section-header h2 {
    margin: 0;
    flex: 1;
}

.expand-icon {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(97, 218, 251, 0.1);
    position: relative;
    flex-shrink: 0;
}

.expand-icon::before {
    content: '+';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -52%); /* leve ajuste vertical para compensar fonte */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 700;
    text-align: center;
}

.section-header.expanded .expand-icon {
    background: rgba(97, 218, 251, 0.2);
}

.section-header.expanded .expand-icon::before {
    transform: translate(-50%, -52%) rotate(360deg);
}

/* Reset da rotação quando não expandido */
.section-header:not(.expanded) .expand-icon::before {
    transform: translate(-50%, -52%) rotate(0deg);
}

.section-content {
    max-height: 0;
    overflow: hidden;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0 2.5rem;
    opacity: 0;
}

.section-content.expanded {
    max-height: 2000px;
    padding: 0 2.5rem 2.5rem 2.5rem;
    opacity: 1;
}

/* Hard Skills: habilitar rolagem da lista quando conteúdo for longo (todas as larguras) */
/* Rolagem interna apenas quando houver lista de skills */
.section-content.expanded .skills-container {
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding-right: 0.5rem;
}

/* Scrollbar sutil para a área de skills */
.section-content.expanded .skills-container::-webkit-scrollbar {
    width: 8px;
}
.section-content.expanded .skills-container::-webkit-scrollbar-track {
    background: rgba(68, 71, 90, 0.15);
    border-radius: 4px;
}
.section-content.expanded .skills-container::-webkit-scrollbar-thumb {
    background: rgba(97, 218, 251, 0.35);
    border-radius: 4px;
}
.section-content.expanded .skills-container::-webkit-scrollbar-thumb:hover {
    background: rgba(97, 218, 251, 0.55);
}

/* Espaçamento para o texto na seção "Sobre mim" */
.section-content.expanded .code-text {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(97, 218, 251, 0.1);
}

/* Responsividade para seções expansíveis */
@media (max-width: 768px) {
    .section-header {
        padding: 1.5rem;
    }
    
    .section-content.expanded {
        padding: 0 1rem 1rem 1rem;
    }
    
    .expand-icon {
        font-size: 1.5rem;
        width: 25px;
        height: 25px;
    }
    
    /* Permitir quebra de linha em dispositivos móveis */
    header p {
        white-space: normal;
        font-size: 1rem;
        padding: 1rem 1.5rem;
    }
    
    /* Responsividade para cards */
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-content h3 {
        font-size: 1.3rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
        max-height: 7rem;
        overflow-y: auto;
    }
}

/* Responsividade para mobile pequeno */
@media (max-width: 480px) {
    .projects-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1rem;
        width: 100%;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-content h3 {
        font-size: 1.2rem;
    }
    
    .card-content p {
        font-size: 0.9rem;
    }

    /* Títulos centralizados e sublinhado alinhado */
    section h2 {
        text-align: center;
        font-size: 1.7rem;
    }
    section h2::after {
        left: 50%;
        transform: translateX(-50%);
    }
    /* Alinhar a code-tag ao início no mobile */
    section h2 .code-tag {
        position: absolute;
        left: 1rem;
        right: auto;
        margin-left: 0;
        margin-right: 0.5rem;
    }
    .section-header {
        justify-content: center;
    }
    .section-header h2 {
        text-align: center;
    }
    .section-header .expand-icon {
        position: absolute;
        right: 1rem; /* 16px -> 1rem */
        top: 50%;
        transform: translateY(-50%);
    }

    /* Removido override do '+'; usa o centramento absoluto padrão */

    /* Cards centralizados e sem overflow horizontal */
    .project-card,
    .add-project-card {
        width: 100%;
        max-width: 20rem; /* 320px -> 20rem */
        margin: 0.625rem auto; /* 10px -> 0.625rem */
        height: auto;
    }
    .project-image {
        height: auto;
    }

    /* Skills: rolagem interna (mobile pequeno) */
    .section-content.expanded .skills-container {
        max-height: 60vh;
        overflow-y: auto;
    }
}

/* Card de Adicionar Projeto */
.add-project-card {
    border: 2px dashed rgba(97, 218, 251, 0.3);
    background: rgba(97, 218, 251, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-project-card:hover {
    border-color: rgba(97, 218, 251, 0.6);
    background: rgba(97, 218, 251, 0.1);
    transform: translateY(-10px);
}

.add-project-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 2rem;
    text-align: center;
}

    .add-project-icon {
        width: 5rem; /* 80px */
        height: 5rem; /* 80px */
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--function-color));
    display: flex;
    align-items: center;
    justify-content: center;
        margin-bottom: 1.5rem;
        box-shadow: 0 0 1.25rem rgba(97, 218, 251, 0.4); /* 20px */
}

    .add-project-icon span {
        font-size: 3rem;
    font-weight: 700;
    color: var(--bg-primary);
}

.add-project-content h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.add-project-content p {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 0;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

/* Modais */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--glass-bg);
    margin: 2% auto;
    padding: 0;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(97, 218, 251, 0.2);
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.close {
    color: var(--text-secondary);
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

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

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
    max-height: calc(90vh - 120px);
}

.modal-body::-webkit-scrollbar {
    width: 8px;
}

.modal-body::-webkit-scrollbar-track {
    background: rgba(68, 71, 90, 0.2);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb {
    background: rgba(97, 218, 251, 0.3);
    border-radius: 4px;
}

.modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(97, 218, 251, 0.5);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid rgba(97, 218, 251, 0.3);
    border-radius: 8px;
    background: rgba(68, 71, 90, 0.3);
    color: var(--text-primary);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    transition: all 0.3s ease;
}

.form-group input[type="file"] {
    padding: 0.5rem;
    background: rgba(68, 71, 90, 0.2);
    border: 2px dashed rgba(97, 218, 251, 0.3);
    cursor: pointer;
}

.form-group input[type="file"]:hover {
    border-color: var(--primary-color);
    background: rgba(68, 71, 90, 0.4);
}

.form-group input[type="file"]:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(97, 218, 251, 0.3);
}

.form-help {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
    padding: 1rem;
    border: 1px solid rgba(97, 218, 251, 0.3);
    border-radius: 8px;
    background: rgba(68, 71, 90, 0.2);
    transition: all 0.3s ease;
}

.image-preview:hover {
    border-color: var(--primary-color);
    background: rgba(68, 71, 90, 0.3);
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-preview p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.current-image-preview {
    text-align: center;
    padding: 1rem;
    border: 1px solid rgba(97, 218, 251, 0.3);
    border-radius: 8px;
    background: rgba(68, 71, 90, 0.2);
    margin-bottom: 1rem;
}

.current-image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.current-image-preview p {
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 10px rgba(97, 218, 251, 0.3);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--function-color));
    color: var(--bg-primary);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(97, 218, 251, 0.4);
}

.btn-secondary {
    background: rgba(68, 71, 90, 0.3);
    color: var(--text-primary);
    border: 1px solid rgba(97, 218, 251, 0.3);
}

.btn-secondary:hover {
    background: rgba(68, 71, 90, 0.5);
    border-color: var(--primary-color);
}

.btn-delete {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
}

.btn-delete:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.4);
    background: linear-gradient(135deg, #c0392b, #a93226);
}

/* ===== MEDIA QUERIES RESPONSIVAS ===== */

/* Tablet Grande (1024px - 1200px) */
@media (max-width: 1200px) {
    .container {
        max-width: 1000px;
        padding: 0 2rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
        gap: 20px;
        justify-items: center;
    }
    
    .project-card {
        width: 300px;
        height: 400px;
    }
}

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }
    
    .header h1 {
        font-size: 3rem;
    }
    
    .about-me {
        padding: 3rem 0;
    }
    
    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .projects-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 20px;
    }
    
    .project-card {
        width: 100%;
        max-width: 320px;
        height: 380px;
        margin: 0 auto;
    }
}

/* Mobile Grande (480px - 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .header {
        padding: 4rem 0 3rem;
        text-align: center;
    }
    
    .header h1 {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .header p {
        font-size: 1.1rem;
        line-height: 1.6;
    }
    
    .about-me {
        padding: 2.5rem 0;
        text-align: center;
    }
    
    .about-me h2 {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }
    
    .about-me p {
        font-size: 1rem;
        line-height: 1.7;
        max-width: 100%;
    }
    
    .skills {
        padding: 2.5rem 0;
    }
    
    .skills h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .skill-card {
        padding: 1.5rem;
        text-align: center;
    }
    
    .skill-card h3 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
    }
    
    .skill-card p {
        font-size: 0.95rem;
        line-height: 1.6;
    }
    
    .projects {
        padding: 2.5rem 0;
    }
    
    .projects h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
        text-align: center;
    }
    
    .projects-grid {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 1.5rem;
        width: 100%;
        max-width: 22rem;
        margin: 0 auto;
    }
    
    .project-card {
        width: 100%;
        max-width: 22rem;
        height: auto;
        margin: 0;
        padding: 1.25rem; /* 20px */
    }
    
    .project-image {
        height: auto;
        margin-bottom: 0.9375rem; /* 15px */
    }
    
    .project-info h3 {
        font-size: 1.2rem;
        min-height: 40px;
        margin-bottom: 10px;
    }
    
    .project-info p {
        font-size: 0.9rem;
        line-height: 1.5;
        max-height: 7.5rem; /* ~120px */
        overflow-y: auto;
        margin-bottom: 0.9375rem; /* 15px */
    }
    
    .project-info .btn {
        padding: 12px 16px;
        font-size: 0.95rem;
    }
    
    .add-project-card {
        height: 200px;
    }
    
    .add-project-card .add-icon {
        font-size: 3rem;
    }
    
    .add-project-card h3 {
        font-size: 1.1rem;
    }
    
    /* Modal Responsivo */
    .modal-content {
        width: 95%;
        max-width: 500px;
        margin: 2% auto;
        padding: 1.5rem;
        max-height: 95vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 1rem 1.5rem;
    }
    
    .modal-header h3 {
        font-size: 1.3rem;
    }
    
    .modal-body {
        padding: 1.5rem;
        max-height: calc(95vh - 100px);
    }
    
    .form-group {
        margin-bottom: 1.2rem;
    }
    
    .form-group label {
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 1rem;
    }
    
    .form-actions {
        flex-direction: column;
        gap: 0.5rem;
        position: sticky;
        bottom: 0;
        background: var(--glass-bg);
        padding-top: 1rem;
        margin-top: 1rem;
        border-top: 1px solid rgba(97, 218, 251, 0.2);
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-delete {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Navegação Mobile */
    .close-modal {
        width: 35px;
        height: 35px;
        font-size: 1.2rem;
    }
}

/* Mobile Pequeno (até 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 0.8rem;
    }
    
    .header {
        padding: 3rem 0 2rem;
    }
    
    .header h1 {
        font-size: 1.8rem;
        line-height: 1.1;
        white-space: normal;
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .about-me,
    .skills,
    .projects {
        padding: 2rem 0;
    }
    
    .about-me h2,
    .skills h2,
    .projects h2 {
        font-size: 1.8rem;
    }
    
    .about-me p {
        font-size: 0.95rem;
    }
    
    .skills-grid {
        max-width: 100%;
    }
    
    .skill-card {
        padding: 1.2rem;
    }
    
    .skill-card h3 {
        font-size: 1.2rem;
    }
    
    .skill-card p {
        font-size: 0.9rem;
    }
    
    .projects-grid {
        max-width: 100%;
    }
    
    .project-card {
        height: 420px;
        padding: 18px;
    }
    
    .project-image {
        height: 180px;
    }
    
    .project-info h3 {
        font-size: 1.1rem;
        min-height: 35px;
    }
    
    .project-info p {
        font-size: 0.85rem;
        line-clamp: 3;
        -webkit-line-clamp: 3;
    }
    
    .edit-icon {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
        font-size: 16px;
    }
    
    /* Modal Ultra Responsivo */
    .modal-content {
        width: 98%;
        padding: 1rem;
        margin: 1% auto;
    }
    
    .modal-header h3 {
        font-size: 1.2rem;
    }
    
    .form-group input,
    .form-group textarea {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-delete {
        padding: 0.7rem;
        font-size: 0.95rem;
    }
}

/* Mobile Micro (até 360px) */
@media (max-width: 360px) {
    .container {
        padding: 0 0.5rem;
    }
    
    .header h1 {
        font-size: 1.5rem;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.1;
        text-align: center;
    }
    /* Ajuste fino para telas muito estreitas */
    section h2 .code-tag {
        left: 0.75rem;
    }
    
    .project-card {
        height: 400px;
        padding: 15px;
    }
    
    .project-image {
        height: 160px;
    }
    
    .project-info h3 {
        font-size: 1rem;
    }
    
    .project-info p {
        font-size: 0.8rem;
    }
    
    .modal-content {
        padding: 0.8rem;
    }
}

/* Cards de Projetos */
.project-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem; /* 12px */
    padding: 1.5625rem; /* 25px */
    margin: 0.9375rem; /* 15px */
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 20rem; /* 320px */
    height: 26.25rem; /* 420px */
    display: flex;
    flex-direction: column;
    text-align: center;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 255, 136, 0.2);
    border-color: rgba(0, 255, 136, 0.4);
}

.project-image {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 0.75rem; /* 12px */
    margin-bottom: 1.25rem; /* 20px */
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-radius: 0.75rem; /* 12px */
}

.project-card:hover .project-image img {
    transform: scale(1.08);
}

.project-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}

.project-info h3 {
    color: #00ff88;
    margin: 4px 0 8px 0;
    font-size: 1.25em;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-info p {
    color: #e0e0e0;
    margin: 0 0 20px 0;
    line-height: 1.6;
    flex: 1;
    text-align: center;
    font-size: 0.95em;
    overflow-y: auto;
    max-height: 8.5rem; /* ~136px, para caber bem com altura do card */
    padding-right: 0.5rem; /* espaço para scrollbar */
}

.project-info .btn {
    width: auto;
    margin-top: auto;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1em;
    transition: all 0.3s ease;
    align-self: center;
}

.project-info .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 255, 136, 0.3);
}

.edit-icon {
    position: absolute;
    top: 1.25rem; /* 20px */
    right: 1.25rem; /* 20px */
    background: rgba(0, 0, 0, 0.8);
    color: #00ff88;
    width: 2.5rem; /* 40px */
    height: 2.5rem; /* 40px */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 1.125rem; /* 18px */
    backdrop-filter: blur(10px);
    border: 0.125rem solid rgba(0, 255, 136, 0.3); /* 2px */
}

.project-card:hover .edit-icon {
    opacity: 1;
}

.edit-icon:hover {
    background: rgba(0, 255, 136, 0.2);
    transform: scale(1.15);
    border-color: rgba(0, 255, 136, 0.6);
}

/* ===== Correções solicitadas ===== */
/* Centralizar os cards na grade em todas as larguras */
.projects-grid {
    justify-items: center;
}

/* Centralizar títulos de seção e o sublinhado */
section h2 {
    text-align: center;
}
section h2::after {
    left: 50%;
    transform: translateX(-50%);
}

/* Adicionar propriedade padrão line-clamp para compatibilidade */
@media (max-width: 768px) {
    .project-info p {
        line-clamp: 3;
    }
}
@media (max-width: 480px) {
    .project-info p {
        line-clamp: 3;
    }
}

/* Evitar rolagem horizontal no mobile: título menor e sem animação */
@media (max-width: 480px) {
    .typing-effect {
        font-size: 1.6rem;
        white-space: normal;
        border-right: 0;
        animation: none;
    }
}

/* Aumentar discretamente o tamanho do card e imagem quadrada */
.project-card {
    width: 20rem; /* 320px -> 20rem (mantém tamanho desktop) */
    height: 26.25rem; /* 420px -> 26.25rem */
}
.project-image {
    aspect-ratio: 1 / 1;
}