:root {
    --primary-color: #1a365d;
    --primary-light: #2b6cb0;
    --accent-color: #e2e8f0;
    --text-main: #2d3748;
    --text-muted: #718096;
    --bg-main: #f7fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --highlight-bg: #fefcbf;
    --highlight-color: #b7791f;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --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);
    --radius: 8px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header & Search Container */
.search-header {
    background-color: var(--bg-card);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.search-header.compact {
    padding: 1.5rem 2rem;
    display: flex;
    align-items: center;
    gap: 2rem;
    text-align: left;
}

h1 {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    margin-bottom: 0.5rem;
}

.search-header.compact h1 {
    font-size: 1.5rem;
    margin-bottom: 0;
    white-space: nowrap;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.search-header.compact .subtitle {
    display: none;
}

/* Search Form */
.search-form {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    width: 100%;
}

.search-header.compact .search-form {
    margin: 0;
    flex-grow: 1;
}

.search-tip {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 10px;
    font-weight: 500;
    text-align: center;
}

.search-header.compact .search-tip {
    text-align: left;
    margin-top: 5px;
}

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

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-muted);
    width: 20px;
    height: 20px;
}

.search-input {
    width: 100%;
    padding: 1.2rem 1.2rem 1.2rem 3.5rem;
    font-size: 1.1rem;
    color: var(--text-main);
    background-color: var(--bg-main);
    border: 2px solid transparent;
    border-radius: 50px;
    transition: all 0.2s ease;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.04);
}

.search-header.compact .search-input {
    padding: 0.8rem 1.2rem 0.8rem 3rem;
    font-size: 1rem;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-light);
    background-color: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(43, 108, 176, 0.1);
}

.search-button {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-header.compact .search-button {
    padding: 0.5rem 1.2rem;
}

.search-button:hover {
    background-color: var(--primary-light);
}

/* Main Content area */
.main-content {
    max-width: 1000px;
    margin: 0 auto;
    padding: 2rem;
    flex-grow: 1;
    width: 100%;
}

/* Results Formatting */
.results-meta {
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
}

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

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

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
}

.result-title:hover {
    text-decoration: underline;
    color: var(--primary-light);
}

.result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: var(--accent-color);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tag.tag-ley { background-color: #e6fffa; color: #234e52; }
.tag.tag-materia { background-color: #ebf8ff; color: #2a4365; }
.tag.tag-sentido { background-color: #fffaf0; color: #7b341e; }

.result-snippet {
    color: var(--text-main);
    font-size: 0.95rem;
    line-height: 1.7;
    background-color: #f8fafc;
    padding: 1rem;
    border-radius: var(--radius);
    border-left: 3px solid var(--primary-light);
}

.highlight {
    background-color: var(--highlight-bg);
    color: var(--highlight-color);
    font-weight: 600;
    padding: 0 0.2rem;
    border-radius: 2px;
}

/* Botones y Links */
.pdf-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    background: #f0f7ff;
    border-radius: 8px;
    transition: all 0.2s;
}

.pdf-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal and Paywall Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: white;
    width: 90%;
    max-width: 450px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 1.5rem;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 { margin: 0; font-size: 1.25rem; color: var(--text-dark); }

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.modal-body { padding: 2rem; text-align: center; }

.expediente-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--accent-light);
    color: var(--primary-color);
    border-radius: 99px;
    font-weight: 700;
    margin: 1rem 0;
}

.pricing-card {
    background: #f1f5f9;
    padding: 1.5rem;
    border-radius: 12px;
    margin: 1.5rem 0;
    border: 2px solid var(--primary-color);
}

.price { font-size: 2.5rem; font-weight: 800; color: var(--text-dark); }
.price small { font-size: 1rem; color: #64748b; }

.features {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
    text-align: left;
    font-size: 0.9rem;
}

.features li { margin-bottom: 0.5rem; color: #475569; }

.pay-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s;
}

.pay-btn:hover {
    transform: scale(1.02);
    background: #1d4ed8;
}

.payment-simulation .small {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 0.5rem;
}

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

.pdf-link svg {
    width: 16px;
    height: 16px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.empty-state h3 {
    color: var(--text-main);
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}
