/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================================================== */
:root {
    --spacing-unit: 1rem;
    --header-bg: #1e2d2d;
    --main-bg: #263a3a;
    --nav-bg: #2c4444;
    --text-color: #e0e0e0;
    --accent-color: #4db6ac;
    --accent-hover: #80cbc4;
    --dark-text: #0d1b1b;
    --card-bg: #2e4747;
    --transition-speed: 0.4s;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #1a1a1a;
    color: var(--text-color);
    line-height: 1.6;
}

/* ==========================================================================
   2. ESTRUCTURA Y CONTENEDORES PRINCIPALES
   ========================================================================== */
.container {
    max-width: 1000px;
    margin: 2rem auto;
    background: var(--main-bg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-radius: 8px;
    overflow: hidden;
}

#hero-section {
    padding: 2rem;
    min-height: 400px;
}

/* ==========================================================================
   3. CABECERA (HEADER & AVATAR)
   ========================================================================== */
.main-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-unit);
    padding: calc(var(--spacing-unit) * 2);
    background: var(--header-bg);
}

.avatar-container {
    width: 100px;
    height: 100px;
    overflow: hidden;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.1);
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-text h1 {
    font-size: 1.8rem;
    color: var(--accent-color);
}

.header-text .subtitle {
    font-size: 1rem;
    opacity: 0.8;
}

/* ==========================================================================
   4. NAVEGACIÓN (NAVBAR)
   ========================================================================== */
.main-nav {
    background: var(--nav-bg);
    padding: 0 2rem;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 1rem 0;
    display: inline-block;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
}

/* ==========================================================================
   5. COMPONENTES REUTILIZABLES (TARJETAS & ELEMENTOS)
   ========================================================================== */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.card h3 {
    margin-bottom: 0.5rem;
    color: var(--accent-color);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.tag {
    background: rgba(77, 182, 172, 0.1);
    color: var(--accent-color);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    border: 1px solid var(--accent-color);
}

/* ==========================================================================
   6. VISTAS ESPECÍFICAS (INICIO, PROYECTOS)
   ========================================================================== */
/* Vista de Inicio / Bienvenida */
.welcome-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.description-text {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    border-left: 2px solid var(--accent-color);
    padding-left: 1.5rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

.info-item h4 {
    color: var(--accent-color);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
}

.info-item ul {
    list-style: none;
}

.info-item li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

/* Vista de Proyectos */
.project-card {
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   7. BOTONES Y ENLACES DE CONTACTO / INTERACCIÓN
   ========================================================================== */
.btn-contact {
    display: inline-block;
    margin-top: 12px;
    padding: 12px 24px;
    background-color: var(--accent-color);
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: opacity 0.2s ease, transform 0.1s ease;
    font-family: inherit;
}

.btn-contact:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-link {
    text-decoration: none;
    color: var(--accent-color);
    font-weight: bold;
    font-size: 0.9rem;
    border-bottom: 1px solid transparent;
    transition: border 0.3s;
}

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

.inline-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.inline-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

/* ==========================================================================
   8. PIE DE PÁGINA (FOOTER)
   ========================================================================== */
footer {
    padding: 1.5rem 2rem;
    background: var(--header-bg);
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.7;
}

#full-date {
    color: var(--accent-color);
    font-weight: bold;
}

/* ==========================================================================
   9. ANIMACIONES (TRANSICIONES DINÁMICAS)
   ========================================================================== */
.fade-in {
    animation: fadeIn var(--transition-speed) ease-in-out;
}

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

/* ==========================================================================
   10. RESPONSIVE DESIGN (MEDIA QUERIES)
   ========================================================================== */
@media (max-width: 768px) {
    .container {
        margin: 0;
        border-radius: 0;
    }

    .main-header {
        flex-direction: column;
        text-align: center;
    }

    .main-nav ul {
        justify-content: center;
    }
}