/* ==========================================================================
   1. COMPONENTES DE INTERFAZ (Controles, Inputs y Botones Esqueuomórficos)
   ========================================================================== */
.search-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: left;
    margin: 16px 0 auto 0;
    width: 100%;
    transition: margin 0.3s ease;
}

/* Centrado condicional optimizado */
.central-layout:has(#results:empty) {
    justify-content: center;
}

.central-layout:has(#results:empty) .search-section {
    margin: auto 0;
}

.search-box { 
    display: flex; 
    align-items: center;
    gap: 8px; 
    margin-bottom: 16px; 
    width: 100%;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
}

input[type="text"] { 
    flex: 1; 
    padding: 10px 14px;
    font-size: 1rem;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #202124;
    color: #e8eaed;
    border: 1px solid #5f6368; 
    border-radius: 6px; 
    outline: none; 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus { 
    border-color: #8ab4f8; 
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5), 0 0 6px rgba(138, 180, 248, 0.35);
}

button { 
    padding: 10px 16px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #383a3e 0%, #2b2c2e 100%); 
    color: #e8eaed; 
    border: 1px solid #5f6368; 
    border-radius: 6px; 
    cursor: pointer; 
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.4);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.1s ease, transform 0.05s ease;
    min-height: 42px;
}

button:hover { 
    background: linear-gradient(180deg, #42464a 0%, #323538 100%); 
    border-color: #757b81;
}

button:active { 
    background: #252628; 
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: translateY(1px);
}

button:disabled { 
    opacity: 0.5; 
    cursor: not-allowed; 
    box-shadow: none;
}

.directory-main-btn {
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    text-shadow: none !important;
    padding: 4px 0 !important;
    margin: 0 !important;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    color: #8ab4f8;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    text-decoration: underline;
    min-height: auto !important;
    transition: color 0.15s ease, opacity 0.15s ease;
}

.directory-main-btn:hover {
    color: #c58af9;
    opacity: 0.9;
}

.directory-main-btn:active {
    transform: none !important;
}


/* --------------------------------------------------------------------------
   1.1. INDICADORES DE ESTADO (STATUS BADGES DEL DIRECTORIO)
   -------------------------------------------------------------------------- */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    margin: 0 4px 0 6px;
    flex-shrink: 0;
    align-self: center;
    position: relative;
    top: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.status-badge.online {
    background-color: #2ec4b6;
    box-shadow: 0 0 6px rgba(46, 196, 182, 0.6);
}

.status-badge.offline {
    background-color: #e71d36;
    box-shadow: 0 0 6px rgba(231, 29, 54, 0.6);
}

.status-badge.checking {
    background-color: #ff9f1c;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); }
    100% { opacity: 0.3; transform: scale(0.9); }
}


/* ==========================================================================
   2. BOTONES LATERALES FLOTANTES Y DIRECTORIO
   ========================================================================== */
.side-controls-container {
    position: fixed;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.side-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(180deg, #383a3e 0%, #2b2c2e 100%);
    color: #e8eaed;
    border: 1px solid #5f6368;
    border-left: none;
    padding: 8px 12px;
    border-radius: 0 6px 6px 0;
    cursor: pointer;
    font-size: 0.812rem;
    font-weight: 600;
    min-height: 40px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 2px 2px 6px rgba(0, 0, 0, 0.4);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.1s ease, transform 0.05s ease;
}

.side-toggle-btn:hover {
    background: linear-gradient(180deg, #42464a 0%, #323538 100%);
    border-color: #757b81;
}

.side-toggle-btn:active {
    background: #252628;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: scale(0.96) translateX(2px);
}

.side-toggle-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.side-toggle-btn.active svg {
    transform: rotate(180deg);
}

.side-toggle-btn.hidden {
    display: none;
}

/* SECCIÓN CENTRADA DE DIRECTORIO */
.directory-section-container {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    background-color: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    text-align: left;
    box-shadow: none;
    opacity: 1;
    transform: translateY(0);
    max-height: 5000px;
    overflow: visible;
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease, border-color 0.4s ease;
}

.directory-section-container.hidden {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    overflow: hidden;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: transparent !important;
    pointer-events: none;
}

.directory-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: #8ab4f8;
    border-bottom: 1px solid #3c4043;
    padding-bottom: 4px;
    transition: border-color 0.3s ease, margin 0.3s ease, padding 0.3s ease;
}

.directory-section-container.hidden .directory-title {
    border-bottom-color: transparent !important;
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

.directory-grid-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
}

.directory-card-block {
    background: #282a2d;
    border: 1px solid #3c4043;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: auto;
    min-height: fit-content;
}

.section-subtitle {
    font-size: 0.875rem;
    font-weight: 700;
    color: #8ab4f8;
    margin-bottom: 4px;
    border-bottom: 1px solid #3c4043;
    padding-bottom: 4px;
}

.directory-links-list, 
.national-links-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.directory-card-block a,
.national-links-list a,
.directory-links-list a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8ab4f8;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 4px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: normal;
    word-break: break-word;
}

.directory-card-block a:hover,
.national-links-list a:hover,
.directory-links-list a:hover {
    background-color: rgba(138, 180, 248, 0.12);
    color: #c58af9;
    text-decoration: underline;
}

/* Grilla del Directorio Clásico */
.directory-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem 2rem;
    margin-top: 1.5rem;
}

.directory-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    margin: 0;
    cursor: default;
    transition: none;
    box-shadow: none;
    display: block;
    text-align: left;
}

.directory-card:hover {
    transform: none;
    box-shadow: none;
    border-color: transparent;
}

.directory-card-icon { display: none; }

.directory-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 0.2rem 0;
    color: var(--link-color, #8ab4f8);
    cursor: pointer;
    text-decoration: underline;
}

.directory-card-title:hover { color: #c58af9; }

.directory-card-desc {
    font-size: 0.85rem;
    color: var(--text-secondary, #bdc1c6);
    margin: 0;
    line-height: 1.3;
}

.directory-card-btn { display: none; }


/* ==========================================================================
   3. SECCIÓN ACTUALIDAD (DÓLAR, CLIMA Y NOTICIAS)
   ========================================================================== */
.search-divider {
    border: none;
    border-top: 1px solid #3c4043;
    margin: 16px 0;
    width: 100%;
    transition: opacity 0.3s ease, margin 0.3s ease, border-color 0.3s ease;
}

.news-section.faded + .search-divider,
.news-section.faded .search-divider,
.search-divider.hidden {
    border-top-color: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
    opacity: 0;
    height: 0;
    overflow: hidden;
}

.news-section {
    width: 100%;
    margin-bottom: 16px;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s ease, max-height 0.4s ease, margin 0.4s ease, padding 0.4s ease;
    max-height: 2000px;
    overflow: hidden;
}

.news-section.faded {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: none;
}

.news-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.news-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #e0e0e0;
    margin: 0;
}

.actuality-widgets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.actuality-card {
    background-color: #202124;
    border: 1px solid #3c4043;
    border-radius: 6px;
    padding: 0.85rem 1rem;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.actuality-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.2rem;
}

.actuality-card-header h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0;
    color: #e8eaed;
}

.dollar-value-highlight {
    font-size: 1.125rem;
    font-weight: 900;
    color: #81c995;
}

.actuality-card-sub {
    font-size: 0.812rem;
    color: #9aa0a6;
    margin: 0 0 0.5rem 0;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 110px;
}

.weather-city-badge {
    font-size: 0.78rem;
    background: #303134;
    color: #8ab4f8;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.weather-main-info {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.3rem 0 0.6rem 0;
}

.weather-temp-highlight {
    font-size: 1.85rem;
    font-weight: 900;
    line-height: 1;
    color: #e8eaed;
}

.weather-condition-label {
    font-size: 0.875rem;
    color: #bdc1c6;
    text-transform: capitalize;
}

.forecast-container h4 {
    font-size: 0.812rem;
    margin: 0 0 0.35rem 0;
    color: #9aa0a6;
}

.forecast-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
}

.forecast-item {
    background: #282a2d;
    border: 1px solid #3c4043;
    border-radius: 4px;
    padding: 0.35rem;
    text-align: center;
    font-size: 0.812rem;
}

.forecast-day {
    font-weight: 700;
    display: block;
    margin-bottom: 0.1rem;
    color: #8ab4f8;
}

.forecast-temp { color: #e8eaed; }

.news-sub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.65rem;
    border-top: 1px solid #3c4043;
    padding-top: 0.75rem;
}

.news-subtitle {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
    color: #e0e0e0;
}

.news-nav-buttons {
    display: flex;
    gap: 6px;
}

.carousel-arrow {
    background: linear-gradient(180deg, #383a3e 0%, #2b2c2e 100%);
    border: 1px solid #5f6368;
    color: #e8eaed;
    border-radius: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.875rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 1px 2px rgba(0, 0, 0, 0.4);
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.6);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease, box-shadow 0.1s ease;
    min-height: auto;
    padding: 0;
}

.carousel-arrow:hover {
    background: linear-gradient(180deg, #42464a 0%, #323538 100%);
    border-color: #757b81;
}

.carousel-arrow:active {
    background: #252628;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
    transform: scale(0.95);
}

.news-carousel {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.news-carousel::-webkit-scrollbar { height: 5px; }
.news-carousel::-webkit-scrollbar-thumb { background: #3c4043; border-radius: 3px; }

.news-card {
    flex: 0 0 230px;
    scroll-snap-align: start;
    background: #202124;
    border: 1px solid #3c4043;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.news-card:hover {
    border-color: #8ab4f8;
    transform: translateY(-2px);
}

.news-card-badge {
    font-size: 0.72rem;
    color: #8ab4f8;
    font-weight: 700;
    margin-bottom: 4px;
    text-transform: uppercase;
}

.news-card-title {
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 6px 0;
    color: #e8eaed;
}

.news-card-snippet {
    font-size: 0.812rem;
    color: #bdc1c6;
    line-height: 1.35;
    margin: 0 0 8px 0;
}

.news-card-link {
    font-size: 0.812rem;
    color: #8ab4f8;
    text-decoration: underline;
    font-weight: normal;
}

.news-card-link:hover { color: #c58af9; }


/* ==========================================================================
   4. RESULTADOS DE BÚSQUEDA Y PAGINACIÓN
   ========================================================================== */
.stats { 
    width: 100%;
    font-size: 0.812rem;
    color: #9aa0a6; 
    margin-bottom: 12px; 
    border-bottom: 1px solid #3c4043;
    padding-bottom: 6px;
    text-align: left;
}

.stats:empty { display: none !important; }

#results {
    width: 100%;
    text-align: left;
}

.result-item { 
    margin-bottom: 18px; 
    background: transparent; 
}

.result-header {
    font-size: 0.812rem;
    color: #81c995;
    margin-bottom: 4px;
}

.result-title-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

/* --------------------------------------------------------------------------
   4.1. FAVICONS ESTANDARIZADOS (DIRECTORIO, MODAL, RESULTADOS)
   -------------------------------------------------------------------------- */
.favicon,
.directory-favicon,
.modal-favicon,
.result-favicon {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    max-width: 16px !important;
    max-height: 16px !important;
    object-fit: contain;
    flex-shrink: 0;
    vertical-align: middle;
    display: inline-block;
    filter: brightness(0.95);
}

.result-title { 
    font-size: 1.125rem;
    color: #8ab4f8; 
    text-decoration: underline; 
    font-weight: normal; 
    display: inline-block; 
}

.result-title:visited { color: #c58af9; }

.result-snippet { 
    font-size: 0.875rem;
    color: #bdc1c6; 
    line-height: 1.45; 
}

.highlight {
    color: #f28b82;
    background-color: rgba(242, 139, 130, 0.15);
    font-weight: bold;
    padding: 0 2px;
    border-radius: 2px;
}

.score-tag { 
    font-size: 0.75rem;
    color: #9aa0a6; 
    font-weight: normal;
}

/* --------------------------------------------------------------------------
   4.2. KNOWLEDGE PANEL
   -------------------------------------------------------------------------- */
#knowledgePanel {
    display: none;
    background-color: #202124;
    border: 1px solid #3c4043;
    border-radius: 6px;
    padding: 14px;
    margin-bottom: 18px;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

#knowledgePanel.active {
    display: block;
    animation: kpFadeIn 0.3s ease-in-out;
}

#kpTitle {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px 0;
    color: #e8eaed;
}

#kpSubtitle {
    font-size: 0.875rem;
    color: #9aa0a6;
    margin-bottom: 8px;
}

#kpImageContainer {
    width: 100%;
    max-height: 180px;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: #282a2d;
    display: flex;
    align-items: center;
    justify-content: center;
}

#kpImage {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#kpExtract {
    font-size: 0.875rem;
    line-height: 1.45;
    color: #bdc1c6;
    margin-bottom: 10px;
}

.kp-platforms-container {
    margin: 8px 0;
    padding-top: 8px;
    border-top: 1px solid #3c4043;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.kp-platforms-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #9aa0a6;
}

.kp-platforms-wrapper {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.platform-link {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    font-size: 0.78rem;
    font-weight: 500;
    border-radius: 12px;
    background-color: #282a2d;
    border: 1px solid #3c4043;
    color: #8ab4f8;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.platform-link:hover {
    background-color: rgba(138, 180, 248, 0.12);
    border-color: #8ab4f8;
    color: #c58af9;
    transform: translateY(-1px);
}

#kpWikiLink {
    display: inline-block;
    margin-top: 6px;
    font-size: 0.812rem;
    color: #8ab4f8;
    text-decoration: underline;
}

#kpWikiLink:hover { color: #c58af9; }

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

/* PAGINACIÓN */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.page-btn {
    padding: 6px 12px;
    margin: 0 2px;
    font-size: 0.812rem;
    font-family: Arial, Helvetica, sans-serif;
    background: linear-gradient(180deg, #2a2b2e 0%, #1e1f21 100%);
    color: #e8eaed;
    border: 1px solid #5f6368;
    border-radius: 4px;
    cursor: pointer;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 1px 2px rgba(0, 0, 0, 0.2);
    transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
    min-height: 36px;
}

.page-btn:hover:not(:disabled) {
    background: linear-gradient(180deg, #383a3e 0%, #2b2c2e 100%);
    border-color: #8ab4f8;
}

.page-btn:active:not(:disabled) { transform: translateY(1px); }

.page-btn.active {
    background: linear-gradient(180deg, #9bbcf8 0%, #76a2e8 100%);
    color: #121212;
    border-color: #8ab4f8;
    font-weight: bold;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 3px rgba(0, 0, 0, 0.4);
    text-shadow: none;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
}

.page-info-text {
    font-size: 0.812rem;
    color: #9aa0a6;
    margin: 0 6px;
}


/* ==========================================================================
   5. SKELETON LOADERS
   ========================================================================== */
.skeleton-card {
    margin-bottom: 18px;
    width: 100%;
}

.skeleton-line {
    border-radius: 3px;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
    background-color: #2a2b2e;
}

.skeleton-line::after {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        transparent 100%
    );
    animation: shimmer 1.5s infinite;
}

.skeleton-header { width: 25%; height: 13px; }
.skeleton-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.skeleton-favicon { width: 18px; height: 18px; border-radius: 2px; flex-shrink: 0; }
.skeleton-title { width: 60%; height: 18px; margin-bottom: 0; }
.skeleton-snippet-1 { width: 95%; height: 14px; }
.skeleton-snippet-2 { width: 75%; height: 14px; }

@keyframes shimmer {
    100% { transform: translateX(100%); }
}


/* ==========================================================================
   6. MODAL COMPACTO CON ESTÁTICA TIPO DIRECTORIO
   ========================================================================== */
.modal,
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content,
.modal-container {
    background: #282a2d;
    border: 1px solid #3c4043;
    border-radius: 6px;
    padding: 10px 14px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #3c4043;
    padding-bottom: 6px;
}

.modal-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #8ab4f8;
    margin: 0;
}

.modal-close-btn {
    background: transparent !important;
    border: none !important;
    color: #9aa0a6;
    font-size: 1.1rem;
    padding: 0 !important;
    min-height: auto !important;
    cursor: pointer;
    box-shadow: none !important;
    text-shadow: none !important;
}

.modal-close-btn:hover {
    color: #e8eaed;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.modal-body a,
.modal-list-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #8ab4f8;
    text-decoration: none;
    font-size: 0.875rem;
    padding: 4px 6px;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.03);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.modal-body a:hover,
.modal-list-item:hover {
    background-color: rgba(138, 180, 248, 0.12);
    color: #c58af9;
    text-decoration: underline;
}


/* ==========================================================================
   7. SOPORTE DE MODO CLARO (LIGHT THEME / LIGHT MODE)
   ========================================================================== */
body.light-theme .directory-title,
body.light-mode .directory-title,
body.light-theme .section-subtitle,
body.light-mode .section-subtitle {
    color: #1a0dab;
    border-bottom-color: #dadce0;
}

body.light-theme .directory-card-block,
body.light-mode .directory-card-block {
    background: #f8f9fa;
    border-color: #dadce0;
}

body.light-theme .directory-card-block a,
body.light-mode .directory-card-block a,
body.light-theme .national-links-list a,
body.light-mode .national-links-list a,
body.light-theme .directory-links-list a,
body.light-mode .directory-links-list a {
    color: #1a0dab;
    background-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .directory-card-block a:hover,
body.light-mode .directory-card-block a:hover,
body.light-theme .national-links-list a:hover,
body.light-mode .national-links-list a:hover,
body.light-theme .directory-links-list a:hover,
body.light-mode .directory-links-list a:hover {
    background-color: rgba(26, 13, 171, 0.08);
    color: #4b11a8;
}

body.light-theme .directory-card-title,
body.light-mode .directory-card-title {
    color: #1a0dab;
}

body.light-theme .directory-card-desc,
body.light-mode .directory-card-desc {
    color: #4d5156;
}

/* Modal en Modo Claro */
body.light-theme .modal-content,
body.light-mode .modal-content,
body.light-theme .modal-container,
body.light-mode .modal-container {
    background: #ffffff;
    border-color: #dadce0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

body.light-theme .modal-header,
body.light-mode .modal-header {
    border-bottom-color: #dadce0;
}

body.light-theme .modal-title,
body.light-mode .modal-title {
    color: #1a0dab;
}

body.light-theme .modal-body a,
body.light-mode .modal-body a,
body.light-theme .modal-list-item,
body.light-mode .modal-list-item {
    color: #1a0dab;
    background-color: rgba(0, 0, 0, 0.03);
}

body.light-theme .modal-body a:hover,
body.light-mode .modal-body a:hover,
body.light-theme .modal-list-item:hover,
body.light-mode .modal-list-item:hover {
    background-color: rgba(26, 13, 171, 0.08);
    color: #4b11a8;
}

body.light-theme .modal-close-btn,
body.light-mode .modal-close-btn {
    color: #5f6368;
}

body.light-theme .modal-close-btn:hover,
body.light-mode .modal-close-btn:hover {
    color: #202124;
}


/* ==========================================================================
   8. MEDIA QUERIES RESPONSIVAS PARA COMPONENTES
   ========================================================================== */
@media (max-width: 768px) {
    .side-toggle-btn {
        writing-mode: vertical-rl;
        text-orientation: mixed;
        padding: 10px 6px;
        gap: 6px;
        font-size: 0.78rem;
        letter-spacing: 0.5px;
        white-space: nowrap;
    }

    .side-toggle-btn:active { transform: scale(0.96) translateX(2px); }

    .side-toggle-btn svg {
        transform: rotate(90deg);
        flex-shrink: 0;
    }

    .side-toggle-btn.active svg { transform: rotate(270deg); }

    .forecast-list { grid-template-columns: repeat(3, 1fr); }
}