/* Buscador Zito - Estilos Profesionales con Panel Lateral de Previsualización */

:root {
    --primary: #1e293b;
    --primary-light: #334155;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #cbd5e1;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-full: 9999px;
    --font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.header {
    background-color: #ffffff;
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
    transition: all 0.3s ease;
}

.header.home {
    padding: 70px 20px 40px;
    text-align: center;
    border-bottom: none;
    background: transparent;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

.header.compact .logo-container {
    justify-content: flex-start;
    margin-bottom: 16px;
}

.brand-title {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--primary);
    background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header.compact .brand-title {
    font-size: 1.4rem;
}

.brand-slogan {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Formulario de Búsqueda */
.search-form {
    max-width: 680px;
    margin: 0 auto;
    width: 100%;
}

.header.compact .search-form {
    margin: 0;
    max-width: 720px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper input[type="text"] {
    width: 100%;
    padding: 14px 54px 14px 24px;
    font-size: 1.05rem;
    font-family: inherit;
    color: var(--text-main);
    background: #ffffff;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-md);
    outline: none;
    transition: all 0.2s ease;
}

.input-wrapper input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.input-wrapper button[type="submit"] {
    position: absolute;
    right: 6px;
    background: var(--accent);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

.input-wrapper button[type="submit"]:hover {
    background: var(--accent-hover);
    transform: scale(1.04);
}

/* Pestañas de Búsqueda */
.search-tabs {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    border-bottom: 2px solid var(--border-color);
}

.search-tabs .tab {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.search-tabs .tab:hover {
    color: var(--accent);
}

.search-tabs .tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Layout de Búsqueda Dividido (Resultados + Previsualización a la derecha) */
.main-content {
    flex: 1;
    max-width: 1300px;
    width: 100%;
    margin: 0 auto;
    padding: 24px 20px;
}

.search-split-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.results-left-pane {
    flex: 1;
    min-width: 0;
}

/* Panel Lateral Derecho de Previsualización */
.preview-right-pane {
    width: 480px;
    position: sticky;
    top: 24px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    display: none;
    flex-direction: column;
    height: calc(100vh - 120px);
}

.preview-right-pane.active {
    display: flex;
}

.preview-header {
    background: var(--primary);
    color: #ffffff;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.preview-header h3 {
    font-size: 1rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 10px;
}

.preview-close-btn {
    background: rgba(255,255,255,0.2);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-full);
    width: 28px;
    height: 28px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-close-btn:hover {
    background: rgba(255,255,255,0.4);
}

.preview-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    overflow: hidden;
}

.preview-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.preview-card-fallback {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

/* Acciones en Resultados (Previsualizar / Visitar) */
.result-actions {
    display: flex;
    gap: 12px;
    margin-top: 14px;
}

.btn-action-preview {
    background: var(--accent-light);
    color: var(--accent);
    border: 1px solid #bfdbfe;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action-preview:hover {
    background: #dbeafe;
    border-color: var(--accent);
}

.btn-action-visit {
    background: #f1f5f9;
    color: var(--primary);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-action-visit:hover {
    background: #e2e8f0;
    color: var(--accent-hover);
}

/* Result Cards */
.results-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.result-url cite {
    font-style: normal;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.result-title {
    font-size: 1.2rem;
    margin: 6px 0 10px;
    font-weight: 700;
}

.result-title a {
    color: var(--accent);
    text-decoration: none;
}

.result-title a:hover {
    text-decoration: underline;
}

.result-snippet {
    font-size: 0.95rem;
    color: #334155;
    line-height: 1.5;
}

.result-snippet strong {
    color: var(--text-main);
    background: #fef08a;
    padding: 1px 3px;
    border-radius: 3px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-card {
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.form-group { margin-top: 15px; }
.form-group label { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 6px; }
.form-input { width: 100%; padding: 10px 14px; border: 1px solid var(--border-color); border-radius: var(--radius-sm); font-size: 1rem; outline: none; }

/* Footer */
.footer {
    border-top: 1px solid var(--border-color);
    padding: 18px 24px;
    background: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-top: auto;
}

.footer-links a { color: var(--text-muted); text-decoration: none; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }

@media (max-width: 900px) {
    .search-split-container { flex-direction: column; }
    .preview-right-pane { width: 100%; position: fixed; top: 0; left: 0; right: 0; bottom: 0; height: 100vh; z-index: 2000; }
}
