/* ============================================
   VARIABLES Y CONFIGURACIÓN GENERAL
   ============================================ */
:root {
    /* Paleta de colores claros y modernos */
    --primary-color: #4A90E2;
    --secondary-color: #7B68EE;
    --accent-color: #50C878;
    --background-color: #F8F9FA;
    --card-background: #FFFFFF;
    --text-color: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --ad-background: #F0F0F0;
    
    /* Espaciados */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Tipografía */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-size-base: 16px;
}

/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 var(--spacing-sm);
}

/* ============================================
   HEADER Y NAVEGACIÓN
   ============================================ */
.header {
    background-color: var(--card-background);
    box-shadow: 0 2px 8px var(--shadow-light);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h2 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

.nav-list {
    display: flex;
    list-style: none;
    gap: var(--spacing-lg);
}

.nav-list a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: var(--spacing-xs) var(--spacing-sm);
}

.nav-list a:hover {
    color: var(--primary-color);
}

/* ============================================
   SECCIÓN DE CONTACTO
   ============================================ */
.contact-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: var(--spacing-lg) 0;
    margin-bottom: var(--spacing-md);
}

.contact-box {
    text-align: center;
}

.contact-box h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.contact-box p {
    margin-bottom: var(--spacing-xs);
}

.contact-email a {
    color: white;
    text-decoration: underline;
    font-weight: 600;
}

.contact-email a:hover {
    opacity: 0.9;
}

/* ============================================
   LAYOUT PRINCIPAL CON ANUNCIOS LATERALES
   ============================================ */
.main-wrapper {
    display: flex;
    gap: var(--spacing-md);
    max-width: 1600px;
    margin: 0 auto;
    padding: var(--spacing-lg) var(--spacing-sm);
}

.main-content {
    flex: 1;
    min-width: 0; /* Permite que el contenido se reduzca correctamente */
}

/* ============================================
   ANUNCIOS - DESKTOP (LATERALES)
   ============================================ */
.ads-left,
.ads-right {
    width: 160px;
    position: sticky;
    top: 100px;
    height: fit-content;
    display: none; /* Oculto por defecto (móvil) */
}

.ad-placeholder {
    background-color: var(--ad-background);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-sm);
    text-align: center;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder p {
    color: var(--text-light);
    font-size: 0.9rem;
    writing-mode: vertical-rl;
    text-orientation: mixed;
}

/* ============================================
   ANUNCIOS - MÓVIL (CENTRADO)
   ============================================ */
.ads-mobile {
    display: block; /* Visible por defecto en móvil */
    margin: var(--spacing-lg) auto;
}

.ad-placeholder-mobile {
    background-color: var(--ad-background);
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: var(--spacing-sm);
    text-align: center;
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-placeholder-mobile p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ============================================
   SECCIÓN HERO
   ============================================ */
.hero {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.hero h1 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
    line-height: 1.3;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* ============================================
   SECCIÓN DE HERRAMIENTAS
   ============================================ */
.tools-section h2 {
    text-align: center;
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: var(--spacing-lg);
}

.tools-grid {
    display: grid;
    grid-template-columns: 1fr; /* 1 columna en móvil */
    gap: var(--spacing-md);
}

/* ============================================
   TARJETAS DE HERRAMIENTAS
   ============================================ */
.tool-card {
    background-color: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow-light);
    transition: all 0.3s ease;
    overflow: hidden;
    height: 100%;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px var(--shadow-medium);
}

.tool-link {
    text-decoration: none;
    color: inherit;
    display: block;
    padding: var(--spacing-lg);
    height: 100%;
}

.tool-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: var(--spacing-md);
}

.tool-title {
    font-size: 1.3rem;
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
    text-align: center;
}

.tool-description {
    color: var(--text-light);
    font-size: 0.95rem;
    text-align: center;
    line-height: 1.6;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Mostrar descripción al hacer hover */
.tool-card:hover .tool-description {
    opacity: 1;
    max-height: 200px;
    margin-top: var(--spacing-sm);
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background-color: var(--text-color);
    color: white;
    padding: var(--spacing-xl) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
}

.footer-about {
    margin-bottom: var(--spacing-lg);
}

.footer-about h3 {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-md);
}

.footer-about p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.8;
    color: #E0E0E0;
}

.footer-bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-bottom p {
    color: #B0B0B0;
    font-size: 0.9rem;
}

/* ============================================
   RESPONSIVE - TABLET (768px+)
   ============================================ */
@media (min-width: 768px) {
    .tools-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 columnas en tablet */
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
    
    /* Ocultar anuncio móvil en tablet */
    .ads-mobile {
        display: none;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP PEQUEÑO (1024px+)
   ============================================ */
@media (min-width: 1024px) {
    .tools-grid {
        grid-template-columns: repeat(3, 1fr); /* 3 columnas en desktop pequeño */
    }
}

/* ============================================
   RESPONSIVE - DESKTOP GRANDE (1280px+)
   ============================================ */
@media (min-width: 1280px) {
    .tools-grid {
        grid-template-columns: repeat(4, 1fr); /* 4 columnas en desktop grande */
    }
    
    /* Mostrar anuncios laterales solo en desktop grande */
    .ads-left,
    .ads-right {
        display: block;
    }
    
    /* Asegurar que el anuncio móvil esté oculto */
    .ads-mobile {
        display: none;
    }
    
    .hero h1 {
        font-size: 3rem;
    }
}

/* ============================================
   RESPONSIVE - DESKTOP MUY GRANDE (1600px+)
   ============================================ */
@media (min-width: 1600px) {
    .ads-left,
    .ads-right {
        width: 300px; /* Anuncios más grandes en pantallas muy grandes */
    }
}

/* ============================================
   ANIMACIONES Y EFECTOS ADICIONALES
   ============================================ */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tool-card {
    animation: fadeIn 0.5s ease-out;
}

/* Efecto de carga escalonada para las tarjetas */
.tool-card:nth-child(1) { animation-delay: 0.1s; }
.tool-card:nth-child(2) { animation-delay: 0.2s; }
.tool-card:nth-child(3) { animation-delay: 0.3s; }
.tool-card:nth-child(4) { animation-delay: 0.4s; }
.tool-card:nth-child(5) { animation-delay: 0.5s; }
.tool-card:nth-child(6) { animation-delay: 0.6s; }

/* ============================================
   ACCESIBILIDAD
   ============================================ */
/* Focus visible para navegación por teclado */
a:focus,
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Asegurar contraste suficiente */
::selection {
    background-color: var(--primary-color);
    color: white;
}