/* Variables de color */
:root {
    --primary-color: #141B34;
    --secondary-color: #1E2749;
    --accent-color: #4A7B9D;
    --light-accent: #7EA8BE;
    --text-color: #E0E1DD;
    --text-secondary: #B8B8B8;
    --success-color: #4CAF50;
    --error-color: #F44336;
    --glass-effect: rgba(20, 27, 52, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--primary-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

section {
    padding: 80px 0;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 20px;
}

p {
    margin-bottom: 15px;
}

a {
    text-decoration: none;
    color: var(--light-accent);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    color: white;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.btn span {
    position: relative;
    z-index: 1;
}

.btn:before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--light-accent), var(--accent-color));
    transition: all 0.4s ease;
}

.btn:hover:before {
    left: 0;
}

.btn-download {
    background: linear-gradient(135deg, var(--accent-color), var(--light-accent));
    margin-right: 15px;
}

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

.btn-contact:hover {
    color: white;
}

.btn-view-more {
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--accent-color);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.btn-view-more:hover {
    background: var(--accent-color);
    color: white;
}

.btn-submit {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.section-title {
    text-align: center;
    margin-bottom: 60px;
    position: relative;
}

.section-title span {
    display: inline-block;
    position: relative;
    padding: 0 20px;
}

.section-title span:before,
.section-title span:after {
    content: '';
    position: absolute;
    top: 50%;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.section-title span:before {
    right: 100%;
}

.section-title span:after {
    left: 100%;
}

/* Efecto vidrio */
.glass-effect {
    background: var(--glass-effect);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 10px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.36);
}

/* Navigation */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: all 0.3s ease;
    padding: 15px 0;
}

#navbar.scrolled {
    background: var(--primary-color);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    padding: 10px 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    position: relative;
}

.nav-link:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.nav-link:hover:after {
    width: 100%;
}

.hamburger {
    display: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
}

.hamburger .line {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    transition: all 0.3s ease;
}

.hamburger.active .line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Header */
header {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    background: linear-gradient(rgba(20, 27, 52, 0.9), rgba(20, 27, 52, 0.7)), url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?ixlib=rb-1.2.1&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.header-content {
    max-width: 800px;
    padding: 0 20px;
}

.profile-container {
    margin-bottom: 30px;
}

.profile-image-wrapper {
    width: 200px;
    height: 200px;
    margin: 0 auto;
    position: relative;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid var(--glass-effect);
}

.image-border {
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    animation: rotateBorder 8s linear infinite;
    z-index: -1;
}

@keyframes rotateBorder {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

header h1 {
    font-size: 3.5rem;
    margin-bottom: 15px;
    background: linear-gradient(to right, var(--text-color), var(--light-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tagline {
    font-size: 1.5rem;
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.header-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.social-header {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
}

.social-header a {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--glass-effect);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-header a:hover {
    background: var(--accent-color);
    transform: translateY(-5px);
}

.scroll-down {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}

.scroll-down a {
    display: block;
    width: 30px;
    height: 50px;
    border: 2px solid var(--accent-color);
    border-radius: 15px;
    position: relative;
}

.scroll-down a:before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    width: 6px;
    height: 6px;
    background: var(--accent-color);
    border-radius: 50%;
    transform: translateX(-50%);
    animation: scrollDown 2s infinite;
}

@keyframes scrollDown {
    0% {
        opacity: 1;
        top: 10px;
    }
    100% {
        opacity: 0;
        top: 30px;
    }
}

/* About Section */
.about-content {
    display: flex;
    gap: 40px;
    align-items: center;
}

.about-text {
    flex: 1;
}

.about-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.stats-container {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    gap: 20px;
}

.stat-item {
    text-align: center;
    flex: 1;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 5px;
}

.stat-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.skills-chart {
    width: 100%;
    max-width: 400px;
}

/* Skills Section */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.skill-card {
    padding: 30px;
    transition: all 0.3s ease;
}

.skill-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.skill-icon {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 20px;
}

.skill-bar-container {
    margin-top: 20px;
}

.skill-bar {
    margin-bottom: 15px;
}

.skill-bar:before {
    content: attr(data-skill);
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.skill-bar:after {
    content: '';
    display: block;
    height: 8px;
    background: var(--secondary-color);
    border-radius: 4px;
    position: relative;
}

.skill-bar:after:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: var(--accent-color);
    border-radius: 4px;
    transition: width 1.5s ease;
}

.skill-bar[data-level="95"]:after:before { width: 95%; }
.skill-bar[data-level="90"]:after:before { width: 90%; }
.skill-bar[data-level="85"]:after:before { width: 85%; }
.skill-bar[data-level="80"]:after:before { width: 80%; }
.skill-bar[data-level="75"]:after:before { width: 75%; }
.skill-bar[data-level="70"]:after:before { width: 70%; }

.skill-list {
    list-style: none;
    margin-top: 20px;
}

.skill-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-list i {
    color: var(--accent-color);
}

/* Experience Section */
.experience-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
    gap: 10px;
}

.tab-btn {
    padding: 12px 25px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn.active {
    background: var(--accent-color);
    color: white;
}

.tab-btn:hover:not(.active) {
    background: rgba(74, 123, 157, 0.1);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline:before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: var(--accent-color);
    transform: translateX(-50%);
}

.timeline-item {
    display: flex;
    margin-bottom: 40px;
    position: relative;
}

.timeline-item:nth-child(odd) {
    justify-content: flex-end;
    padding-right: 50px;
}

.timeline-item:nth-child(even) {
    justify-content: flex-start;
    padding-left: 50px;
}

.timeline-date {
    position: absolute;
    top: 0;
    width: 120px;
    padding: 5px 10px;
    background: var(--accent-color);
    color: white;
    text-align: center;
    border-radius: 20px;
    font-weight: 600;
}

.timeline-item:nth-child(odd) .timeline-date {
    right: -160px;
}

.timeline-item:nth-child(even) .timeline-date {
    left: -160px;
}

.timeline-content {
    width: 100%;
    max-width: 400px;
    padding: 30px;
}

.timeline-content h3 {
    color: var(--accent-color);
}

.timeline-content h4 {
    color: var(--light-accent);
    font-size: 1rem;
    margin-bottom: 10px;
}

/* Projects Section */
.projects-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.filter-btn {
    padding: 8px 20px;
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background: var(--accent-color);
    color: white;
}

.filter-btn:hover:not(.active) {
    background: rgba(74, 123, 157, 0.1);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
}

.project-card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
}

.project-image {
    height: 200px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-preview {
    width: 50px;
    height: 50px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.project-preview:hover {
    transform: scale(1.1);
}

.project-content {
    padding: 25px;
}

.project-title {
    color: var(--accent-color);
    margin-bottom: 10px;
}

.project-description {
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.tech-tag {
    background: var(--secondary-color);
    color: var(--light-accent);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.project-links {
    display: flex;
    gap: 15px;
}

.project-link {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-link:hover {
    color: var(--accent-color);
}

.project-link i {
    font-size: 1rem;
}

.view-more {
    text-align: center;
    margin-top: 50px;
}

/* Contact Section */
.contact-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
}

.contact-info {
    padding: 40px;
}

.contact-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--accent-color);
}

.contact-info p {
    margin-bottom: 30px;
    color: var(--text-secondary);
}

.contact-list {
    list-style: none;
    margin-bottom: 30px;
}

.contact-list li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.contact-list i {
    width: 30px;
    height: 30px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
}

.contact-social {
    display: flex;
    gap: 15px;
}

.contact-social a {
    width: 40px;
    height: 40px;
    background: var(--secondary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.contact-social a:hover {
    background: var(--accent-color);
    color: white;
    transform: translateY(-5px);
}

.contact-form-container {
    padding: 40px;
}

.contact-form {
    display: grid;
    gap: 20px;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 15px 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--secondary-color);
    color: var(--text-color);
    font-size: 1rem;
}

.form-group textarea {
    resize: none;
    min-height: 100px;
}

.form-group label {
    position: absolute;
    top: 15px;
    left: 0;
    color: var(--text-secondary);
    pointer-events: none;
    transition: all 0.3s ease;
}

.form-group .focus-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: width 0.3s ease;
}

.form-group input:focus ~ label,
.form-group input:valid ~ label,
.form-group textarea:focus ~ label,
.form-group textarea:valid ~ label {
    top: -15px;
    font-size: 0.8rem;
    color: var(--accent-color);
}

.form-group input:focus ~ .focus-border,
.form-group textarea:focus ~ .focus-border {
    width: 100%;
}

/* Footer */
footer {
    position: relative;
    padding: 60px 0 0;
    background: var(--secondary-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 60px;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.footer-logo img {
    height: 40px;
}

.footer-logo span {
    font-weight: 700;
    font-size: 1.2rem;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
}

.footer-section h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h4:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.footer-section ul li a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.footer-section ul li a i {
    font-size: 0.8rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.social-links a {
    width: 35px;
    height: 35px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-color);
    transform: translateY(-5px);
}

.newsletter {
    margin-top: 20px;
}

.newsletter form {
    display: flex;
}

.newsletter input {
    flex: 1;
    padding: 10px 15px;
    background: var(--primary-color);
    border: none;
    border-radius: 30px 0 0 30px;
    color: var(--text-color);
}

.newsletter button {
    padding: 0 15px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0 30px 30px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter button:hover {
    background: var(--light-accent);
}

.footer-bottom {
    text-align: center;
    padding: 20px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.back-to-top {
    position: absolute;
    right: 30px;
    top: -30px;
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background: var(--light-accent);
}

.copyright {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Animaciones */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* Efecto máquina de escribir */
.typewriter p {
    overflow: hidden;
    border-right: 2px solid var(--accent-color);
    white-space: nowrap;
    margin: 0 auto;
    letter-spacing: 2px;
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

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

/* Responsive */
@media (max-width: 992px) {
    .about-content {
        flex-direction: column;
    }
    
    .about-text, .about-image {
        width: 100%;
    }
    
    .timeline:before {
        left: 30px;
    }
    
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        justify-content: flex-start;
        padding-left: 80px;
        padding-right: 0;
    }
    
    .timeline-item:nth-child(odd) .timeline-date,
    .timeline-item:nth-child(even) .timeline-date {
        left: -80px;
        right: auto;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: var(--primary-color);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        transition: all 0.5s ease;
    }
    
    .nav-links.active {
        left: 0;
    }
    
    .hamburger {
        display: flex;
    }
    
    .header-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-download, .btn-contact {
        width: 100%;
        max-width: 250px;
        text-align: center;
    }
    
    .stats-container {
        flex-direction: column;
        gap: 30px;
    }
    
    .project-card {
        max-width: 100%;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 2.5rem;
    }
    
    .tagline {
        font-size: 1.2rem;
    }
    
    .section-title span:before,
    .section-title span:after {
        width: 30px;
    }
    
    .experience-tabs {
        flex-direction: column;
    }
    
    .tab-btn {
        width: 100%;
        justify-content: center;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    .back-to-top {
        width: 50px;
        height: 50px;
        top: -25px;
        right: 20px;
    }
}