/*
 * Archivo: mi-portafolio/css/main.css
 * Versión 2.0 - Optimizado y unificado
 */

/* 1. Variables CSS (Temas Claro y Oscuro) */
:root {
    /* Variables para el tema oscuro (por defecto) */
    --bg-color: #0f1724;
    --card-bg: #0b1220;
    --text-color: #e6eef8;
    --muted-color: #94a3b8;
    --accent-color: #7c3aed;
    --accent-2-color: #2563eb;
    --form-bg-opacity: rgba(255, 255, 255, 0.05);
    --border-color: rgba(255, 255, 255, 0.08);
}

/* Variables para el tema claro */
body.light-theme {
    --bg-color: #f1f5f9;
    --card-bg: #e2e8f0;
    --text-color: #0f1724;
    --muted-color: #475569;
    --accent-color: #4f46e5;
    --accent-2-color: #6366f1;
    --form-bg-opacity: rgba(0, 0, 0, 0.05);
    --border-color: rgba(0, 0, 0, 0.08);
}


/* 2. Estilos Globales y Base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    display: flex;
    flex-direction: column;
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* 3. Encabezado (Header) */
header.main-header {
    width: 100%;
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--card-bg); /* Usamos variable */
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color); /* Usamos variable */
    height: 80px;
}

.logo {
    position: relative;
}

.logo img {
    height: auto;
    max-height: 150px;
    max-width: 100%;
    display: block;
    margin-top: 10px; 
    object-fit: contain;
}

.nav a {
    color: var(--muted-color);
    text-decoration: none;
    font-size: 16px;
    padding: 8px 12px;
    transition: color 0.3s ease;
}

.nav a:hover {
    color: var(--text-color);
}

/* Botón de cambio de tema */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--muted-color);
    transition: color 0.3s ease;
}

.theme-toggle:hover {
    color: var(--text-color);
}


/* 4. Sección de Bienvenida (Hero) */
.hero {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 80px 24px;
}

.hero h1 {
    font-size: 3.5rem;
    color: var(--text-color);
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--muted-color);
    max-width: 600px;
}

.hero .btn {
    margin-top: 24px;
    padding: 12px 24px;
    border-radius: 8px;
    background: linear-gradient(90deg, var(--accent-2-color), var(--accent-color));
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s ease;
}

.hero .btn:hover {
    transform: scale(1.05);
}


/* 5. Sección de Proyectos */
#proyectos,
#contacto {
    scroll-margin-top: 100px;
}
.projects-section {
    width: 100%;
    padding: 60px 24px;
    background: var(--bg-color);
}

.projects-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 40px;
    letter-spacing: -1px;
}

.projects-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.project-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    width: 320px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.project-card h3 {
    margin: 0 0 10px;
    font-size: 1.5rem;
    color: var(--accent-color);
}

.project-card p {
    font-size: 0.9rem;
    color: var(--muted-color);
}

/* 6. Sección de Contacto */
.contact-section {
    width: 100%;
    padding: 60px 24px;
    background: var(--card-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-section h2 {
    font-size: 2.5rem;
    margin-bottom: 40px;
}

.contact-form-container {
    width: 100%;
    max-width: 600px;
    margin-bottom: 20px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--form-bg-opacity);
    color: var(--text-color);
    font-size: 1rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: var(--muted-color);
}

.contact-form textarea {
    resize: vertical;
    min-height: 150px;
}

/* Estilo del botón de enviar mensaje */
.contact-form button {
    width: auto;
    padding: 12px 24px;
    border: none;
    background: linear-gradient(90deg, #7b68ee, #6a5acd);
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(123, 104, 238, 0.4);
    transition: all 0.3s ease-in-out;
}

.contact-form button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(123, 104, 238, 0.6);
}

.contact-form button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(123, 104, 238, 0.4);
}

/* 7. Pie de página (Footer) */
footer.main-footer {
    width: 100%;
    text-align: center;
    padding: 24px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 14px;
}

.main-footer .social-icons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

.main-footer .social-icons img {
    transition: transform 0.3s ease;
}

.main-footer .social-icons a:hover img {
    transform: scale(1.2);
}

/* Mensajes de estado (éxito/error) */
.status-message {
    padding: 10px 20px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
}

.status-success {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.status-error {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}