/* Configurações Gerais */
:root {
    --bg: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #0f172a;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --border: #334155;
    --accent: #38bdf8;
    --accent2: #818cf8;
    --footer-bg: #020617;
}

[data-theme="light"] {
    --bg: #f1f5f9;
    --bg-secondary: #e2e8f0;
    --bg-card: #ffffff;
    --text: #0f172a;
    --text-muted: #475569;
    --border: #cbd5e1;
    --accent: #0284c7;
    --accent2: #6366f1;
    --footer-bg: #1e293b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

.logo img {
    height: 40px;
    width: 40px;
    object-fit: contain;
    filter: drop-shadow(0 0 8px rgba(56, 189, 248, 0.6));
    transition: all 0.3s ease;
}

.logo:hover img {
    transform: rotate(10deg) scale(1.1);
    filter: drop-shadow(0 0 12px rgba(129, 140, 248, 0.8));
}

span {
    color: var(--accent);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

/* Navegação */
header {
    background: rgba(30, 41, 59, 0.95);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    padding: 1rem 10%;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.5s ease;
}

[data-theme="light"] header {
    background: rgba(241, 245, 249, 0.95);
}

@keyframes slideDown {
    from { transform: translateY(-100%); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Toggle tema */
.theme-toggle {
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.3);
    color: var(--accent);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--accent);
    color: #0f172a;
    transform: rotate(20deg) scale(1.1);
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: pulse 2s infinite;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.logo::before {
    content: '<';
    position: absolute;
    left: -20px;
    opacity: 0;
    animation: floatCode 2s infinite;
}

.logo::after {
    content: '/>';
    position: absolute;
    right: -25px;
    opacity: 0;
    animation: floatCode 2s infinite 0.5s;
}

@keyframes floatCode {
    0%, 100% { opacity: 0; transform: translateY(0); }
    50% { opacity: 0.6; transform: translateY(-5px); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    transform: rotate(90deg);
    color: var(--accent);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav ul li a {
    position: relative;
    padding-bottom: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

nav ul li a:hover::after { width: 100%; }
nav ul li a:hover { color: var(--accent); transform: translateY(-2px); }

/* Seção Hero */
.hero {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 20px 0;
    background: linear-gradient(135deg, var(--bg) 0%, var(--bg-secondary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    width: 550px;
    height: 550px;
    background-image: url('../img/icon.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.12;
    z-index: 0;
    filter: drop-shadow(0 0 40px rgba(56, 189, 248, 0.4))
            drop-shadow(0 0 80px rgba(129, 140, 248, 0.2));
}

.hero::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(56, 189, 248, 0.05) 2px, transparent 2px);
    background-size: 40px 40px;
    animation: float 30s linear infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes float {
    from { transform: translateY(0) rotate(0deg); }
    to { transform: translateY(-100px) rotate(360deg); }
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.hero-content {
    animation: fadeInUp 1s ease;
    position: relative;
    z-index: 1;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(50px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    position: relative;
}

/* Cursor piscando do typewriter */
#typewriter {
    color: var(--accent);
    border-right: 3px solid var(--accent);
    padding-right: 4px;
    animation: blink-cursor 0.7s step-end infinite;
}

@keyframes blink-cursor {
    0%, 100% { border-color: var(--accent); }
    50% { border-color: transparent; }
}

.hero p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    animation: fadeInUp 1s ease 0.2s both;
}

.btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.4s both;
}

.btn-principal,
.btn-secundario {
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    z-index: 1;
}

.btn-principal::before,
.btn-secundario::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-principal:hover::before,
.btn-secundario:hover::before {
    width: 300px;
    height: 300px;
}

.btn-principal {
    background: var(--accent);
    color: #0f172a;
    border: none;
}

.btn-secundario {
    border: 2px solid var(--accent);
    color: var(--accent);
    background: transparent;
}

.btn-principal:hover,
.btn-secundario:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 20px rgba(56, 189, 248, 0.4);
}

/* Stats */
.stats-section {
    background: var(--bg-secondary);
    padding: 3rem 10%;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: bold;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    line-height: 1;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label i {
    color: var(--accent);
}

/* Container padrão */
.container {
    padding: 80px 10%;
    max-width: 1200px;
    margin: auto;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.container.visible {
    opacity: 1;
    transform: translateY(0);
}

.gray {
    background-color: var(--bg-secondary);
}

h2 {
    font-size: 2rem;
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    width: fit-content;
    left: 50%;
    transform: translateX(-50%);
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    transition: width 0.5s ease;
}

h2:hover::after { width: 100%; }

h2 i { animation: bounce 1s ease infinite; }

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

/* Sobre */
.sobre-content p {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 2rem;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.sobre-content p:hover {
    transform: scale(1.02);
    color: var(--accent);
}

.interesses {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 2rem;
}

.interesses span {
    background: rgba(56, 189, 248, 0.1);
    padding: 8px 16px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--accent);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.interesses span::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.2), transparent);
    transition: left 0.5s ease;
}

.interesses span:hover::before { left: 100%; }

.interesses span:hover {
    transform: translateY(-5px) scale(1.1);
    background: rgba(56, 189, 248, 0.2);
    box-shadow: 0 5px 15px rgba(56, 189, 248, 0.3);
}

/* Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.skill-card {
    background: var(--bg-card);
    padding: 1.5rem;
    text-align: center;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    animation: fadeInScale 0.5s ease backwards;
    animation-delay: calc(var(--i, 0) * 0.1s);
}

.skill-card:nth-child(1) { --i: 1; }
.skill-card:nth-child(2) { --i: 2; }
.skill-card:nth-child(3) { --i: 3; }
.skill-card:nth-child(4) { --i: 4; }
.skill-card:nth-child(5) { --i: 5; }
.skill-card:nth-child(6) { --i: 6; }
.skill-card:nth-child(7) { --i: 7; }
.skill-card:nth-child(8) { --i: 8; }

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.skill-card::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: linear-gradient(to top, rgba(56, 189, 248, 0.1), transparent);
    transition: height 0.5s ease;
    z-index: 0;
}

.skill-card:hover::after { height: 100%; }

.skill-card:hover {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--accent);
    box-shadow: 0 10px 30px rgba(56, 189, 248, 0.2);
}

.skill-card i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.skill-card:hover i { transform: rotateY(360deg) scale(1.2); }

.skill-card h3 {
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.skill-level {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

.level-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 4px;
    width: 0;
    transition: width 1.5s ease;
}

.skill-card:nth-child(1) .level-bar { --skill-width: 85%; }
.skill-card:nth-child(2) .level-bar { --skill-width: 75%; }
.skill-card:nth-child(3) .level-bar { --skill-width: 60%; }
.skill-card:nth-child(4) .level-bar { --skill-width: 70%; }
.skill-card:nth-child(5) .level-bar { --skill-width: 80%; }
.skill-card:nth-child(6) .level-bar { --skill-width: 70%; }
.skill-card:nth-child(7) .level-bar { --skill-width: 55%; }
.skill-card:nth-child(8) .level-bar { --skill-width: 50%; }

/* Projetos */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    border-bottom: 4px solid var(--accent);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: fadeInLeft 0.6s ease backwards;
    animation-delay: calc(var(--j, 0) * 0.1s);
}

.project-card:nth-child(1) { --j: 1; }
.project-card:nth-child(2) { --j: 2; }
.project-card:nth-child(3) { --j: 3; }
.project-card:nth-child(4) { --j: 4; }
.project-card:nth-child(5) { --j: 5; }

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.1), transparent);
    transition: left 0.5s ease;
}

.project-card:hover::before { left: 100%; }

.project-card:hover {
    transform: translateY(-10px) rotateY(2deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.4);
}

.project-icon i {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.project-card:hover .project-icon i { transform: scale(1.2) rotate(360deg); }

.project-card h3 {
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.project-card:hover h3 { color: var(--accent); }

.project-card p {
    margin-bottom: 1rem;
    flex-grow: 1;
    color: var(--text-muted);
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

.project-tech span {
    background: var(--bg-card);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.project-tech span:hover {
    background: var(--accent);
    color: #0f172a;
    transform: scale(1.05) translateY(-2px);
}

.project-links {
    display: flex;
    gap: 0.8rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: auto;
    padding-top: 1rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: bold;
    font-size: 0.85rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 5px;
    background: rgba(56, 189, 248, 0.05);
}

.project-link:hover {
    color: #0f172a;
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.4);
}

/* Formulário */
.contato-form {
    max-width: 600px;
    margin: 2rem auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-status {
    display: none;
    text-align: center;
    margin-top: 1rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: #1e293b;
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #f8fafc;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

.contato-form .btn-principal {
    align-self: center;
    padding: 12px 32px;
    font-size: 1rem;
}

/* Rodapé */
footer {
    padding: 50px 10%;
    text-align: center;
    background: var(--footer-bg);
    position: relative;
    overflow: hidden;
    color: #f8fafc;
}

footer h2, footer p { color: #f8fafc; }

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #38bdf8, transparent);
    animation: slideLine 3s infinite;
}

footer::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #818cf8, transparent);
    animation: slideLineReverse 3s infinite 1.5s;
}

@keyframes slideLine {
    from { left: -100%; }
    to { left: 100%; }
}

@keyframes slideLineReverse {
    from { right: -100%; }
    to { right: 100%; }
}

.links-contato {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem auto;
    max-width: 800px;
}

.contato-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 28px;
    background: #1e293b;
    border-radius: 50px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    font-weight: 500;
    min-width: 180px;
    color: #f8fafc;
}

.contato-item::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(56, 189, 248, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.contato-item:hover::before { width: 300px; height: 300px; }

.contato-item i { font-size: 1.2rem; transition: all 0.3s ease; }

.contato-item:hover {
    transform: translateY(-5px) scale(1.05);
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #0f172a;
    box-shadow: 0 10px 25px rgba(56, 189, 248, 0.4);
}

.contato-item:hover i { transform: scale(1.2) rotate(360deg); }

.copyright {
    font-size: 0.8rem;
    color: #64748b;
    margin-top: 2rem;
    position: relative;
    display: inline-block;
    padding: 0 20px;
}

.copyright::before,
.copyright::after {
    content: '•';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #38bdf8;
    animation: blink 2s infinite;
}

.copyright::before { left: 0; }
.copyright::after { right: 0; }

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Botão voltar ao topo */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent2));
    color: #0f172a;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.4);
    transition: all 0.3s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 999;
    transform: translateY(10px);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.6);
}

/* Fundo com partículas */
body { position: relative; }

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(rgba(56, 189, 248, 0.08) 1px, transparent 1px);
    background-size: 40px 40px;
    pointer-events: none;
    z-index: -1;
    animation: particleMove 20s linear infinite;
}

@keyframes particleMove {
    from { background-position: 0 0; }
    to { background-position: 100px 100px; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsividade */
@media (max-width: 768px) {
    .menu-toggle { display: block; }

    nav ul {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: #1e293b;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: left 0.3s ease;
        gap: 2rem;
        z-index: 999;
    }

    nav ul.active { left: 0; }

    .hero h1 { font-size: 2rem; }
    .hero p { font-size: 1rem; }
    .container { padding: 60px 5%; }
    h2 { font-size: 1.5rem; }

    .skills-grid,
    .projects-grid { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .links-contato {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }

    .contato-item {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }

    .project-links { flex-direction: column; align-items: center; }
    .project-link { width: 100%; justify-content: center; }
    .logo::before, .logo::after { display: none; }

    .back-to-top { bottom: 1rem; right: 1rem; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0f172a; }
::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #818cf8, #38bdf8);
}

.skill-card, .project-card, .contato-item { cursor: pointer; }

h1 span, .logo span { text-shadow: 0 0 10px rgba(56, 189, 248, 0.5); }

p { line-height: 1.8; }