/* Reset y configuraciones básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

html {
    scroll-behavior: smooth;
}

/* Variables CSS */
:root {
    --primary-color: #ff6b35;
    --secondary-color: #f7931e;
    --accent-color: #4285f4;
    --text-dark: #1a202c;
    --text-light: #64748b;
    --bg-white: #ffffff;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 0;
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.version {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    margin-left: 0.5rem;
}

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

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-menu a:hover {
    opacity: 0.8;
}

/* Main content */
.main-content {
    margin-top: 80px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.hero-description {
    font-size: 1.125rem;
    max-width: 800px;
    margin: 0 auto 3rem;
    opacity: 0.9;
    line-height: 1.8;
}

.hero-features {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    font-size: 2rem;
}

/* Sections */
.section {
    padding: 4rem 0;
}

.section:nth-child(even) {
    background-color: var(--bg-white);
}

.section h2 {
    font-size: 2.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

.section h3 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin: 2rem 0 1rem 0;
    font-weight: 600;
}

.section p {
    font-size: 1.125rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

/* Code blocks */
.code-block {
    margin: 2rem 0;
    background: var(--bg-white);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-block h3 {
    background: #f1f5f9;
    padding: 1rem;
    margin: 0;
    font-size: 1rem;
    color: var(--text-dark);
    border-bottom: 1px solid var(--border-color);
}

.code-block pre {
    padding: 1.5rem;
    overflow-x: auto;
    background: #1e293b;
    margin: 0;
}

.code-block code {
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.6;
}

/* Inline code */
code {
    background: #f1f5f9;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    color: var(--accent-color);
}

/* Lists */
.hooks-list {
    list-style: none;
    margin: 1.5rem 0;
}

.hooks-list li {
    background: var(--bg-white);
    padding: 1rem;
    margin: 0.5rem 0;
    border-radius: 0.5rem;
    border-left: 4px solid var(--primary-color);
    box-shadow: var(--shadow);
}

.hooks-list code {
    font-weight: 600;
    color: var(--primary-color);
}

/* Notes */
.note {
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    border: 1px solid #93c5fd;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 2rem 0;
}

.note p {
    margin: 0;
    color: #1e40af;
}

/* Tips */
.tips {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tip {
    background: var(--bg-white);
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    border-top: 4px solid var(--primary-color);
}

.tip h4 {
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 1.125rem;
}

.tip p {
    margin: 0;
    color: var(--text-light);
    font-size: 1rem;
}

/* Links */
.links {
    list-style: none;
    margin: 2rem 0;
}

.links li {
    margin: 0.5rem 0;
}

.links a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Buttons en ejemplos */
button {
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 1rem;
}

button:hover {
    background: #e55a2b;
}

/* Inputs en ejemplos */
input, textarea {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: 1rem;
    width: 100%;
    margin: 0.5rem 0;
}

/* Chat y tareas ejemplos */
.chat-app, .app-tareas {
    background: var(--bg-white);
    border-radius: 0.5rem;
    padding: 2rem;
    box-shadow: var(--shadow);
    margin: 2rem 0;
}

.lista-mensajes {
    height: 300px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 1rem 0;
    background: #f8fafc;
}

.mensaje {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: white;
    border-radius: 0.25rem;
    border-left: 3px solid var(--primary-color);
}

.formulario-mensaje {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.formulario-mensaje input {
    flex: 1;
    margin: 0;
}

.lista-tareas {
    margin: 1rem 0;
}

.tarea {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.375rem;
    margin: 0.5rem 0;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.tarea.completada {
    opacity: 0.6;
    border-left-color: #10b981;
}

.tarea.completada span {
    text-decoration: line-through;
}

.tarea input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.tarea small {
    color: var(--text-light);
    margin-left: auto;
}

.tarea button {
    background: #dc2626;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

.tarea button:hover {
    background: #b91c1c;
}

/* Barra de progreso */
.barra-progreso {
    width: 100%;
    height: 8px;
    background: #f1f5f9;
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progreso {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transition: width 0.3s ease;
}

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

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
        padding: 0 1rem;
    }

    .nav-menu {
        gap: 1rem;
        flex-wrap: wrap;
        justify-content: center;
    }

    .container {
        padding: 0 1rem;
    }

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

    .hero-features {
        gap: 1.5rem;
    }

    .section h2 {
        font-size: 2rem;
    }

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

    .formulario-mensaje {
        flex-direction: column;
    }

    .tarea {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .code-block pre {
        padding: 1rem;
        font-size: 0.75rem;
    }
}

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

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

    .section h2 {
        font-size: 1.75rem;
    }

    .section h3 {
        font-size: 1.25rem;
    }
}

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

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

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

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #e55a2b;
}

/* Estilos para ejemplos avanzados */
.search-input-container {
    position: relative;
    margin: 1rem 0;
}

.search-input {
    padding-right: 3rem !important;
}

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

.searching {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: var(--text-light);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-light);
}

.no-results p:first-child {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.resultados p {
    color: var(--text-light);
    margin: 1rem 0;
    font-style: italic;
}

.productos-grid, .publicaciones-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.producto-card, .publicacion-card {
    background: var(--bg-white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.producto-card:hover, .publicacion-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.producto-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.producto-card h4, .publicacion-card h4 {
    margin: 0 0 0.5rem 0;
    color: var(--text-dark);
}

.producto-card .precio {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.producto-card .descripcion {
    color: var(--text-light);
    font-size: 0.875rem;
    margin: 0;
}

.load-more-btn {
    display: block;
    margin: 2rem auto;
    padding: 1rem 2rem;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.load-more-btn:hover:not(:disabled) {
    background: #3367d6;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.no-more-data {
    text-align: center;
    color: var(--text-light);
    font-style: italic;
    margin: 2rem 0;
}

/* Estilos para estado de conexión */
.connection-status {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.connection-status.online {
    background: rgba(16, 185, 129, 0.1);
    color: #047857;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.connection-status.offline {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.nueva-nota-form {
    margin-bottom: 2rem;
}

.nueva-nota-form textarea {
    resize: vertical;
    min-height: 100px;
}

.notas-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.nota-item {
    background: var(--bg-white);
    border-radius: 0.5rem;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--primary-color);
}

.nota-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.no-sync {
    background: rgba(251, 191, 36, 0.1);
    color: #d97706;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Dashboard optimizado */
.dashboard {
    max-width: 1200px;
    margin: 0 auto;
}

.resumen-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.tarjeta-resumen {
    background: var(--bg-white);
    padding: 2rem;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-top: 4px solid var(--primary-color);
}

.tarjeta-resumen h4 {
    color: var(--text-light);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 0.5rem 0;
}

.tarjeta-resumen .valor {
    color: var(--text-dark);
    font-size: 2rem;
    font-weight: 700;
    margin: 0;
}

.grafica-section, .tabla-section {
    margin: 3rem 0;
}

.placeholder {
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    border: 2px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-light);
}

.placeholder p {
    font-size: 1.125rem;
    margin: 0;
}

/* Responsive para ejemplos avanzados */
@media (max-width: 768px) {
    .productos-grid, .publicaciones-grid {
        grid-template-columns: 1fr;
    }
    
    .app-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .nota-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .resumen-cards {
        grid-template-columns: 1fr;
    }
}

/* Syntax highlighting override para mejor contraste */
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #8b949e;
}

.token.punctuation {
    color: #f8f8f2;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #ff79c6;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #50fa7b;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #ff79c6;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #8be9fd;
}

.token.function,
.token.class-name {
    color: #ffb86c;
}

.token.regex,
.token.important,
.token.variable {
    color: #ff79c6;
}
