.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
}

.modal__content {
    background: white;
    border-radius: 12px;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
    transform: translateY(-20px);
    transition: transform 0.3s ease;
}

.modal[aria-hidden="false"] .modal__content {
    transform: translateY(0);
}

.modal__header {
    background: linear-gradient(135deg, #2c3e50, #3498db);
    color: white;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal__header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.modal__close {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__body {
    padding: 25px;
    max-height: 60vh;
    overflow-y: auto;
}

/* BARRA DE BÚSQUEDA */
.search-container {
    margin-bottom: 25px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

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

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-input::placeholder {
    color: #95a5a6;
}

.clear-search-btn {
    position: absolute;
    right: 8px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    padding: 0;
}

.clear-search-btn:hover {
    background: #e74c3c;
    transform: scale(1.1);
}

.search-results-info {
    background: #f8f9fa;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: #5d6d7e;
    font-weight: 500;
    white-space: nowrap;
}

.search-results-info.filtered {
    background: #e3f2fd;
    color: #2980b9;
}

.search-tips {
    text-align: center;
    color: #7f8c8d;
    font-size: 0.8rem;
}

/* GRID DE CANDIDATOS */
.candidatos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.candidato-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.candidato-card:hover {
    background: #e3f2fd;
    border-color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.2);
}

.candidato-card__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
    gap: 15px;
}

.candidato-card__nombre-container {
    flex: 1;
}

.candidato-card__nombre {
    margin: 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
}

.candidato-card__nivel-ingles {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.candidato-card__cargo {
    color: #7f8c8d;
    margin: 0 0 8px 0;
    font-weight: 500;
    font-size: 0.95rem;
}

.candidato-card__profesion {
    color: #5d6d7e;
    margin: 0 0 12px 0;
    font-weight: 400;
    font-size: 0.9rem;
    font-style: italic;
    border-left: 3px solid #3498db;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f0f7ff;
    display: flex;
    align-items: center;
    gap: 7px;
}

.candidato-card__meta p {
    margin: 4px 0;
    color: #64748b;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 6px;
}

.candidato-card__nivel-ingles {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.candidato-card__action {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
    color: #3498db;
    font-weight: 500;
    font-size: 0.9rem;
}

/* BOTONES */
.modal__actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn--primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.btn--secondary {
    background: #95a5a6;
    color: white;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* ESTADOS */
.error, .no-results {
    text-align: center;
    padding: 40px 20px;
    border-radius: 8px;
    margin: 10px 0;
}

.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.no-results {
    background: #f8f9fa;
    color: #5d6d7e;
    border: 1px solid #e9ecef;
}

.no-results h3 {
    margin: 0 0 10px 0;
    color: #7f8c8d;
}

/* SKELETON LOADING */
@keyframes hv-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.candidato-skeleton {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.sk-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #e9ecef 25%, #f8f9fa 50%, #e9ecef 75%);
    background-size: 600px 100%;
    animation: hv-shimmer 1.4s infinite linear;
}

.sk-header { display: flex; justify-content: space-between; margin-bottom: 14px; gap: 12px; }
.sk-name   { height: 18px; width: 60%; }
.sk-badge  { height: 18px; width: 50px; border-radius: 6px; }
.sk-cargo  { height: 14px; width: 45%; margin-bottom: 12px; }
.sk-prof   { height: 14px; width: 70%; margin-bottom: 16px; }
.sk-meta1  { height: 12px; width: 55%; margin-bottom: 6px; }
.sk-meta2  { height: 12px; width: 65%; margin-bottom: 6px; }
.sk-meta3  { height: 12px; width: 50%; }

/* RESPONSIVE */
@media (max-width: 600px) {
    .modal {
        padding: 0;
        align-items: flex-end;
        overflow: hidden;
    }
    .modal__content {
        border-radius: 20px 20px 0 0;
        max-height: 92dvh;
        width: 100vw;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .modal__header {
        padding: 14px 16px;
        border-radius: 20px 20px 0 0;
    }
    .modal__header h2 {
        font-size: 1rem;
        line-height: 1.3;
    }
    .modal__body {
        padding: 14px 12px;
        max-height: calc(92dvh - 70px);
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .search-box {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .search-results-info {
        white-space: normal;
        text-align: center;
    }
    .candidatos-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .candidato-card {
        padding: 14px;
        min-width: 0;
        overflow: hidden;
        box-sizing: border-box;
    }
    .candidato-card__header { gap: 8px; }
    .candidato-card__nombre-container { min-width: 0; overflow: hidden; }
    .candidato-card__nombre {
        font-size: 1rem;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .candidato-card__meta p,
    .candidato-card__profesion {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.82rem;
    }
    .modal__actions { justify-content: center; gap: 10px; }
    .btn { padding: 10px 14px; font-size: 0.9rem; }
}
