/*
Theme Name: Sitio Web Sofisticado
Description: Un tema WordPress sofisticado con chat incorporado y diseño moderno
Version: 2.0
Author: Tu Nombre
*/

/* Variables CSS para fácil personalización */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #f7fafc;
    --white: #ffffff;
    --shadow: 0 10px 25px rgba(0,0,0,0.1);
    --shadow-hover: 0 20px 40px rgba(0,0,0,0.15);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.7;
    color: var(--text-color);
    background: var(--bg-color);
    font-size: 16px;
    overflow-x: hidden;
}

/* Contenedor principal */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header sofisticado */
.site-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.site-header::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 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.site-header .container {
    position: relative;
    z-index: 2;
}

.site-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    letter-spacing: -0.02em;
}

.site-description {
    font-size: 1.2rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Navegación sofisticada */
.main-navigation {
    background: var(--white);
    box-shadow: var(--shadow);
    margin-bottom: 3rem;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.nav-menu {
    list-style: none;
    display: flex;
    justify-content: center;
    padding: 1.5rem 0;
    gap: 2rem;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.nav-menu a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: var(--transition);
    z-index: -1;
}

.nav-menu a:hover::before {
    left: 0;
}

.nav-menu a:hover {
    color: var(--white);
    transform: translateY(-2px);
}

/* Layout principal mejorado */
.content-area {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Contenido principal */
.site-main {
    background: var(--white);
    padding: 3rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.site-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

/* Artículos sofisticados */
.post {
    margin-bottom: 3rem;
    padding-bottom: 3rem;
    border-bottom: 1px solid #e2e8f0;
    position: relative;
}

.post:last-child {
    border-bottom: none;
}

.post-title {
    font-size: 2.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.post-title a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    position: relative;
}

.post-title a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 3px;
    background: var(--gradient-primary);
    transition: var(--transition);
}

.post-title a:hover::after {
    width: 100%;
}

.post-meta {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.post-meta span {
    background: #f1f5f9;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 500;
}

.post-content {
    line-height: 1.8;
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1rem 2rem;
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 600;
    box-shadow: var(--shadow);
}

.read-more:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}

.read-more::after {
    content: '→';
    transition: var(--transition);
}

.read-more:hover::after {
    transform: translateX(4px);
}

/* Sidebar sofisticada */
.sidebar {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.widget {
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.widget:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.widget-title {
    font-size: 1.4rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

/* Footer sofisticado */
.site-footer {
    background: var(--text-color);
    color: var(--white);
    text-align: center;
    padding: 3rem 0;
    margin-top: 4rem;
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--gradient-primary);
}

/* Chat Widget */
.chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 10000;
    font-family: inherit;
}

.chat-toggle {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    color: var(--white);
    font-size: 24px;
    cursor: pointer;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 25px 50px rgba(0,0,0,0.2);
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 350px;
    height: 500px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.chat-container.active {
    display: flex;
    animation: slideUp 0.3s ease-out;
}

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

.chat-header {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.chat-title {
    font-weight: 600;
    font-size: 1.1rem;
}

.chat-close {
    background: none;
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.chat-close:hover {
    background: rgba(255,255,255,0.2);
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    background: #f8fafc;
}

.chat-message {
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.chat-message.user {
    flex-direction: row-reverse;
}

.chat-message-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.chat-message.bot .chat-message-bubble {
    background: var(--white);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.chat-message.user .chat-message-bubble {
    background: var(--gradient-primary);
    color: var(--white);
}

.chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.chat-message.bot .chat-message-avatar {
    background: var(--gradient-accent);
    color: var(--white);
}

.chat-message.user .chat-message-avatar {
    background: #e2e8f0;
    color: var(--text-color);
}

.chat-input-container {
    padding: 1rem;
    background: var(--white);
    border-top: 1px solid #e2e8f0;
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition);
}

.chat-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.chat-send {
    background: var(--gradient-primary);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.chat-send:hover {
    transform: scale(1.05);
}

/* Responsive mejorado */
@media (max-width: 1024px) {
    .content-area {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .site-title {
        font-size: 2.5rem;
    }
    
    .nav-menu {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .site-main {
        padding: 2rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .chat-container {
        width: calc(100vw - 60px);
        right: -15px;
    }
    
    .chat-widget {
        right: 15px;
        bottom: 15px;
    }
}

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

.post {
    animation: fadeInUp 0.6s ease-out;
}

.post:nth-child(2) { animation-delay: 0.1s; }
.post:nth-child(3) { animation-delay: 0.2s; }
.post:nth-child(4) { animation-delay: 0.3s; }

/* Utilidades */
.text-center { text-align: center; }
.mb-2 { margin-bottom: 2rem; }
.mt-2 { margin-top: 2rem; }
.fade-in { animation: fadeInUp 0.6s ease-out; }

/* Scrollbar personalizada */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}
