/* ==========================================================================
   SISTEMA DE DISEÑO & ESTILOS DEL PORTAFOLIO DE JUAN DAVID (ADSO - SENA)
   Soporte completo para Modo Oscuro y Modo Claro con animaciones fluídas
   ========================================================================== */

/* Variables del tema Oscuro (Predeterminado) */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.75);
    --bg-card-hover: rgba(31, 41, 55, 0.85);
    --bg-glass: rgba(15, 23, 42, 0.65);
    --border-color: rgba(255, 255, 255, 0.1);
    --border-hover: rgba(56, 189, 248, 0.4);
    
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --text-dim: #6b7280;

    --accent-blue: #38bdf8;
    --accent-purple: #8b5cf6;
    --accent-cyan: #06b6d4;
    --accent-gradient: linear-gradient(135deg, #38bdf8 0%, #8b5cf6 100%);
    --gradient-glow: radial-gradient(circle, rgba(56, 189, 248, 0.15) 0%, rgba(0, 0, 0, 0) 70%);

    --badge-bg: rgba(56, 189, 248, 0.12);
    --badge-text: #38bdf8;
    --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 25px rgba(56, 189, 248, 0.25);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 24px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Variables del tema Claro */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.85);
    --bg-card-hover: rgba(241, 245, 249, 0.95);
    --bg-glass: rgba(255, 255, 255, 0.75);
    --border-color: rgba(0, 0, 0, 0.08);
    --border-hover: rgba(2, 132, 199, 0.4);
    
    --text-main: #0f172a;
    --text-muted: #475569;
    --text-dim: #64748b;

    --accent-blue: #0284c7;
    --accent-purple: #7c3aed;
    --accent-cyan: #0891b2;
    --accent-gradient: linear-gradient(135deg, #0284c7 0%, #7c3aed 100%);
    --gradient-glow: radial-gradient(circle, rgba(2, 132, 199, 0.12) 0%, rgba(255, 255, 255, 0) 70%);

    --badge-bg: rgba(2, 132, 199, 0.1);
    --badge-text: #0284c7;
    --shadow-card: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
    --shadow-glow: 0 0 20px rgba(2, 132, 199, 0.18);
}

/* Reset y Bases */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* Tipografía */
h1, h2, h3, h4 {
    color: var(--text-main);
    font-weight: 700;
    line-height: 1.2;
}

p {
    color: var(--text-muted);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Efecto Texto Gradiente */
.gradient-text {
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header & Barra de Navegación */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

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

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.25rem;
    font-weight: 800;
}

.logo-badge {
    background: var(--accent-gradient);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
}

.nav-link {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-blue);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Botón Conmutador Tema Oscuro / Claro */
.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.2rem;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-blue);
    transform: rotate(15deg) scale(1.05);
    box-shadow: var(--shadow-glow);
}

/* Botón Hamburguesa Móvil */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero-section {
    padding: 160px 0 100px;
    position: relative;
    overflow: hidden;
}

.hero-bg-glow {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    height: 600px;
    background: var(--gradient-glow);
    pointer-events: none;
    z-index: -1;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--radius-full);
    background: var(--badge-bg);
    color: var(--badge-text);
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid rgba(56, 189, 248, 0.2);
    margin-bottom: 1.5rem;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.4); opacity: 0.6; }
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--accent-blue);
    font-weight: 600;
    margin-bottom: 1.25rem;
}

.hero-bio {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 580px;
}

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

/* Botones principales */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.85rem 1.75rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 4px 20px rgba(56, 189, 248, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.45);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
    background: var(--bg-card-hover);
    transform: translateY(-2px);
}

/* Tarjeta de foto de perfil */
.hero-image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
}

.code-terminal-card {
    position: relative;
    width: 100%;
    max-width: 380px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background: #0d1117;
    box-shadow: var(--shadow-card);
    transition: var(--transition);
    font-family: 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

.code-terminal-card:hover {
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-glow);
    transform: translateY(-5px);
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: #161b22;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.terminal-buttons {
    display: flex;
    gap: 0.45rem;
}

.terminal-buttons .dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.terminal-buttons .dot.red { background-color: #ff5f56; }
.terminal-buttons .dot.yellow { background-color: #ffbd2e; }
.terminal-buttons .dot.green { background-color: #27c93f; }

.terminal-title {
    font-size: 0.8rem;
    color: #8b949e;
    font-family: var(--font-main);
    font-weight: 600;
}

.terminal-body {
    padding: 1.25rem 1.4rem;
    font-size: 0.88rem;
    line-height: 1.7;
    color: #c9d1d9;
    overflow-x: auto;
}

.terminal-body pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-keyword { color: #ff7b72; font-weight: 600; }
.code-variable { color: #79c0ff; }
.code-property { color: #d2a8ff; }
.code-string { color: #a5d6ff; }

.profile-glow {
    position: absolute;
    inset: -10px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    z-index: -1;
    opacity: 0.3;
    filter: blur(20px);
}

/* Secciones Generales */
.section {
    padding: 100px 0;
}

.section-header {
    text-align: center;
    max-width: 650px;
    margin: 0 auto 4rem;
}

.section-tag {
    font-size: 0.85rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    display: block;
}

.section-title {
    font-size: 2.4rem;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.05rem;
}

/* Educación SENA & Experiencia */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.timeline-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    margin-bottom: 1.5rem;
}

.timeline-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.timeline-badge {
    background: var(--badge-bg);
    color: var(--badge-text);
    padding: 0.3rem 0.8rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
}

.timeline-title {
    font-size: 1.25rem;
    margin-bottom: 0.3rem;
}

.timeline-institution {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.timeline-list {
    list-style: none;
    margin-top: 1rem;
}

.timeline-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

.timeline-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--accent-blue);
    font-weight: 800;
}

/* Stack Tecnológico Grid */
.stack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.5rem;
}

.tech-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
}

.tech-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-6px);
    box-shadow: var(--shadow-glow);
    background: var(--bg-card-hover);
}

.tech-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    transition: var(--transition);
}

.tech-card:hover .tech-icon {
    transform: scale(1.15);
}

.tech-name {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.tech-level {
    font-size: 0.8rem;
    color: var(--text-dim);
    font-weight: 600;
}

/* Proyectos Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.2rem;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

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

.project-image-container {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--bg-secondary);
}

.project-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.project-card:hover .project-img {
    transform: scale(1.06);
}

.project-category-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 0.3rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.project-body {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.project-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    flex-grow: 1;
}

/* Badges del stack usado en proyectos */
.project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.stack-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 0.3rem 0.7rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-main);
}

.project-links {
    display: flex;
    gap: 1rem;
}

.project-link {
    flex: 1;
    text-align: center;
    padding: 0.65rem;
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    transition: var(--transition);
}

.link-git {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

.link-git:hover {
    border-color: var(--text-main);
    background: var(--bg-card-hover);
}

.link-demo {
    background: var(--accent-gradient);
    color: #fff;
}

.link-demo:hover {
    opacity: 0.9;
    box-shadow: 0 4px 15px rgba(56, 189, 248, 0.3);
}

/* Sección Fortalezas Reclutador */
.strengths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

.strength-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    transition: var(--transition);
}

.strength-card:hover {
    border-color: var(--accent-blue);
    transform: translateY(-4px);
}

.strength-icon {
    font-size: 1.8rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

.strength-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

/* Sección Contacto */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.contact-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.contact-icon-box {
    width: 48px;
    height: 48px;
    background: var(--badge-bg);
    color: var(--badge-text);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.contact-label {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 700;
}

.contact-val {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
}

/* Formulario Contacto */
.contact-form {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2.2rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.88rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
    color: var(--text-main);
}

.form-input, .form-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-input:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    background: var(--bg-secondary);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1.2rem;
    margin-bottom: 1.5rem;
}

.social-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
    transition: var(--transition);
}

.social-btn:hover {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
    transform: translateY(-3px);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .hero-grid, .about-grid, .contact-grid {
        grid-template-columns: 1fr;
    }

    .hero-section {
        padding: 130px 0 60px;
        text-align: center;
    }

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

    .hero-bio {
        margin: 0 auto 2rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .profile-card {
        margin: 2rem auto 0;
        width: 280px;
        height: 340px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .mobile-menu-btn {
        display: block;
    }

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

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