/* Reset y base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables CSS para modo claro */
:root {
    /* Colores principales */
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-light: #3b82f6;
    
    --secondary-color: #374151;
    --secondary-hover: #4b5563;
    
    --accent-color: #059669;
    --accent-hover: #047857;
    
    /* Colores neutros */
    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;
    --neutral-400: #9ca3af;
    --neutral-500: #6b7280;
    --neutral-600: #4b5563;
    --neutral-700: #374151;
    --neutral-800: #1f2937;
    --neutral-900: #111827;
    
    /* Fondo y texto */
    --dark-bg: #0f172a;
    --light-bg: #ffffff;
    --card-bg: #f8fafc;
    
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-muted: #6b7280;
    --text-light: #9ca3af;
    --white: #ffffff;
    
    /* Colores de estado */
    --success: #059669;
    --warning: #d97706;
    --error: #dc2626;
    --info: #1e40af;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Bordes */
    --border-radius-sm: 0.375rem;
    --border-radius: 0.5rem;
    --border-radius-lg: 0.75rem;
    --border-radius-xl: 1rem;
    
    --border-color: #e5e7eb;
    --border-color-hover: #d1d5db;
    
    /* Transiciones */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
}

/* Variables CSS para modo oscuro */
body.dark-mode {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --primary-light: #3b82f6;
    
    --secondary-color: #374151;
    --secondary-hover: #4b5563;
    
    --accent-color: #34d399;
    --accent-hover: #10b981;
    
    /* Colores neutros invertidos */
    --neutral-50: #1e293b;
    --neutral-100: #334155;
    --neutral-200: #475569;
    --neutral-300: #64748b;
    --neutral-400: #94a3b8;
    --neutral-500: #cbd5e1;
    --neutral-600: #e2e8f0;
    --neutral-700: #f1f5f9;
    --neutral-800: #f8fafc;
    --neutral-900: #ffffff;
    
    /* Fondos oscuros */
    --dark-bg: #0a0f1c;
    --light-bg: #1e293b;
    --card-bg: #0f172a;
    
    /* Textos para modo oscuro */
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --text-light: #64748b;
    --white: #ffffff;
    
    /* Colores de estado */
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #60a5fa;
    
    /* Sombras más intensas para modo oscuro */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6), 0 10px 10px -5px rgba(0, 0, 0, 0.5);
    
    /* Bordes para modo oscuro */
    --border-color: #334155;
    --border-color-hover: #475569;
}

body {
    font-family: 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--light-bg);
    scroll-behavior: smooth;
    transition: background-color var(--transition-normal), color var(--transition-normal);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--light-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all var(--transition-normal);
    opacity: 0.98;
}

.nav-container {
    max-width: 100%;
    background-color: var(--light-bg);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.logo:hover {
    color: var(--primary-color);
}

.logo-img {
    width: 40px;
    height: auto;
}

.logo-text {
    font-family: 'Segoe UI', sans-serif;
    white-space: nowrap;
}

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

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 500;
    transition: color var(--transition-fast);
    position: relative;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width var(--transition-fast);
}

.nav-links a:hover::after {
    width: 100%;
}

.mobile-menu {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: color var(--transition-fast);
}

.mobile-menu:hover {
    color: var(--primary-color);
}

/* Botón de cambio de tema */
.toggle-theme-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    transition: all var(--transition-fast);
    margin-left: 1rem;
    padding: 0.5rem;
    border-radius: var(--border-radius);
}

.toggle-theme-btn:hover {
    color: var(--primary-color);
    background-color: var(--neutral-100);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><polygon fill="%23ffffff08" points="0,0 1000,300 1000,1000 0,700"/></svg>');
    background-size: cover;
}

.hero-content {
    max-width: 800px;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--white);
}

.hero .subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

.hero .description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: var(--white);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: var(--border-radius-xl);
    font-weight: 600;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-md);
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--neutral-50);
}

.contact-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  justify-content: center;
}

.contact-links a {
  color: var(--white);
  transition: transform 0.2s, color 0.3s;
}

.contact-links a:hover {
  transform: scale(1.2);
  color: var(--text-light);
}

.contact-links svg {
  width: 24px;
  height: 24px;
}


/* Sections */
.section {
    padding: 5rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-primary);
    position: relative;
    font-weight: 700;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: var(--primary-color);
    border-radius: var(--border-radius-sm);
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: var(--card-bg);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 1px solid var(--border-color);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

.project-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: var(--border-radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    box-shadow: var(--shadow-sm);
}

.project-card h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-weight: 600;
}

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.project-button {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--border-radius-xl);
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.project-button[disabled] {
    opacity: 0.6;
    cursor: wait;
}

.project-button:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* About Section */
.about {
    background: var(--card-bg);
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-text {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-secondary);
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.tech-tag {
    display: flex; /* Asegura alineación horizontal */
    align-items: center; /* Centra verticalmente el ícono con el texto */
    background: var(--primary-color);
    color: var(--white);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-xl);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.tech-tag:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.tech-tag svg {
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    fill: currentColor;
    flex-shrink: 0; /* Previene que se deforme el ícono si el texto es muy largo */
}

/* Sin texto
.tech-tag {
    padding: 0.5rem;
    justify-content: center;
}*/

.about-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.profile-placeholder {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    font-size: 4rem;
    font-weight: bold;
    box-shadow: var(--shadow-lg);
}

/* Contact Section */

.contact-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
  background-color: var(--card-bg);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.contact-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.contact-icon svg {
  width: 32px;
  height: 32px;
}

.contact-icon {
  color: var(--text-primary, #1e1e1e);
  transition: transform 0.2s, color 0.3s;
}

.contact-text h4 {
  margin: 0;
  font-size: 1rem;
  font-weight: bold;
}

.contact-text p {
  margin: 0;
  font-size: 0.9rem;
  word-break: break-all;
  color: var(--text-primary);
}

.contact-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.contact-btn {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 0.4rem 0.6rem;
  font-size: 1rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

.cta-button:hover {
  border: 1px solid var(--primary-color);
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: var(--white);
    text-align: center;
    padding: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--white);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: var(--primary-color);
}

.footer p {
    color: var(--white);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--light-bg);
        flex-direction: column;
        padding: 1rem;
        box-shadow: var(--shadow-lg);
        border-radius: 0 0 var(--border-radius) var(--border-radius);
        border: 1px solid var(--border-color);
        border-top: none;
    }

    .nav-links.active {
        display: flex;
    }

    .mobile-menu {
        display: block;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero .subtitle {
        font-size: 1.1rem;
    }

    .about-content,
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .profile-placeholder {
        width: 200px;
        height: 200px;
        font-size: 3rem;
    }

    .section {
        padding: 3rem 1rem;
    }

    .nav-container {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

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

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}
