
:root {
    --bg-main: #08070b;
    
    --bg-card: #111018;
    --text-primary: #f5f5f5;
    --text-secondary: #94a3b8;
    --accent: #a855f7;
    
    --accent-fresh: #4ade80;
    
    --accent-glow: rgba(168, 85, 247, 0.1);
    --border: rgba(168, 85, 247, 0.1);
    --font-main: 'Inter', system-ui, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-mono: 'Fira Code', monospace;
    --container-width: 1100px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-main);
    background-image: radial-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 30px 30px;
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}


.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.section-padding {
    padding: 10rem 0;
}


h1,
h2,
h3,
h4 {
    font-family: var(--font-heading);
    font-weight: 800;
    letter-spacing: -0.02em;
}

.text-gradient {
    background: linear-gradient(135deg, #fff 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.accent-text {
    color: var(--accent);
}


header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 2rem 0;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}

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

.brand {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    text-decoration: none;
    color: var(--text-primary);
}

.brand span {
    color: var(--accent);
}

nav a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 2.5rem;
    transition: var(--transition);
}

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


.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 4rem;
}

.hero-content {
    max-width: 800px;
}

.hero-label {
    font-family: var(--font-mono);
    color: var(--accent);
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    margin-bottom: 1.5rem;
    display: block;
}

.hero-title {
    font-size: clamp(3.5rem, 8vw, 6rem);
    line-height: 1;
    margin-bottom: 2rem;
}

.hero-title span {
    color: var(--accent);
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin-bottom: 3rem;
}


.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 3rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2.5rem;
    border-radius: 12px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.project-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.project-tags {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.project-tags span {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 100px;
}


.terminal-wrapper {
    background: #0d0f1a;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.terminal-header {
    background: #1a1d29;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--border);
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot-red {
    background: var(--accent);
}

.dot-yellow {
    background: var(--text-secondary);
}

.dot-green {
    background: var(--accent-fresh);
}

.terminal-body {
    height: 400px;
    padding: 1.5rem;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    overflow-y: auto;
}


footer {
    padding: 4rem 0;
    border-top: 1px solid var(--border);
    text-align: center;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}


.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 6rem 0;
    }

    .nav-wrapper nav {
        display: none;
    }

    /* Simplified for now, can add toggle if needed */
    .hero-title {
        font-size: 2.8rem;
    }

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

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

    .hero {
        text-align: center;
        justify-content: center;
    }

    .hero-subtitle {
        margin: 0 auto 3rem;
    }
}


.project-card:hover h3 {
    animation: glitchText 0.3s ease-in-out;
}

@keyframes glitchText {
    0% {
        transform: translate(0);
        text-shadow: 2px 0 var(--accent), -2px 0 var(--accent-fresh);
    }

    20% {
        transform: translate(-2px, 1px);
    }

    40% {
        transform: translate(2px, -1px);
    }

    60% {
        transform: translate(-2px, -1px);
    }

    80% {
        transform: translate(2px, 1px);
    }

    100% {
        transform: translate(0);
        text-shadow: none;
    }
}


.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    nav#nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-card);
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid var(--border);
    }

    nav#nav-menu.active {
        right: 0;
    }

    nav#nav-menu a {
        font-size: 1.5rem;
        margin: 0;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-padding {
        padding: 4rem 0;
    }
}


.hero-logo-large {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 500px;
    
    gap: 2rem;
    align-items: center;
    padding: 2rem 0;
    
}

.logo-circle {
    width: 480px;
    /* Much larger */
    height: 480px;
    border-radius: 50%;
    overflow: hidden;
    border: 1px solid var(--accent);
    box-shadow: 0 0 60px var(--accent-glow);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -2rem;
    
}


.reveal {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .about-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .section-padding {
        padding: 6rem 0;
    }

    .nav-wrapper nav {
        display: none;
    }

    /* Simplified for now, can add toggle if needed */
    .hero-title {
        font-size: 2.8rem;
    }

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

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

    .hero {
        text-align: center;
        justify-content: center;
    }

    .hero-subtitle {
        margin: 0 auto 3rem;
    }
}


.project-card:hover h3 {
    animation: glitchText 0.3s ease-in-out;
}

@keyframes glitchText {
    0% {
        transform: translate(0);
        text-shadow: 2px 0 var(--accent), -2px 0 var(--accent-fresh);
    }

    20% {
        transform: translate(-2px, 1px);
    }

    40% {
        transform: translate(2px, -1px);
    }

    60% {
        transform: translate(-2px, -1px);
    }

    80% {
        transform: translate(2px, 1px);
    }

    100% {
        transform: translate(0);
        text-shadow: none;
    }
}


.mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1100;
}

.mobile-toggle span {
    width: 25px;
    height: 2px;
    background-color: var(--text-primary);
    transition: var(--transition);
}

@media (max-width: 768px) {
    .mobile-toggle {
        display: flex;
    }

    nav#nav-menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: var(--bg-card);
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 1000;
        border-left: 1px solid var(--border);
    }

    nav#nav-menu.active {
        right: 0;
    }

    nav#nav-menu a {
        font-size: 1.5rem;
        margin: 0;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .mobile-toggle.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-toggle.active span:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .section-padding {
        padding: 4rem 0;
    }
}


.hero-logo-large {
    display: flex;
    justify-content: center;
    margin-bottom: 3rem;
}

.hero-split {
    display: grid;
    grid-template-columns: 1fr 500px;
    
    gap: 2rem;
    align-items: center;
    padding: 2rem 0;
    
}

.logo-circle {
    width: 480px;
    /* Much larger */
    height: 480px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    /* Borde blanquito */
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -2rem;
    
}


.app-container {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 200px;
    
    background: var(--bg-card);
    border-right: 1px solid var(--border);
    position: fixed;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.sidebar.collapsed {
    width: 70px;
    
}

.main-content {
    flex: 1;
    margin-left: 200px;
    /* [CONTROL] DEBE COINCIDIR CON EL ANCHO ABIERTO DEL SIDEBAR */
    display: flex;
    flex-direction: column;
    transition: margin-left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding-top: 70px;
}

.main-content.compact {
    margin-left: 70px;
    /* [CONTROL] DEBE COINCIDIR CON EL ANCHO CERRADO DEL SIDEBAR */
}

.sidebar-header {
    padding: 2.5rem 1rem 1.5rem;
    /* Más espacio arriba para el toggle absoluto */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    border-bottom: 1px solid var(--border);
    position: relative;
    /* Base para el toggle */
}

.sidebar-toggle {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px;
    z-index: 1100;
    position: absolute;
    top: 10px;
    right: 10px;
    /* Pegado a la esquina superior derecha */
}

.sidebar-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--accent-fresh);
    transition: 0.3s;
}

.brand-logo {
    display: flex;
    justify-content: center;
    overflow: hidden;
    /* Asegura que la imagen no se salga del círculo */
    border-radius: 50%;
}

.brand-logo img {
    width: 100px;
    /* Tamaño grande cuando está abierto */
    height: 100px;
    border-radius: 50%;
    border: 1px solid var(--accent);
    transition: all 0.4s ease;
    transform: scale(1.1) translateZ(0);
    /* Hardware acceleration */
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
    /* Mayor nitidez */
    backface-visibility: hidden;
}

.sidebar.collapsed .brand-logo img {
    width: 40px;
    /* Tamaño mini cuando está cerrado */
    height: 40px;
}

.nav-text {
    opacity: 1;
    transition: opacity 0.3s ease;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
}

.sidebar.collapsed .nav-text {
    display: none;
    /* Elimina el espacio que ocupan las letras */
}

.sidebar.collapsed .sidebar-header {
    padding: 1rem 0.5rem;
    gap: 0.8rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.sidebar.collapsed .sidebar-toggle {
    position: static;
    /* Vuelve al flujo normal para estar ARRIBA de la imagen */
    margin-bottom: 5px;
}

.sidebar-nav {
    padding: 2rem 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    /* [CONTROL] ESPACIO ENTRE ICONO Y TEXTO */
    padding: 0 2rem 0 0.4rem;
    /* [CONTROL] ARRIBA | DERECHA | ABAJO | IZQUIERDA */
    margin: 0 1rem;
    /* Separación de los bordes del sidebar */
    border-radius: 8px;
    /* Esquinas redondeadas para el highlight */
    height: 55px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.nav-item i {
    width: 30px;
    /* Caja pequeña para el icono */
    min-width: 30px;
    display: flex;
    justify-content: flex-start;
    /* Pegado a la izquierda de su caja */
    font-size: 1.3rem;
}

/* Hero Section Professional */
.hero-split {
    display: grid;
    grid-template-columns: 1fr 500px;
    gap: 4rem;
    align-items: center;
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.logo-circle {
    width: 480px;
    height: 480px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    /* Borde blanquito por fin */
    box-shadow: 0 0 60px rgba(255, 255, 255, 0.1);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 1280px) {
    .hero-split {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 3rem;
        padding-top: 3rem;
    }

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

    .logo-circle {
        width: 350px;
        height: 350px;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        left: -100%;
        width: 280px;
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .top-header {
        left: 0 !important;
    }
}

.mobile-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: var(--text-primary);
    transition: 0.3s;
}

/* Responsividad Refinada */
@media (max-width: 1024px) {
    .sidebar {
        left: 0; /* Siempre visible */
        width: 70px !important; /* Empezar compacto */
    }

    .sidebar.active {
        width: 200px !important; /* Expandir al activar */
    }

    .sidebar.active .nav-text {
        display: block !important; /* Mostrar texto al expandir */
    }

    .main-content {
        margin-left: 70px !important; /* Espacio para la barra de iconos */
    }

    .top-header {
        left: 70px !important;
    }

    .mobile-toggle {
        display: flex !important;
    }
}

/* ===== COMPACT HORIZONTAL FOOTER ===== */
.main-footer {
    padding: 1rem 2rem;
    background: #0a0a0a;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

.footer-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4rem;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-info {
    text-align: left;
}

.footer-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.1rem;
    color: var(--text-primary);
}

.footer-info p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    line-height: 1.4;
}

.logo-circle-small {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid white;
    background: #111;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-circle-small img {
    width: 120%;
    height: 120%;
    object-fit: cover;
}

@media (max-width: 768px) {
    .main-footer {
        margin-top: 8rem; /* Baja el borde superior */
    }

    .footer-container {
        flex-direction: row; /* Coloca la imagen al lado */
        justify-content: center;
        gap: 1.5rem;
        padding: 0 1rem;
    }

    .logo-circle-small {
        width: 60px; /* Logo más pequeño para que quepa al lado */
        height: 60px;
    }

    .footer-info {
        text-align: left;
    }
}


/* ===== TERMINAL IA STYLING ===== */
.terminal-wrapper {
    max-width: 900px;
    margin: 0 auto;
    background: #0d0c12;
    border-radius: 12px;
    border: 1px solid var(--border);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.terminal-header {
    background: #1a1924;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.terminal-dots {
    display: flex;
    gap: 8px;
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.dot-red {
    background: #ff5f56;
}

.dot-yellow {
    background: #ffbd2e;
}

.dot-green {
    background: #27c93f;
}

.terminal-title {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
    opacity: 0.8;
}

.terminal-body {
    height: 400px;
    padding: 1.5rem;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) transparent;
}

.terminal-input-wrapper {
    padding: 1rem 1.5rem;
    background: #111018;
    display: flex;
    align-items: center;
    gap: 1rem;
    border-top: 1px solid var(--border);
}

.terminal-prompt {
    color: var(--accent-fresh);
    font-weight: 700;
    font-family: var(--font-mono);
}

#terminal-input {
    background: transparent !important;
    border: none !important;
    color: var(--accent-fresh) !important;
    font-family: var(--font-mono);
    font-size: 1rem;
    width: 100%;
    outline: none;
    padding: 0;
}

.terminal-line.ai-response {
    color: var(--accent-fresh);
    padding-left: 1rem;
    border-left: 2px solid var(--accent-fresh);
    margin: 0.5rem 0;
}

.sidebar.hidden {
    transform: translateX(-100%);
}

.main-content.expanded {
    margin-left: 0;
}

.sidebar-socials {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border);
    width: 100%;
}

.main-footer {
    margin-top: 5rem;
}

/* Lowered footer */


.logo-circle img {
    width: 120%;
    height: 120%;
    object-fit: cover;
    display: block;
    image-rendering: -webkit-optimize-contrast;
    /* Mayor nitidez */
    transform: translateZ(0);
    /* Hardware acceleration */
}


.nav-item.active {
    background: rgba(168, 85, 247, 0.2) !important;
    color: var(--accent-fresh) !important;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.4);
    border: 1px solid var(--accent);
}

.sidebar-socials a {
    color: var(--text-secondary);
    font-size: 1.2rem;
    transition: var(--transition);
}

.sidebar-socials a:hover {
    color: var(--accent);
    transform: scale(1.2);
}

.top-header {
    height: 70px;
    background: var(--bg-main);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    position: fixed;
    top: 0;
    right: 0;
    left: 200px;
    z-index: 900;
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
}

.main-content.compact .top-header {
    left: 70px;
    /* [CONTROL] DEBE COINCIDIR CON EL ANCHO CERRADO DEL SIDEBAR */
}


.mobile-toggle-btn {
    display: none;
    background: none;
    border: none;
    color: var(--accent-fresh);
    font-size: 1.5rem;
    cursor: pointer;
    margin-right: 1rem;
    align-items: center;
    justify-content: center;
}

/* Buttons */
.hero-actions {
    display: flex;
    gap: 1rem;
    /* Reduced gap */
    margin-top: 2.5rem;
}

.btn-primary,
.btn-secondary {
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--accent);
    color: white;
    border: 1px solid var(--accent);
}

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

.btn-primary:hover {
    background: var(--accent-fresh);
    border-color: var(--accent-fresh);
    color: var(--bg-main);
}

.btn-secondary:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 800;
    margin-top: 0.5rem;
    color: var(--text-primary);
}

/* Anti-Flicker States */
.sidebar-is-collapsed .main-content {
    margin-left: 70px !important;
}

.sidebar-is-collapsed .top-header {
    left: 70px !important;
}
/* TERMINAL WIDGET FLOTANTE */
.terminal-widget {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 9999;
    font-family: var(--font-mono);
}

.terminal-trigger {
    background: var(--bg-card);
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
    font-weight: bold;
}

.terminal-trigger:hover {
    background: var(--accent);
    color: white;
    transform: translateY(-5px);
}

.terminal-window {
    position: fixed;
    bottom: 6rem;
    right: 2rem;
    width: 400px;
    height: 500px;
    background: var(--bg-main);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.8);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

.terminal-window.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.terminal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    margin-left: auto;
}

@media (max-width: 768px) {
    .terminal-widget {
        display: none !important; /* Oculto en móvil, se usa el link del sidebar */
    }
    
    .terminal-window {
        position: fixed;
        bottom: 5.5rem;
        right: 1.5rem;
        left: 1.5rem;
        width: auto;
        height: 70vh;
        z-index: 100000;
        margin-top: 0;
    }
}

@keyframes slideInUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}



.terminal-controls {
    display: flex;
    gap: 0.8rem;
    align-items: center;
    margin-left: auto;
}

.terminal-controls button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 4px;
    transition: all 0.3s ease;
}

.terminal-controls button:hover {
    color: var(--accent);
    transform: scale(1.2);
}

.terminal-controls .terminal-close:hover {
    color: #ff5f56;
}

@media (max-width: 1024px) {
    .sidebar {
        width: 250px;
        left: -250px;
        z-index: 2000;
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }

    .sidebar.active {
        left: 0;
    }

    .main-content {
        margin-left: 0 !important;
        padding-top: 80px;
    }

    .top-header {
        left: 0 !important;
        padding: 0 1.5rem;
    }

    .mobile-toggle-btn {
        display: flex !important;
    }

    .terminal-widget {
        display: none !important;
    }
}

