/* Updated styles:
   - "See more" link in English
   - clicking card selects
   - form fields styled like filters and arranged in two rows
   - modal images larger
   - selection color #D2BEBE
*/

/* Base */
#bae-catalog-wrapper { padding: 22px; background: #ffffff; border-radius: 14px; box-shadow: 0 8px 30px rgba(11,22,42,0.06); font-family: Inter, "Segoe UI", Roboto, Arial, sans-serif; color:#1d2939; }

/* Filters bar centered, controls same width/height */
.filters-bar { display:flex; gap:12px; align-items:center; justify-content:center; margin-bottom:18px; flex-wrap:wrap; }
.filters-bar input[type="search"], .filters-bar select, .filters-bar button {
    width:220px;
    height:44px;
    padding:10px 12px;
    border-radius:10px;
    border:1px solid #e6e9ef;
    background:#fff;
    font-size:14px;
    box-sizing:border-box;
}
#bae-clear-filters { background:#f8fafc; cursor:pointer; }

/* Grid */
#bae-catalog-wrapper .grid { display:grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap:18px; margin-bottom:16px; }

/* Card vertical layout, pointer cursor */
#bae-catalog-wrapper .candidate-card {
    border-radius:12px; padding:14px; background:#ffffff;
    box-shadow: 0 6px 18px rgba(11,22,42,0.04);
    display:flex; user-select:none; transition:transform .16s ease, box-shadow .16s ease, border-color .16s ease, background-color .16s ease;
    border: 1px solid rgba(15,23,42,0.04); flex-direction:column; align-items:center; text-align:center; position:relative;
    cursor: pointer;
}
.candidate-card:active { cursor:grabbing; }
.candidate-card.dragging { transform: scale(0.995); box-shadow: 0 12px 30px rgba(11,22,42,0.08); }

/* Photo top & centered */
#bae-catalog-wrapper .photo-wrap { width:140px; height:140px; border-radius:12px; overflow:hidden; background:#f2f4f7; display:flex; align-items:center; justify-content:center; margin:0 auto 12px auto; transition:transform .18s ease; }
#bae-catalog-wrapper .candidate-photo { width:140px; height:140px; object-fit:cover; display:block; transition:transform .22s ease, filter .22s ease; }
#bae-catalog-wrapper .candidate-card:hover .candidate-photo { transform: scale(1.06); filter:brightness(1.02); }

/* Body below photo */
#bae-catalog-wrapper .card-body { width:100%; display:flex; flex-direction:column; align-items:center; justify-content:flex-start; min-height:80px; }
#bae-catalog-wrapper .candidate-id { font-weight:700; color:#0f1724; margin-bottom:6px; font-size:13px; }
#bae-catalog-wrapper .candidate-name { font-size:16px; color:#081029; margin-bottom:8px; font-weight:600; }

/* Info list full width so long emails wrap */
#bae-catalog-wrapper .candidate-info { list-style:none; padding:0; margin:0; color:#374151; font-size:13px; text-align:left; width:100%; max-width:220px; overflow-wrap:anywhere; word-break:break-word; }
#bae-catalog-wrapper .see-more-link { color:#D2BEBE; text-decoration:none; font-weight:600; }
#bae-catalog-wrapper .see-more-link:hover { text-decoration:underline; }
#bae-catalog-wrapper .candidate-info li { margin-bottom:6px; opacity:0.95; }

/* "See more" link style */
.see-more-link { display:inline-block; margin-top:6px; color:#0f1724; text-decoration:underline; font-weight:600; cursor:pointer; background: white; border: none; padding: 0; }

/* Selection checkbox label */
.select-label { display:none !important; }
.select-label input[type="checkbox"] { margin-right:6px; }

/* Selection badge - top-right */
#bae-catalog-wrapper .select-badge {
    position:absolute; top:10px; right:10px; width:36px; height:36px; border-radius:50%;
    background: #D2BEBE; color:#fff; display:flex; align-items:center; justify-content:center; font-weight:700;
    transform: scale(0.8); opacity:0; pointer-events:auto; transition:transform .28s cubic-bezier(.2,.9,.2,1), opacity .28s ease;
    box-shadow: 0 8px 20px rgba(210,190,190,0.16); border:none; cursor:pointer;
}
#bae-catalog-wrapper .select-badge.visible { transform: scale(1); opacity:1; }
#bae-catalog-wrapper .select-badge.pop { transform: scale(1.15); }

/* Selected visual state */
#bae-catalog-wrapper .candidate-card.selected { background: linear-gradient(180deg, rgba(210,190,190,0.14), #ffffff); border-color: rgba(210,190,190,0.7); box-shadow: 0 14px 34px rgba(210,190,190,0.08); transform: translateY(-4px); }

/* Selection check icon in the center */
#bae-catalog-wrapper .selection-check {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(210, 190, 190, 0.9);
    color: white;
    font-size: 24px;
    font-weight: bold;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Animations */
#bae-catalog-wrapper .candidate-card.anim-select { animation: selectFlash 360ms ease forwards; }
#bae-catalog-wrapper .candidate-card.anim-deselect { animation: deselectFade 280ms ease forwards; }
@keyframes selectFlash { 0% { transform: translateY(0) scale(1); } 50% { transform: translateY(-6px) scale(1.02); } 100% { transform: translateY(-4px) scale(1); } }
@keyframes deselectFade { 0% { transform: translateY(-4px); opacity:1; } 100% { transform: translateY(0); opacity:1; } }

/* FORM (fields below) - grid layout with labels */
#bae-catalog-wrapper .catalog-form-grid { display:grid; grid-template-columns: repeat(2, 1fr); gap:16px; justify-content:center; margin-top:18px; max-width:600px; margin-left:auto; margin-right:auto; }
#bae-catalog-wrapper .catalog-form-grid h3 { grid-column: span 2; text-align:center; margin:18px 0 12px 0; font-size:18px; color:#1d2939; }
#bae-catalog-wrapper .form-group { display:flex; flex-direction:column; gap:6px; }
#bae-catalog-wrapper .form-group label { font-weight:600; color:#374151; font-size:14px; }
#bae-catalog-wrapper .catalog-form-grid input[type="text"], #bae-catalog-wrapper .catalog-form-grid select {
    width:100%; height:44px; padding:10px 12px; border-radius:8px; border:1px solid #d1d5db; background:#fff; box-sizing:border-box; font-size:14px; transition:border-color 0.2s ease;
}
#bae-catalog-wrapper .catalog-form-grid input[type="text"]:focus, #bae-catalog-wrapper .catalog-form-grid select:focus {
    outline:none; border-color:#D2BEBE; box-shadow:0 0 0 3px rgba(210, 190, 190, 0.1);
}

/* Modal */
.bae-modal-backdrop { position:fixed; inset:0; background: rgba(5,8,12,0.6); display:flex; align-items:center; justify-content:center; z-index:100000; padding:20px; }
.bae-modal { background:#fff; border-radius:12px; max-width:1200px; width:100%; box-shadow:0 24px 80px rgba(4,10,18,0.6); overflow:hidden; color:#0f1724; }
.bae-modal-close { position:absolute; top:12px; right:16px; background:transparent; border:none; font-size:28px; color:#667085; cursor:pointer; }
.bae-modal-body { display:flex; gap:20px; padding:28px; }
.modal-left { width:48%; display:flex; flex-direction:column; gap:14px; align-items:center; }
.modal-photo-wrap { width:100%; display:flex; align-items:center; justify-content:center; background:#f7fafc; padding:14px; border-radius:10px; }
.modal-main-photo { max-width:100%; max-height:700px; object-fit:cover; border-radius:8px; }
.modal-gallery { display:flex; gap:12px; flex-wrap:wrap; justify-content:center; margin-top:6px; }
.modal-thumb { border:none; padding:0; background:transparent; width:110px; height:110px; border-radius:8px; overflow:hidden; cursor:pointer; }
.modal-thumb img { width:100%; height:100%; object-fit:cover; display:block; }

/* modal right info */
.modal-right { width:52%; padding:6px 0; display:flex; flex-direction:column; gap:12px; }
.modal-right h2 { margin:0; font-size:22px; display:flex; gap:10px; align-items:center; }
.modal-right .muted { font-weight:500; color:#64748b; font-size:14px; }
.modal-info { display:flex; flex-direction:column; gap:8px; }
.modal-info .row { display:flex; gap:10px; align-items:flex-start; }
.modal-info .label { width:110px; color:#475569; font-weight:600; }
.modal-info .value { color:#0f1724; }

/* modal actions */
.modal-actions { display:flex; gap:12px; align-items:center; margin-top:12px; }
.modal-select-btn { padding:10px 14px; border-radius:8px; background:#D2BEBE; color:#fff; border:none; cursor:pointer; box-shadow:0 8px 24px rgba(210,190,190,0.12); }
.modal-open-in-new { padding:10px 14px; border-radius:8px; background:#f1f5f9; color:#0f1724; text-decoration:none; display:inline-flex; align-items:center; gap:8px; }

.grid-footer { display:flex; gap:12px; align-items:center; justify-content:flex-end; margin-top:12px; }
#bae-catalog-wrapper #load-more { padding:10px 14px; border-radius:10px; border:1px solid #e6e9ef; background:#fff; cursor:pointer; }
#bae-catalog-wrapper #generate-pdf.primary { padding:12px 18px; border-radius:10px; background:#D2BEBE; color:#fff; border:none; cursor:pointer; box-shadow: 0 6px 18px rgba(210,190,190,0.18); }

#bae-catalog-wrapper #selected-items-container { margin:12px 0 18px 0; }
#bae-catalog-wrapper #selected-items-list { list-style:none; padding:8px; margin:0; display:flex; gap:8px; flex-wrap:wrap; background:#fbfcfd; border-radius:10px; border:1px solid #f1f4f8; min-height:44px; align-items:center; }
#bae-catalog-wrapper #selected-items-list li { background:#f1f5f9; padding:6px 10px; border-radius:8px; font-size:13px; display:flex; gap:8px; align-items:center; }

@media (max-width:720px) {
    .catalog-form-grid { grid-template-columns: repeat(1, 1fr); gap:10px; }
    .modal-main-photo { max-height:420px; }
    .modal-thumb { width:84px; height:84px; }
    .photo-wrap { width:110px; height:110px; }
    .candidate-photo { width:110px; height:110px; }
}