/* --- Global Styles & Variables --- */
:root {
    --primary-color: #00aaff; /* Bright tech blue */
    --secondary-color: #00e676; /* Tech green accent */
    --dark-bg: #0a0f18; /* Very dark blue/black */
    --medium-bg: #101827; /* Slightly lighter dark blue */
    --light-bg: #1a2333; /* Even lighter for cards/elements */
    --text-color: #e0e0e0;
    --heading-color: #ffffff;
    --muted-text-color: #a0a0a0;
    --font-primary: 'Roboto', sans-serif;
    --font-secondary: 'Orbitron', sans-serif; /* Techy font for headings */
    --border-radius: 5px;
    --box-shadow: 0 4px 15px rgba(0, 170, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    background-color: var(--dark-bg);
    color: var(--text-color);
    line-height: 1.7;
    font-size: 16px; /* Base font size */
}

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

h1, h2, h3 {
    font-family: var(--font-secondary);
    color: var(--heading-color);
    margin-bottom: 1rem;
    line-height: 1.3;
}

h1 { font-size: 3rem; letter-spacing: 1px;}
h2 { font-size: 2.2rem; color: var(--primary-color); margin-bottom: 2rem; text-transform: uppercase; }
h3 { font-size: 1.5rem; }

p {
    margin-bottom: 1rem;
}

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

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

.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    font-family: var(--font-secondary);
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--primary-color);
    color: var(--dark-bg);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

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

.btn-secondary:hover {
    background-color: var(--secondary-color);
    color: var(--dark-bg);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.content-section {
    padding: 100px 0;
}

.alt-bg {
    background-color: var(--medium-bg);
}

.section-intro {
    max-width: 700px;
    margin: 0 auto 2rem auto;
    text-align: center;
    color: var(--muted-text-color);
}

/* --- Header & Navigation --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background-color: rgba(10, 15, 24, 0.85); /* Semi-transparent dark */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    backdrop-filter: blur(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-logo a {
    font-family: var(--font-secondary);
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--heading-color);
}
.nav-logo a:hover {
    color: var(--primary-color);
}

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

.nav-links li {
    margin-left: 25px;
}

.nav-links a {
    color: var(--text-color);
    font-weight: 500;
    padding: 0.5rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    transition: width 0.3s ease;
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--primary-color);
}

.hamburger-menu {
    display: none;
    cursor: pointer;
}

.hamburger-menu .bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    background-color: var(--heading-color);
    transition: all 0.3s ease-in-out;
}

/* --- Hero Section --- */
.hero-section {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(rgba(10, 15, 24, 0.8), rgba(10, 15, 24, 0.95)),
                url('https://www.transparenttextures.com/patterns/nistri.png'); /* Subtle tech background */
    /* Optional: Add a more distinct background image later in assets/ */
    padding-top: 80px; /* Account for fixed navbar */
}

.hero-content h1 {
    margin-bottom: 0.5rem;
    font-size: 3.5rem;
    position: relative;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 2s steps(12, end),
               blink-caret 1s step-end infinite;
    letter-spacing: 2px;
}

@keyframes typing {
    from { width: 0 }
    to { width: 9ch }
}

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

.hero-content .subtitle {
    font-size: 1.5rem;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-family: var(--font-primary);
    font-weight: 300;
}

.hero-cta .btn {
    margin: 0 0.5rem;
}

.scroll-down-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
}
.scroll-down-indicator a {
    font-size: 0.8rem;
    color: var(--muted-text-color);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.scroll-down-indicator span {
    display: block;
    width: 1px;
    height: 30px;
    background: var(--muted-text-color);
    margin-bottom: 5px;
    animation: scroll-pulse 1.5s infinite ease-in-out;
}
@keyframes scroll-pulse {
    0% { transform: scaleY(0.5); opacity: 0.5; }
    50% { transform: scaleY(1); opacity: 1; }
    100% { transform: scaleY(0.5); opacity: 0.5; }
}


/* --- About Section --- */
.about-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    align-items: center;
}
.profile-pic {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: var(--box-shadow);
}

.about-text {
    text-align: left;
}
@media (max-width: 768px) {
    .about-text {
        text-align: center;
    }
}
.highlight {
    color: var(--primary-color);
    font-weight: bold;
}

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

.skill-card {
    background: linear-gradient(145deg, var(--light-bg), var(--medium-bg));
    padding: 2.5rem 2rem;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
    border: 1px solid rgba(0, 170, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

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

.skill-card:hover::before {
    transform: scaleX(1);
}

.skill-card i {
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.skill-card:hover i {
    transform: scale(1.2) rotate(5deg);
}

.skill-card h3 {
    color: var(--text-color);
    font-size: 1.4rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.skill-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.skill-card:hover h3::after {
    width: 100px;
}

.skill-card p {
    color: var(--muted-text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin: 0;
}

/* Colores específicos para cada skill */
.skill-card:nth-child(1) i { /* Networking */
    background: linear-gradient(45deg, #00aaff, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-card:nth-child(2) i { /* Security Concepts */
    background: linear-gradient(45deg, #ff3e3e, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-card:nth-child(3) i { /* Operating Systems */
    background: linear-gradient(45deg, #f0db4f, #ffd700);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-card:nth-child(4) i { /* Tools */
    background: linear-gradient(45deg, #9fef00, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-card:nth-child(5) i { /* Scripting */
    background: linear-gradient(45deg, #ff6b6b, #ff3e3e);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.skill-card:nth-child(6) i { /* Methodologies */
    background: linear-gradient(45deg, #a64dff, #00aaff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        padding: 0.5rem;
    }
    
    .skill-card {
        padding: 2rem 1.5rem;
    }
    
    .skill-card i {
        font-size: 2rem;
    }
    
    .skill-card h3 {
        font-size: 1.2rem;
    }
}

/* --- Certifications Section --- */
.cert-card {
    background: linear-gradient(145deg, var(--light-bg), var(--medium-bg));
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(0, 170, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.cert-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 170, 255, 0.15);
}

.cert-card:hover::before {
    transform: scaleX(1);
}

.cert-badge {
    max-width: 100px;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 170, 255, 0.2));
}

.cert-card:hover .cert-badge {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 20px rgba(0, 170, 255, 0.3));
}

.cert-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.cert-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.cert-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
    text-align: left;
}

.cert-info-item {
    padding: 1rem;
    background: rgba(0, 170, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(0, 170, 255, 0.1);
    transition: all 0.3s ease;
}

.cert-info-item:hover {
    background: rgba(0, 170, 255, 0.1);
    transform: translateY(-3px);
}

.cert-info-item strong {
    display: block;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.cert-info-item p {
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
}

.cert-description {
    color: var(--muted-text-color);
    line-height: 1.6;
    margin: 1.5rem 0;
    font-size: 1rem;
    margin-left: auto;
    margin-right: auto;
}

.cert-card .btn {
    margin-top: 0.5rem;
    padding: 0.8rem 2rem;
    font-size: 1rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

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

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

.cert-card .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 170, 255, 0.2);
}

@media (max-width: 768px) {
    .cert-card {
        padding: 2rem;
    }
    
    .cert-card h3 {
        font-size: 1.8rem;
    }
    
    .cert-info {
        grid-template-columns: 1fr;
    }
    
    .cert-badge {
        max-width: 100px;
    }
}

/* --- Labs Section --- */
.labs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
}

.lab-platform-card {
    background: linear-gradient(145deg, var(--light-bg), var(--medium-bg));
    padding: 2.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    border: 1px solid rgba(0, 170, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
    height: 100%; /* Asegura que todas las tarjetas tengan la misma altura */
}

.lab-platform-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.lab-platform-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 170, 255, 0.15);
}

.lab-platform-card:hover::before {
    transform: scaleX(1);
}

.lab-platform-card .platform-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
}

.lab-platform-card:hover .platform-icon {
    transform: scale(1.1) rotate(5deg);
}

.lab-platform-card .thm-icon { 
    background: linear-gradient(45deg, #ff455b, #ff6b6b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lab-platform-card .htb-icon { 
    background: linear-gradient(45deg, #9fef00, #00e676);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.lab-platform-card h3 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-size: 1.6rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.lab-platform-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.lab-platform-card:hover h3::after {
    width: 100px;
}

.lab-platform-card p {
    font-size: 0.95rem;
    color: var(--muted-text-color);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1; /* Hace que el párrafo ocupe el espacio disponible */
}

.lab-platform-card p em {
    display: block;
    font-style: normal;
    color: var(--text-color);
    margin-top: 1rem;
    font-weight: 500;
}

.lab-platform-card .btn {
    margin-top: auto; /* Empuja el botón hacia abajo */
    transition: all 0.3s ease;
}

.lab-platform-card .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.2);
}

.labs-outro {
    text-align: center;
    color: var(--muted-text-color);
    font-style: italic;
    max-width: 800px;
    margin: 3rem auto 0;
    padding: 2rem;
    border-top: 1px solid rgba(0, 170, 255, 0.1);
}

/* --- Contact Section --- */
.contact-card {
    background: linear-gradient(145deg, #0a0f18, #101827);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 3rem;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    align-items: center;
    max-width: 800px;
    margin: 3rem auto 0;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 170, 255, 0.1);
}

.contact-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, 
        rgba(0, 170, 255, 0.05),
        rgba(0, 230, 118, 0.05));
    z-index: 0;
}

.contact-method {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    position: relative;
    z-index: 1;
    padding: 2rem;
    border-radius: 15px;
    transition: all 0.3s ease;
}

.contact-method:hover {
    background: rgba(0, 170, 255, 0.05);
}

.contact-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #1a2333;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid rgba(0, 170, 255, 0.2);
}

.contact-icon::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: var(--primary-color);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-method:hover .contact-icon::before {
    opacity: 1;
}

.contact-icon i {
    font-size: 1.8rem;
    color: #00aaff;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.contact-method:hover .contact-icon i {
    color: #ffffff;
}

.contact-link {
    color: #e0e0e0;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    position: relative;
}

.contact-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px;
    background: #00aaff;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.contact-method:hover .contact-link {
    color: #00aaff;
}

.contact-method:hover .contact-link::after {
    transform: scaleX(1);
    transform-origin: left;
}

@media (max-width: 768px) {
    .contact-card {
        flex-direction: column;
        padding: 2rem 1.5rem;
        gap: 2rem;
    }
    
    .contact-method {
        width: 100%;
        padding: 1.5rem;
    }
    
    .contact-icon {
        width: 60px;
        height: 60px;
    }
    
    .contact-icon i {
        font-size: 1.5rem;
    }
    
    .contact-link {
        font-size: 1rem;
    }
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 2rem 0;
    background-color: var(--medium-bg);
    border-top: 1px solid var(--light-bg);
    color: var(--muted-text-color);
    font-size: 0.9rem;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    h1 { font-size: 2.2rem; }
    h2 { font-size: 1.6rem; }
    .hero-content h1 { font-size: 2.5rem; }
    .hero-content .subtitle { font-size: 1.1rem; }

    .navbar {
        padding: 1rem;
    }

    .nav-logo a {
        font-size: 1.5rem;
    }

    .nav-links {
        position: fixed;
        left: -100%;
        top: 70px;
        background-color: var(--medium-bg);
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        transition: left 0.3s ease-in-out;
        gap: 0;
        padding-top: 1rem;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin-left: 0;
        font-size: 1.2rem;
        width: 100%;
        text-align: center;
        display: flex;
        justify-content: center;
    }

    .nav-links a {
        display: block;
        padding: 0.8rem;
        width: 100%;
    }

    .language-btn {
        margin: 0.5rem auto;
        width: 60%;
        justify-content: center;
        padding: 0.8rem;
        font-size: 1rem;
        display: flex;
    }

    .hamburger-menu {
        display: block;
        z-index: 1001;
    }

    .hamburger-menu .bar {
        display: block;
        width: 25px;
        height: 3px;
        margin: 5px auto;
        background-color: var(--heading-color);
        transition: all 0.3s ease-in-out;
    }

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

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

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

    .content-section {
        padding: 40px 0;
    }

    .about-content {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.5rem;
    }

    .profile-pic {
        width: 180px;
        height: 180px;
        margin-bottom: 1rem;
    }

    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 0.5rem;
    }

    .skill-card {
        padding: 1.5rem;
    }

    .cert-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }

    .cert-badge {
        max-width: 100px;
    }

    .cert-info {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .labs-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .lab-platform-card {
        padding: 1.5rem;
    }

    .contact-card {
        flex-direction: column;
        padding: 1.5rem;
        gap: 1.5rem;
    }

    .contact-method {
        width: 100%;
        padding: 1rem;
    }

    .hero-cta {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

    .hero-cta .btn {
        margin: 0;
        width: 80%;
        max-width: 250px;
    }
}

/* Ajustes adicionales para pantallas muy pequeñas */
@media (max-width: 480px) {
    .hero-content h1 { font-size: 2rem; }
    .hero-content .subtitle { font-size: 1rem; }
    
    .cert-card h3 {
        font-size: 1.4rem;
    }
    
    .btn {
        padding: 0.7rem 1.5rem;
        font-size: 0.9rem;
    }

    .hero-cta .btn {
        width: 90%;
        padding: 0.8rem 1.2rem;
    }
}

/* Scrollbar Styling (Optional, for a more techy feel on compatible browsers) */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: var(--dark-bg);
}
::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

/* --- Language Toggle Button --- */
.language-btn {
    background: var(--light-bg);
    border: 1px solid var(--primary-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-primary);
    font-size: 0.9rem;
    transition: all 0.3s ease;
    margin-left: 1rem;
}

.language-btn i {
    color: var(--primary-color);
    font-size: 1rem;
}

.language-btn:hover {
    background: var(--primary-color);
    color: var(--dark-bg);
}

.language-btn:hover i {
    color: var(--dark-bg);
}

/* --- Machines Grid & Cards --- */
.machines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.machine-card {
    background: linear-gradient(145deg, var(--light-bg), var(--medium-bg));
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    border: 1px solid rgba(0, 170, 255, 0.1);
    position: relative;
    overflow: hidden;
    transition: all 0.4s ease;
}

.machine-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.machine-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 170, 255, 0.15);
}

.machine-card:hover::before {
    transform: scaleX(1);
}

.machine-logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1.5rem;
    transition: all 0.4s ease;
    filter: drop-shadow(0 5px 15px rgba(0, 170, 255, 0.2));
}

.machine-card:hover .machine-logo {
    transform: scale(1.1) rotate(5deg);
    filter: drop-shadow(0 8px 20px rgba(0, 170, 255, 0.3));
}

.machine-card h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.machine-card h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.machine-card:hover h3::after {
    width: 100px;
}

.machine-card p {
    color: var(--muted-text-color);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.machine-card .btn {
    margin-top: auto;
    transition: all 0.3s ease;
}

.machine-card .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 170, 255, 0.2);
}

@media (max-width: 768px) {
    .machines-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .machine-card {
        padding: 1.5rem;
    }
    
    .machine-logo {
        width: 100px;
        height: 100px;
    }
}

.lab-buttons {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: 1rem;
}

.lab-buttons .btn {
    flex: 0 1 auto;
    min-width: 130px;
    max-width: 160px;
    text-align: center;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

.lab-buttons .btn-secondary {
    min-width: 140px;
    max-width: 170px;
}

@media (max-width: 768px) {
    .lab-buttons {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: center;
    }
    
    .lab-buttons .btn {
        width: auto;
        min-width: 110px;
        max-width: 140px;
    }

    .lab-buttons .btn-secondary {
        min-width: 120px;
        max-width: 150px;
    }
}

/* --- Cybersecurity Decorative Elements --- */
.cyber-decoration {
    position: absolute;
    pointer-events: none;
    z-index: 0;
}

.cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(0, 170, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 170, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    z-index: -1;
}

.cyber-circle {
    position: absolute;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0.1;
    animation: pulse 4s infinite;
}

.cyber-circle:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -150px;
    right: -150px;
}

.cyber-circle:nth-child(2) {
    width: 200px;
    height: 200px;
    bottom: -100px;
    left: -100px;
    animation-delay: 1s;
}

.cyber-circle:nth-child(3) {
    width: 150px;
    height: 150px;
    top: 50%;
    right: 10%;
    animation-delay: 2s;
}

.cyber-line {
    position: absolute;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.1;
    animation: scan 3s infinite;
}

.cyber-line:nth-child(1) {
    width: 100%;
    top: 20%;
    animation-delay: 0s;
}

.cyber-line:nth-child(2) {
    width: 80%;
    top: 60%;
    animation-delay: 1s;
}

.cyber-line:nth-child(3) {
    width: 60%;
    top: 80%;
    animation-delay: 2s;
}

@keyframes pulse {
    0% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.15; }
    100% { transform: scale(1); opacity: 0.1; }
}

@keyframes scan {
    0% { transform: translateX(-100%); opacity: 0; }
    50% { opacity: 0.2; }
    100% { transform: translateX(100%); opacity: 0; }
}

/* Añadir efecto de terminal a los títulos de sección */
h2::before {
    content: '>';
    color: var(--primary-color);
    margin-right: 0.5rem;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Efecto de glitch en hover para las tarjetas */
.skill-card:hover::after,
.lab-platform-card:hover::after,
.cert-card:hover::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, 
        transparent 0%, 
        rgba(0, 170, 255, 0.1) 50%, 
        transparent 100%);
    animation: glitch 0.3s infinite;
    pointer-events: none;
}

@keyframes glitch {
    0% { transform: translateX(-2px); }
    25% { transform: translateX(2px); }
    50% { transform: translateX(-1px); }
    75% { transform: translateX(1px); }
    100% { transform: translateX(0); }
}

/* Efecto de terminal typing para el nombre en el hero */
.hero-content h1 {
    margin-bottom: 0.5rem;
    font-size: 3.5rem;
    position: relative;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 2s steps(12, end),
               blink-caret 1s step-end infinite;
    letter-spacing: 2px;
}

@keyframes typing {
    from { width: 0 }
    to { width: 9ch }
}

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

/* --- Mejoras de responsividad para máquinas y páginas de próximamente --- */
@media (max-width: 600px) {
  .machines-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0.5rem;
  }
  .machine-card {
    padding: 1rem 0.5rem;
    margin: 0 0.2rem;
    border-radius: 10px;
  }
  .machine-logo {
    width: 70px;
    height: 70px;
    margin-bottom: 1rem;
  }
  .machine-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }
  .machine-card p {
    font-size: 0.9rem;
    margin-bottom: 1rem;
  }
  .machine-card .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    width: 100%;
    min-width: unset;
    max-width: unset;
    box-sizing: border-box;
  }
  /* Próximamente: iconos y textos grandes */
  .content-section.alt-bg .container {
    padding: 0 0.5rem;
  }
  .content-section.alt-bg h1 {
    font-size: 1.4rem !important;
    margin-top: 1rem !important;
  }
  .content-section.alt-bg .subtitle {
    font-size: 1.1rem !important;
    margin-bottom: 1rem !important;
  }
  .content-section.alt-bg i.fas {
    font-size: 2.5rem !important;
  }
  .content-section.alt-bg p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }
  .content-section.alt-bg .btn {
    font-size: 0.95rem;
    padding: 0.7rem 1.2rem;
    width: 100%;
    max-width: 220px;
    margin: 0 auto;
    display: block;
  }
}

@media (max-width: 400px) {
  .machine-card {
    padding: 0.5rem 0.1rem;
  }
  .machine-logo {
    width: 50px;
    height: 50px;
  }
  .content-section.alt-bg h1 {
    font-size: 1.1rem !important;
  }
  .content-section.alt-bg .subtitle {
    font-size: 0.95rem !important;
  }
}