:root {
    /* Tema Claro (Por defecto) */
    --primary: #004b99;
    --primary-light: #e6f0fa;
    --text-main: #2d3748;
    --text-muted: #718096;
    --border-color: #e2e8f0;
    --bg-body: #ffffff;
    --bg-card: #fafbfc;
    --highlight: #edf2f7;
    --bg-search: #ffffff;
}

/* Tema Oscuro Automático */
@media (prefers-color-scheme: dark) {
    :root {
        --primary: #63b3ed;
        --primary-light: rgba(99, 179, 237, 0.2);
        --text-main: #f7fafc;
        --text-muted: #9ca3af;
        --border-color: #2e303a;
        --bg-body: #16171d;
        --bg-card: #1f2028;
        --highlight: #2e303a;
        --bg-search: #1f2028;
    }
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding: 20px 20px 60px 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 850px;
    margin: 0 auto;
    flex: 1;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--border-color);
}

h1 {
    color: var(--primary);
    font-size: 2.2rem;
    margin-bottom: 8px;
    font-weight: 700;
}

header p {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 25px;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-box {
    width: 100%;
    padding: 14px 20px 14px 45px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    outline: none;
    background-color: var(--bg-search);
    color: var(--text-main);
    transition: all 0.2s ease;
}

.search-box::placeholder {
    color: var(--text-muted);
}

.search-box:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

.area-section {
    margin-bottom: 50px;
}

.area-title {
    color: var(--primary);
    font-size: 1.6rem;
    font-weight: 700;
    border-bottom: 3px solid var(--primary);
    padding-bottom: 8px;
    margin-bottom: 25px;
}

.subarea-section {
    margin-bottom: 35px;
    padding-left: 15px;
}

.subarea-title {
    font-size: 1.25rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.subarea-title::before {
    content: "";
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: var(--primary);
    border-radius: 50%;
    margin-right: 12px;
}

.temas-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 2px solid var(--border-color);
    margin-left: 3px;
    padding-left: 20px;
}

.tema-item {
    padding: 12px 16px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.tema-title {
    font-weight: 600;
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 6px;
}

.subtemas-list {
    list-style-type: none;
    padding-left: 5px;
}

.subtemas-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.subtemas-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--text-muted);
    font-weight: bold;
    opacity: 0.6;
}

.no-results {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    padding: 40px;
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px dashed var(--border-color);
}

.status-message {
    text-align: center;
    padding: 40px;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.error-box {
    background-color: rgba(229, 62, 62, 0.1);
    border: 1px solid rgba(229, 62, 62, 0.5);
    color: #fc8181;
    border-radius: 8px;
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.95rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    color: var(--text-main);
    text-decoration: underline;
}