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

:root {
    --primary: #2c3e50;
    --primary-light: #3498db;
    --primary-dark: #1a252f;
    --accent: #34495e;
    --bg-light: #ffffff;
    --bg-dark: #0a0e14;
    --bg-dark-alt: #151b23;
    --text-light: #2c3e50;
    --text-dark: #ffffff;
    --text-dark-secondary: #b8c5d6;
    --card-light: #f8f9fa;
    --card-dark: #1a2332;
    --border-light: #e2e8f0;
    --border-dark: #2d3748;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
    background: var(--bg-light);
    color: var(--text-light);
}

body.dark-mode {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: background-color 0.3s;
}

body.dark-mode header {
    background: rgba(10, 14, 20, 0.95);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
}

body.dark-mode .logo {
    color: var(--primary-light);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    transition: color 0.3s;
}

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

body.dark-mode .nav-links a:hover {
    color: var(--primary-light);
}

.controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: inherit;
    transition: transform 0.3s, color 0.3s;
}

.theme-toggle:hover {
    transform: scale(1.1);
    color: var(--primary);
}

body.dark-mode .theme-toggle:hover {
    color: var(--primary-light);
}

/* Language badge */
.lang-badge {
    background: var(--primary);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: transform 0.3s, opacity 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
}

body.dark-mode .lang-badge {
    background: var(--primary-light);
    color: #ffffff;
}

.lang-badge:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

/* Sections */
section {
    min-height: 100vh;
    padding: 6rem 0 4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
}

body.dark-mode section {
    border-bottom: 1px solid var(--border-dark);
}

/* Alternate background for sections */
section:nth-child(even) {
    background: var(--card-light);
}

body.dark-mode section:nth-child(even) {
    background: var(--bg-dark-alt);
}

.section-content {
    width: 100%;
    max-width: 1200px;
    padding: 0 2rem;
    margin: 0 auto;
}

h1, h2 {
    margin-bottom: 1rem;
}

h1 {
    font-size: 3rem;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode h1 {
    background: linear-gradient(135deg, #ffffff, var(--primary-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
}

/* Home Section */
#home {
    text-align: center;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

body.dark-mode .subtitle {
    color: var(--primary-light);
}

.description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.8;
}

body.dark-mode .description {
    opacity: 0.9;
    color: var(--text-dark-secondary);
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.8rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

body.dark-mode .btn-primary {
    background: var(--primary-light);
}

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

body.dark-mode .btn-secondary {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(44, 62, 80, 0.3);
}

/* About Section */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
}

.about-text p {
    margin-bottom: 1rem;
}

body.dark-mode .about-text {
    color: var(--text-dark-secondary);
}

.about-image {
    text-align: center;
}

.profile-placeholder {
    width: 300px;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    margin: 0 auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.profile-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* About Section Links */
.about-text a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.about-text a:hover {
    color: var(--primary-light);
}

body.dark-mode .about-text a {
    color: var(--primary-light);
}

body.dark-mode .about-text a:hover {
    color: #5dade2;
}

/* Skills Section */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.skill-card {
    background: var(--card-light);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}

body.dark-mode .skill-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.2);
}

.skill-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--primary);
}

body.dark-mode .skill-icon {
    color: var(--primary-light);
}

.skill-name {
    font-weight: 600;
    font-size: 1.1rem;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background: var(--card-light);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}

body.dark-mode .project-card {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(44, 62, 80, 0.2);
}

.project-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--card-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-mode .project-image {
    background: var(--card-dark);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.project-content {
    margin-top: -20px;
    padding: 0.75rem 1.5rem 1.5rem 1.5rem;
}

@media (max-width: 768px) {
    .project-content {
        margin-top: -10px;
        padding: 0.5rem 1rem 1rem 1rem;
    }
}

.project-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-description {
    opacity: 0.8;
    margin-bottom: 1rem;
}

body.dark-mode .project-description {
    opacity: 0.9;
    color: var(--text-dark-secondary);
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

body.dark-mode .project-link {
    color: var(--primary-light);
}

.project-link:hover {
    text-decoration: underline;
}

/* Contact Section */
.contact-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.contact-content p {
    color: var(--text-dark-secondary);
}

.contact-methods {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-light);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid var(--border-light);
}

body.dark-mode .contact-item {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.contact-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(44, 62, 80, 0.2);
}

.contact-icon {
    font-size: 2rem;
    color: var(--primary);
}

body.dark-mode .contact-icon {
    color: var(--primary-light);
}

.contact-text {
    font-size: 1.1rem;
    font-weight: 500;
}

/* Footer */
footer {
    background: var(--card-light);
    padding: 2rem;
    text-align: center;
    border-top: 1px solid var(--border-light);
}

body.dark-mode footer {
    background: var(--card-dark);
    border-color: var(--border-dark);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-links a {
    color: inherit;
    font-size: 1.5rem;
    transition: color 0.3s, transform 0.3s;
}

.social-links a:hover {
    color: var(--primary);
    transform: scale(1.2);
}

body.dark-mode .social-links a:hover {
    color: var(--primary-light);
    transform: scale(1.2);
}

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

.modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 1200px;
    text-align: center;
}

.modal-content img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.close {
    position: absolute;
    top: 10px;
    right: 25px;
    color: #ffffff;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.close:hover,
.close:focus {
    color: var(--primary-light);
    text-decoration: none;
}

.modal-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 20px;
}

.modal-description {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.6;
    margin-top: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
}

/* Botão Ver detalhes */
.project-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.project-details-btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

body.dark-mode .project-details-btn {
    border-color: var(--primary-light);
    color: var(--primary-light);
}

.project-details-btn:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

body.dark-mode .project-details-btn:hover {
    background: var(--primary-light);
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-links {
        gap: 1rem;
    }

    .nav-links a {
        font-size: 0.9rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.8rem;
    }

    .about-content {
        grid-template-columns: 1fr;
    }

    .profile-placeholder {
        width: 200px;
        height: 200px;
    }

    .skills-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .projects-grid {
        grid-template-columns: 1fr;
    }
}