@import url('https://api.fontshare.com/v2/css?f[]=clash-display@500;600;700&f[]=satoshi@400;500;700&display=swap');

/* ==========================================
   SISTEMA DE DISEÑO Y VARIABLES (Aesthetics)
   ========================================== */
:root {
    --bg-main: #050810;
    --bg-gradient: radial-gradient(circle at 50% 0%, #0c1224 0%, #050810 80%);
    
    /* Colores del Vidrio (Glassmorphism - OpenClaw Style) */
    --glass-bg: rgba(9, 13, 26, 0.65);
    --glass-border: rgba(255, 255, 255, 0.05);
    --glass-border-hover: rgba(255, 255, 255, 0.12);
    --glass-shadow: rgba(0, 0, 0, 0.6);
    
    /* Acentos de Marca (Coral y Cian) */
    --accent-coral: #FF4D4D;
    --accent-coral-rgb: 255, 77, 77;
    --accent-cyan: #00E5CC;
    --accent-cyan-rgb: 0, 229, 204;
    --accent-emerald: #00E5CC; /* Reutilizamos cian para estado en línea */
    
    /* Texto */
    --text-primary: #FFFFFF;
    --text-secondary: #AEB2C1;
    --text-muted: #64697B;
    
    /* Fuentes y Bordes */
    --font-sans: 'Satoshi', sans-serif;
    --font-display: 'Clash Display', sans-serif;
    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 6px;
    
    /* Transiciones */
    --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
    --transition-quick: all 0.15s ease;
}

/* ==========================================
   RESET & ESTILOS GLOBALES
   ========================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    outline: none;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    position: relative;
}

/* Encabezados con Fuente Clash Display */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Efectos de luces de fondo animadas (Nebulosa) */
body::before, body::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -1;
    pointer-events: none;
    opacity: 0.12;
    animation: pulseGlow 12s infinite alternate ease-in-out;
}

body::before {
    top: 10%;
    left: 8%;
    background: var(--accent-coral);
}

body::after {
    bottom: 20%;
    right: 8%;
    background: var(--accent-cyan);
    animation-delay: 6s;
}

@keyframes pulseGlow {
    0% { transform: scale(1) translate(0, 0); }
    100% { transform: scale(1.4) translate(60px, 40px); }
}

/* Barra de Desplazamiento */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-main);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-coral);
}

/* ==========================================
   CONTENEDOR PRINCIPAL
   ========================================== */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}


/* ==========================================
   BENTO GRID SYSTEM
   ========================================== */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 20px;
}

/* Tarjeta Base Bento (Glassmorphic) */
.bento-card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 30px;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 15px 35px var(--glass-shadow);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.bento-card:hover {
    border-color: var(--glass-border-hover);
    transform: translateY(-2px);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.7), 0 0 35px rgba(var(--accent-coral-rgb), 0.04);
}

/* Asignación de columnas en el Grid (Estilo Bento Innovador 2026) */
.card-profile {
    grid-column: span 4;
    padding: 0;
    position: relative;
    height: 100%;
}

.card-hero {
    grid-column: span 8;
}

.card-chat {
    grid-column: span 5;
    height: 600px;
}

.card-stack {
    grid-column: span 7;
}

.card-experience {
    grid-column: span 12;
}

/* Tarjeta de Perfil Bento (Estilo Innovador 2026) */
.profile-image-container {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 380px; /* Asegura un tamaño mínimo en escritorio */
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.profile-hero-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
    z-index: 1;
}

.card-profile:hover .profile-hero-image {
    transform: scale(1.05) rotate(0.2deg);
}

/* Elegante capa de degradado oscuro en la base */
.profile-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, 
        rgba(5, 8, 16, 0.9) 0%, 
        rgba(5, 8, 16, 0.45) 45%, 
        rgba(5, 8, 16, 0) 100%);
    pointer-events: none;
    z-index: 2;
}

/* Hover glow effect for the card */
.card-profile:hover {
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.75), 0 0 35px rgba(0, 229, 204, 0.1);
}

.profile-overlay-details {
    position: relative;
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 3;
}

.profile-name-tag {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.profile-title-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--accent-cyan);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.6);
}


/* ==========================================
   DETALLES DE CADA TARJETA
   ========================================== */

/* 1. Tarjeta Hero (Perfil) */

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 18px;
    height: 100%;
    justify-content: center;
}

.hero-manifesto-quote {
    font-family: var(--font-sans);
    font-style: italic;
    font-size: 1.05rem;
    color: var(--text-secondary);
    border-left: 3px solid var(--accent-coral);
    padding-left: 20px;
    margin: 10px 0;
    line-height: 1.6;
    letter-spacing: 0.2px;
}


.hero-content h2 {
    font-size: 2.3rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.5px;
}

.hero-content h2 span {
    background: linear-gradient(135deg, var(--accent-coral), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

.hero-footer {
    display: flex;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    padding: 8px 18px;
    border-radius: 30px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: var(--transition-quick);
}

.social-link:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--accent-coral);
    color: var(--accent-coral);
}

/* 2. Tarjeta Stack de Habilidades (Pilares Técnicos) */
.card-stack h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.stack-categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.stack-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stack-group h4 {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
}

.tech-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tech-chip {
    font-size: 0.78rem;
    padding: 4px 10px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-weight: 500;
    transition: var(--transition-quick);
}

.tech-chip:hover {
    background: rgba(0, 229, 204, 0.06);
    border-color: rgba(0, 229, 204, 0.25);
    color: var(--text-primary);
}

/* 3. Tarjeta de Experiencia Profesional */
.card-experience h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 25px;
}

.experience-nav {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 15px;
    margin-bottom: 25px;
    overflow-x: auto;
}

.xp-nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-sans);
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--transition-quick);
    white-space: nowrap;
}

.xp-nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
}

.xp-nav-btn.active {
    color: var(--accent-coral);
    background: rgba(255, 77, 77, 0.08);
    border: 1px solid rgba(255, 77, 77, 0.18);
}

.xp-tab-content {
    position: relative;
    min-height: 180px;
}

.xp-tab-pane {
    display: none;
    flex-direction: column;
    gap: 15px;
    animation: fadeIn 0.4s ease-out forwards;
}

.xp-tab-pane.active {
    display: flex;
}

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

.xp-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 10px;
}

.xp-title h4 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
}

.xp-title p {
    font-size: 0.9rem;
    color: var(--accent-cyan);
    font-weight: 600;
}

.xp-meta {
    text-align: right;
}

.xp-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.xp-location {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.xp-details {
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

/* ==========================================
   WIDGET DEL AGENTE DE IA (CHAT)
   ========================================== */
.card-chat {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(255, 255, 255, 0.005);
}

.chat-avatar-container {
    position: relative;
}

.chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 10px rgba(255, 77, 77, 0.2);
    display: block;
}

.chat-status-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    background: var(--accent-cyan);
    border: 2px solid var(--bg-main);
    border-radius: 50%;
}

.chat-title-info h3 {
    font-size: 0.9rem;
    font-weight: 600;
}

.chat-title-info p {
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Área de conversación */
.chat-messages {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.chat-bubble {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
    animation: popBubble 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.2) forwards;
}

@keyframes popBubble {
    from { opacity: 0; transform: scale(0.95) translateY(5px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.bubble-agent {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.bubble-user {
    background: linear-gradient(135deg, rgba(255, 77, 77, 0.12) 0%, rgba(0, 229, 204, 0.08) 100%);
    border: 1px solid rgba(255, 77, 77, 0.18);
    color: var(--text-primary);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

/* Burbuja de sugerencias interactivas */
.chat-suggestions {
    padding: 0 20px 12px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.suggestion-chip {
    background: rgba(255, 77, 77, 0.06);
    border: 1px solid rgba(255, 77, 77, 0.15);
    color: var(--accent-coral);
    font-size: 0.75rem;
    font-family: var(--font-sans);
    font-weight: 500;
    padding: 5px 12px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition-quick);
}

.suggestion-chip:hover {
    background: var(--accent-coral);
    color: var(--text-primary);
    border-color: var(--accent-coral);
}

/* Área de Envío de Mensaje */
.chat-input-area {
    padding: 15px 20px 20px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: rgba(0, 0, 0, 0.2);
}

.chat-input-form {
    display: flex;
    gap: 10px;
}

.chat-text-input {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.88rem;
    transition: var(--transition-quick);
}

.chat-text-input:focus {
    border-color: var(--accent-cyan);
    background: rgba(255, 255, 255, 0.04);
    box-shadow: 0 0 10px rgba(0, 229, 204, 0.12);
}

.chat-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-coral);
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-quick);
    flex-shrink: 0;
}

.chat-send-btn:hover {
    background: hsl(0, 100%, 42%);
    transform: scale(1.03);
}

/* Animación de Pensando del Agente */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 6px;
}

.typing-dot {
    width: 5px;
    height: 5px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: typingBlink 1s infinite alternate;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0% { opacity: 0.3; transform: translateY(0); }
    100% { opacity: 1; transform: translateY(-4px); }
}

/* ==========================================
   FOOTER (SEO & COPY)
   ========================================== */
footer.portfolio-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-wrap: wrap;
    gap: 15px;
}

/* ==========================================
   ESTILOS RESPONSIVOS (MEDIA QUERIES)
   ========================================== */
@media (max-width: 992px) {
    .card-profile {
        grid-column: span 12;
        min-height: 380px;
    }
    .card-hero {
        grid-column: span 12;
    }
    .card-chat {
        grid-column: span 12;
        height: 520px;
    }
    .card-stack {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 30px 15px;
        gap: 20px;
    }
    
    header.portfolio-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .header-nav {
        width: 100%;
        justify-content: space-around;
        padding: 4px;
    }
    
    .status-badge {
        align-self: flex-start;
    }
    
    .hero-content h2 {
        font-size: 1.8rem;
    }
    
    .stack-categories {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    footer.portfolio-footer {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 15px;
    }
}
