/* ============================================
   BASE - Reset universal
   Incluir en TODAS las páginas
   ============================================ */

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

/* ============================================
   COMPATIBILITY BADGE
   ============================================ */
.compat-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid var(--compat-color, #6c757d);
    margin-bottom: 12px;
    font-size: 0.88rem;
    color: #333;
}

.compat-badge.compat-login {
    border-left-color: #6c757d;
    color: #666;
    font-size: 0.82rem;
    gap: 8px;
}

.compat-badge.compat-login i {
    color: #999;
}

.compat-badge.compat-login a {
    font-weight: 600;
}

.compat-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid var(--compat-color, #6c757d);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
}

.compat-circle span {
    font-size: 0.82rem;
    line-height: 1;
}

.compat-text {
    line-height: 1.3;
}

.compat-text strong {
    display: block;
    font-size: 0.95rem;
}

/* Compact version for popups & list items */
.job-popup .compat-badge,
.job-list-item .compat-badge {
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 0.75rem;
    gap: 7px;
}

.job-popup .compat-badge.compat-login,
.job-list-item .compat-badge.compat-login {
    font-size: 0.7rem;
    padding: 5px 8px;
}

.job-popup .compat-circle,
.job-list-item .compat-circle {
    width: 32px;
    height: 32px;
    border-width: 2px;
}

.job-popup .compat-circle span,
.job-list-item .compat-circle span {
    font-size: 0.7rem;
}

.job-popup .compat-text strong,
.job-list-item .compat-text strong {
    font-size: 0.78rem;
}

/* ============================================
   COMPANY MAP MARKERS
   ============================================ */

/* Icono de empresa externa (gris) */
.company-icon-external {
    background: transparent !important;
    border: none !important;
}

/* Icono de empresa de la plataforma (azul con badge ✓) */
.company-icon-platform {
    background: transparent !important;
    border: none !important;
}
.platform-company-marker {
    position: relative;
    background: linear-gradient(135deg, #0077B5, #005a8c);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
    box-shadow: 0 0 8px rgba(0, 119, 181, 0.4), 0 2px 6px rgba(0,0,0,0.2);
    animation: platformPulse 3s ease-in-out infinite;
}
.platform-company-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #4CAF50;
    color: white;
    font-size: 9px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}
@keyframes platformPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* ============================================
   COMPANY POPUP STYLES
   ============================================ */
.company-popup {
    max-width: 300px;
    font-size: 12px;
}
.company-popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}
.company-popup-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}
.company-popup-logo-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #bbb;
    font-size: 18px;
    flex-shrink: 0;
}
.company-popup-info {
    flex: 1;
    min-width: 0;
}
.company-popup-name {
    color: #0077B5;
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 2px 0;
    line-height: 1.2;
}
.company-popup-sector {
    display: block;
    font-size: 11px;
    color: #888;
    margin-bottom: 2px;
}
.company-popup-platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    font-weight: 600;
    padding: 1px 6px;
    border-radius: 3px;
}

/* Secciones de ofertas dentro del popup */
.company-popup-section {
    margin-top: 6px;
}
.company-popup-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #555;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}
.company-popup-section-title i {
    font-size: 10px;
    color: #0077B5;
}
.company-popup-external .company-popup-section-title i {
    color: #9e9e9e;
}
.company-popup-job {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    border-bottom: 1px solid #f5f5f5;
}
.company-popup-job:last-child {
    border-bottom: none;
}
.company-popup-job-info {
    flex: 1;
    min-width: 0;
}
.company-popup-job-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.company-popup-job-title:hover {
    color: #0077B5;
}
.company-popup-external-link {
    color: #555 !important;
}
.company-popup-external-link:hover {
    color: #0077B5 !important;
}
.company-popup-job-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #999;
    margin-top: 1px;
    flex-wrap: wrap;
}
.company-popup-job-actions {
    flex-shrink: 0;
}
.company-popup-apply-btn {
    background: #0077B5;
    color: white;
    border: none;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    transition: background 0.2s;
}
.company-popup-apply-btn:hover {
    background: #005a8c;
}

/* Quick apply link button in popup */
.company-popup-quick-apply-btn {
    background: #0077B5;
    color: white !important;
    border: none;
    padding: 4px 10px;
    border-radius: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    font-family: inherit;
}
.company-popup-quick-apply-btn:hover {
    background: #005a8c;
    color: white !important;
    transform: scale(1.04);
}
.company-popup-quick-apply-btn i {
    font-size: 10px;
}

/* Applied badge in popup */
.company-popup-applied-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 10px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}
.company-popup-applied-badge i {
    font-size: 9px;
}

/* Footer del popup */
.company-popup-footer {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eee;
    text-align: center;
}
.company-popup-profile-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #0077B5;
    color: white !important;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 16px;
    transition: background 0.2s;
}
.company-popup-profile-btn:hover {
    background: #005a8c;
    color: white !important;
}
.company-popup-attribution {
    font-size: 9px;
    color: #bbb;
    margin-top: 6px;
    font-style: italic;
}

/* Source badges */
.source-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
}
.source-badge.source-fylj {
    background: #e3f2fd;
    color: #0077B5;
}
.source-badge.source-jooble {
    background: #fff3e0;
    color: #e65100;
}
.source-badge.source-adzuna {
    background: #e8f5e9;
    color: #2e7d32;
}
.source-badge.source-infojobs {
    background: #fce4ec;
    color: #c62828;
}

/* External loading indicator */
.external-loading-indicator {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: white;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    animation: slideIn 0.3s ease-out;
}

/* Source filter chips */
.source-filter-chips {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}
.source-filter-chip {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 12px;
    border: 1px solid #ddd;
    background: white;
    color: #666;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.source-filter-chip.active {
    background: #0077B5;
    color: white;
    border-color: #0077B5;
}
.source-filter-chip:hover:not(.active) {
    border-color: #0077B5;
    color: #0077B5;
}

/* Company profile: external offers section */
.cp-external-disclaimer {
    font-size: 0.75rem;
    color: #999;
    padding: 0.75rem 1rem;
    background: #fafafa;
    border-radius: 8px;
    margin-top: 0.75rem;
    line-height: 1.4;
}
.cp-external-disclaimer i {
    color: #bbb;
    margin-right: 4px;
}
.cp-job-card-external {
    border-left: 3px solid #e0e0e0;
}
.cp-job-card-external:hover {
    border-left-color: #9e9e9e;
}
.cp-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    background: #f5f5f5;
    padding: 1px 6px;
    border-radius: 3px;
}

/* ============================================
   MARKDOWN RENDERED CONTENT (shared)
   ============================================ */
.md-rendered h1, .md-rendered h2, .md-rendered h3 {
    margin: 0.8em 0 0.4em;
}
.md-rendered h1 { font-size: 1.3em; }
.md-rendered h2 { font-size: 1.15em; }
.md-rendered h3 { font-size: 1.05em; }
.md-rendered p { margin: 0.4em 0; line-height: 1.7; }
.md-rendered ul, .md-rendered ol { padding-left: 1.5em; margin: 0.5em 0; }
.md-rendered li { margin-bottom: 0.2em; line-height: 1.6; }
.md-rendered strong { font-weight: 700; }
.md-rendered a { color: #0077B5; text-decoration: underline; }
