/* =========================================
   1. VARIABLES Y RESET
   ========================================= */
:root {
    --space-dark: #070710;
    --bg-card: rgba(20, 20, 35, 0.6);
    --starlight: #e2e8f0;
    --laser-cyan: #00e5ff;
    --laser-pink: #ff00ea;
    --font-main: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --border-color: rgba(0, 229, 255, 0.15);
}

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

body {
    background-color: var(--space-dark);
    color: var(--starlight);
    font-family: var(--font-main);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow-x: hidden;
}

main {
    flex: 1;
    padding-top: 120px; 
    padding-bottom: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 80px;
    background: rgba(7, 7, 16, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.logo-container { text-decoration: none; }
.logo { font-size: 1.5rem; font-weight: 800; color: white; letter-spacing: -0.5px; }
.logo span { color: var(--laser-cyan); }

.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
    text-decoration: none;
    color: #94a3b8;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
}
.nav-links a:hover, .nav-links a.active {
    color: var(--laser-cyan);
    text-shadow: 0 0 15px rgba(0, 229, 255, 0.4);
}

/* =========================================
   3. ESTRUCTURA BASE (TARJETAS)
   ========================================= */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, border-color 0.3s ease;
}
.card:hover { 
    border-color: rgba(0, 229, 255, 0.4); 
    transform: translateY(-3px); 
}

/* =========================================
   4. PÁGINA: SOBRE MÍ
   ========================================= */
.about-page { 
    width: 90%; 
    max-width: 1100px; 
    margin: 0 auto;
}

.about-grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}

.bio-card, .terminal-card { grid-column: span 2; }

/* Estilo Terminal */
.terminal-card { padding: 0; background: #0b0f19; border: 1px solid #1e293b; overflow: hidden; }
.terminal-header { background: #1e293b; padding: 12px 20px; display: flex; align-items: center; }
.dots span { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 8px; }
.r { background: #ff5f56; } .y { background: #ffbd2e; } .g { background: #27c93f; }
.t-title { color: #94a3b8; font-size: 0.85rem; margin-left: 10px; font-family: monospace; }
.terminal-content { padding: 2rem; font-family: 'Consolas', monospace; font-size: 0.95rem; }
.p { color: var(--laser-cyan); font-weight: bold; margin-right: 8px; }
.cmd { color: #fef08a; }
.res { color: #cbd5e1; margin: 10px 0 20px 22px; }

/* Timeline y Metas */
.timeline .item { border-left: 2px solid var(--laser-pink); padding-left: 20px; margin-bottom: 20px; margin-top: 15px;}
.date { color: var(--laser-pink); font-size: 0.85rem; font-weight: bold; display: block; margin-bottom: 5px; }
.goals-list { list-style: none; margin-top: 15px; }
.goals-list li { margin-bottom: 12px; display: flex; gap: 10px; color: #cbd5e1; }
.check { color: var(--laser-cyan); }
.cyan { color: var(--laser-cyan); }
.pink { color: var(--laser-pink); }

/* Etiquetas de Stack */
.skills-flex { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 1.5rem; }
.big-tag {
    background: rgba(0, 229, 255, 0.05);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--laser-cyan);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: default;
}
.big-tag:hover { background: var(--laser-cyan); color: var(--space-dark); transform: scale(1.05); }

/* =========================================
   5. PÁGINA: PROYECTOS (TARJETAS GITHUB)
   ========================================= */
.projects-page { width: 90%; max-width: 1100px; margin: 0 auto; }
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; }

.repo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.repo-card:hover { transform: translateY(-5px); border-color: var(--laser-cyan); }

.repo-header { display: flex; align-items: center; gap: 12px; margin-bottom: 1rem; }
.repo-title { color: var(--starlight); font-size: 1.3rem; font-weight: 700; word-break: break-all; }
.repo-desc { color: #94a3b8; font-size: 0.95rem; line-height: 1.6; flex-grow: 1; margin-bottom: 2rem; }

.repo-bottom { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1.2rem; }
.repo-info { display: flex; align-items: center; gap: 15px; }
.repo-lang { background: rgba(0, 229, 255, 0.1); color: var(--laser-cyan); padding: 4px 10px; border-radius: 6px; font-family: monospace; font-size: 0.85rem; }
.repo-stars { color: #cbd5e1; font-size: 0.9rem; }

.repo-actions { display: flex; gap: 10px; align-items: center; }
.btn-repo { background: transparent; color: var(--starlight); border: 1px solid #334155; padding: 8px 16px; border-radius: 8px; cursor: pointer; text-decoration: none; font-size: 0.9rem; font-weight: bold; transition: 0.3s; }
.btn-repo:hover { background: var(--laser-cyan); color: var(--space-dark); border-color: var(--laser-cyan); }
.btn-icon { text-decoration: none; background: rgba(255,255,255,0.05); padding: 8px 10px; border-radius: 8px; transition: 0.3s; }
.btn-icon:hover { background: rgba(0, 229, 255, 0.2); }

.loading-state { grid-column: 1 / -1; text-align: center; color: var(--laser-cyan); font-family: monospace; padding: 4rem; font-size: 1.2rem; }

/* =========================================
   6. PÁGINA: DETALLE DE PROYECTO (MINI-GITHUB)
   ========================================= */
.repo-detail-page { width: 90%; max-width: 900px; margin: 0 auto; }
.breadcrumb { margin-bottom: 2rem; }
.breadcrumb a { color: var(--laser-cyan); text-decoration: none; font-weight: bold; display: inline-block; transition: transform 0.3s ease; }
.breadcrumb a:hover { transform: translateX(-5px); }

.repo-detail-header { margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.repo-detail-header h1 { font-size: 2.5rem; color: var(--starlight); }

.markdown-container { padding: 0; overflow: hidden; }
.markdown-header { background: rgba(0,0,0,0.4); padding: 15px 20px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; color: #94a3b8; font-family: monospace; }

/* Estilos consolidados para el texto de GitHub (Markdown) */
.markdown-body { padding: 30px; overflow-y: auto; color: #cbd5e1; font-size: 1rem; line-height: 1.7; }
.markdown-body::-webkit-scrollbar { width: 8px; }
.markdown-body::-webkit-scrollbar-track { background: #0f172a; }
.markdown-body::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: var(--starlight); border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 8px; margin: 24px 0 16px; }
.markdown-body h1 { color: var(--laser-cyan); }
.markdown-body a { color: var(--laser-cyan); text-decoration: none; }
.markdown-body img { max-width: 100%; border-radius: 8px; margin: 15px 0;}
.markdown-body pre { background: #05050a; border: 1px solid rgba(255,255,255,0.1); padding: 16px; border-radius: 8px; overflow-x: auto; margin-bottom: 16px; }
.markdown-body code { background: rgba(255,255,255,0.1); padding: 2px 5px; border-radius: 4px; font-family: 'Consolas', monospace; color: #fef08a; }
.markdown-body pre code { background: none; padding: 0; color: #a0aab8; }
.markdown-body blockquote { border-left: 4px solid var(--laser-cyan); padding-left: 15px; color: #94a3b8; margin: 15px 0; }

/* =========================================
   7. PÁGINA: CONTACTO
   ========================================= */
.contact-section { width: 100%; display: flex; justify-content: center; }
.contact-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 3rem;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

.contact-form { display: flex; flex-direction: column; gap: 1.5rem; margin-top: 2rem;}
.form-group label { font-size: 0.9rem; color: #94a3b8; margin-bottom: 5px; display: block;}
.form-group input, .form-group textarea {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid #334155;
    padding: 14px;
    color: white;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: 0.3s;
}
.form-group input:focus, .form-group textarea:focus { border-color: var(--laser-cyan); outline: none; }

.btn-primary {
    background: var(--laser-cyan);
    color: var(--space-dark);
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.3s;
}
.btn-primary:hover { background: #00bccc; transform: translateY(-2px); }

/* =========================================
   8. FOOTER
   ========================================= */
.footer {
    background: #05050a;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 3rem 5% 1.5rem;
    margin-top: auto;
}
.footer-content { display: flex; justify-content: space-between; align-items: center; max-width: 1100px; margin: 0 auto 2rem; }
.footer-logo { font-size: 1.2rem; font-weight: bold; }
.footer-logo span { color: var(--laser-cyan); }
.footer-info p { color: #64748b; font-size: 0.9rem; margin-top: 5px; }
.footer-social { display: flex; gap: 1.5rem; }
.footer-social a { color: #94a3b8; text-decoration: none; font-weight: 500; transition: 0.3s; }
.footer-social a:hover { color: var(--laser-cyan); }
.footer-bottom { text-align: center; color: #475569; font-size: 0.85rem; border-top: 1px solid rgba(255,255,255,0.05); padding-top: 1.5rem; }

/* =========================================
   9. RESPONSIVE (MÓVILES)
   ========================================= */
@media (max-width: 768px) {
    main { padding-top: 140px; } 
    .navbar { flex-direction: column; height: auto; padding: 15px; }
    .nav-links { gap: 1rem; margin-top: 10px; flex-wrap: wrap; justify-content: center; }
    
    .about-grid-container { grid-template-columns: 1fr; }
    .bio-card, .terminal-card { grid-column: span 1; }
    
    .contact-container { padding: 2rem; }
    .footer-content { flex-direction: column; gap: 1.5rem; text-align: center; }
}