/* Profile Modal Styles */

/* ============================================
   PREVENT BODY SCROLL WHEN MODAL IS OPEN
   ============================================ */

/* Override Bootstrap's body.modal-open { overflow:hidden } so the
   absolute-positioned modal is not clipped.  The iframe has scrolling="no"
   — the parent Hivebrite page owns the scrollbar.  Body must be visible
   so dynamicContentSize.js can measure the full dialog height. */
body.modal-open {
    overflow: visible !important;
    padding-right: 0 !important;
}

html.modal-open,
html:has(.modal.show) {
    overflow: visible !important;
}

/* Modal positioning (position:absolute, height:auto, overflow:visible)
   is defined in profile.css which loads after this file and takes
   precedence.  See profile.css "Single scroll bar" section.
   Do NOT add min-height:100% here — it causes a height feedback loop
   with dynamicContentSize.js inside the Hivebrite iframe. */

/* Modal backdrop handled by body-content blur in profile.css */

/* Dialog card sizing — profile.css overrides margin and max-height */
.profile-modal .modal-dialog {
    max-width: 540px !important;
    max-height: none !important;
    margin: 2rem auto !important;
}

/* Large modal for tabbed forms */
.profile-modal .modal-dialog.modal-lg {
    max-width: 700px !important;
}

/* Extra-large modal for cover image cropping */
.profile-modal .modal-dialog.modal-xl {
    max-width: 950px !important;
}

/* Modal content container */
.profile-modal .modal-content {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15) !important;
    overflow: visible !important;
    display: flex !important;
    flex-direction: column !important;
}

/* Modal header */
.profile-modal .profile-modal-header {
    background-color: #fff !important;
    border-bottom: none !important;
    padding: 32px 20px 8px 20px !important;
    text-align: center !important;
    position: relative !important;
    flex-shrink: 0 !important;
}

/* Close button - thin X in top right corner */
.profile-modal .profile-modal-close {
    position: absolute !important;
    right: 20px !important;
    top: 20px !important;
    background: transparent !important;
    border: none !important;
    color: #333 !important;
    cursor: pointer !important;
    padding: 4px !important;
    line-height: 1 !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    z-index: 10 !important;
}

.profile-modal .profile-modal-close:hover {
    color: #000 !important;
}

.profile-modal .profile-modal-close svg {
    width: 14px !important;
    height: 14px !important;
}

/* Title - ABOUT centered, bold, uppercase */
.profile-modal .profile-modal-title {
    font-family: "Roboto", sans-serif !important;
    font-size: 32px !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
    color: #000 !important;
    text-align: center !important;
    margin: 0 !important;
    letter-spacing: 0.5px !important;
    line-height: 1.2 !important;
}

/* Subtitle - red asterisk + italic text */ 
.profile-modal .profile-modal-subtitle {
    text-align: center !important;
    padding: 4px 20px 20px 20px !important;
    font-size: 16px !important;
    color: #333 !important;
    font-family: "Roboto", sans-serif !important;
    background-color: #fff !important;
    line-height: 0.4 !important;
    flex-shrink: 0 !important;
}

.profile-modal .profile-modal-subtitle .required-marker {
    color: #c00 !important;
    font-weight: normal !important;
    font-style: normal !important;
    margin-right: 0 !important;
    font-size: 14px !important;
}

.profile-modal .profile-modal-subtitle em {
    font-style: italic !important;
    color: #333 !important;
    font-weight: 400 !important;
}

/* Body content area */
.profile-modal .modal-body.profile-modal-body {
    padding: 0 28px 16px 28px !important;
    overflow-y: visible !important;
    overflow-x: hidden !important;
    background-color: #fff !important;
    flex: 1 1 auto !important;
}


/* Footer with buttons */
.profile-modal .modal-footer.profile-modal-footer {
    border-top: none !important;
    padding: 12px 28px 28px 28px !important;
    justify-content: flex-start !important;
    background-color: #fff !important;
    display: flex !important;
    flex-shrink: 0 !important;
}

/* Hide footer when display:none is set */
.profile-modal .modal-footer.profile-modal-footer[style*="display: none"],
.profile-modal .modal-footer.profile-modal-footer:empty {
    display: none !important;
    padding: 0 !important;
}

/* Form Labels */
.profile-modal .form-label,
.profile-modal label {
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    color: #333 !important;
    font-weight: 400 !important;
    margin-bottom: 6px !important;
    display: block !important;
}

/* Required star */
.profile-modal .required-star {
    color: #dc3545 !important;
}

/* Form Inputs */
.profile-modal .form-control,
.profile-modal .form-select {
    font-family: "Roboto", sans-serif !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    padding: 10px 12px !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    background-color: #fff !important;
    color: #333 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.profile-modal .form-control:focus,
.profile-modal .form-select:focus {
    border-color: #ccc !important;
    box-shadow: none !important;
    outline: none !important;
}

.profile-modal .form-control::placeholder {
    color: #aaa !important;
    font-weight: 400 !important;
}

.profile-modal textarea.form-control {
    min-height: 60px !important;
    resize: vertical !important;
}

/* Disabled / readonly inputs — subtle visual cue so users know the field
   is not editable: light grey background, muted text, not-allowed cursor. */
.profile-modal .form-control:disabled,
.profile-modal .form-control[readonly],
.profile-modal .form-select:disabled,
.profile-modal .form-select[readonly] {
    background-color: #f5f5f5 !important;
    color: #999 !important;
    cursor: not-allowed !important;
    border-color: #e8e8e8 !important;
}

/* ── Quill WYSIWYG editor — match existing modal input styling ──────────── */

/* Constrain the mount-point so it never exceeds the modal body width */
#AboutMeEditor {
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Toolbar: same border and rounded top corners as our inputs.
   flex-wrap: wrap lets button groups flow onto a second row instead of
   overflowing and pushing the page wider. */
.profile-modal .ql-toolbar.ql-snow {
    border: 1px solid #e0e0e0 !important;
    border-bottom: none !important;
    border-radius: 4px 4px 0 0 !important;
    font-family: "Roboto", sans-serif !important;
    padding: 6px 8px !important;
    background-color: #fafafa !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-wrap: wrap !important;        /* wrap groups onto next line when narrow */
    align-items: center !important;
    gap: 2px 0 !important;
}

/* Editor container: fully constrained, rounded bottom corners */
.profile-modal .ql-container.ql-snow {
    border: 1px solid #e0e0e0 !important;
    border-top: none !important;
    border-radius: 0 0 4px 4px !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}

/* Editable area: min-height and padding to match textarea */
.profile-modal .ql-editor {
    min-height: 100px !important;
    color: #333 !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    padding: 10px 12px !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    word-break: break-word !important;  /* prevent long words from overflowing */
    overflow-wrap: break-word !important;
}

/* Placeholder text: same muted grey as other inputs */
.profile-modal .ql-editor.ql-blank::before {
    color: #aaa !important;
    font-style: normal !important;
}

/* Toolbar button focus/hover state */
.profile-modal .ql-toolbar.ql-snow .ql-formats button:hover,
.profile-modal .ql-toolbar.ql-snow .ql-formats button:focus {
    color: #5865F2 !important;
}

/* Quill tooltip / link-entry box: keep it inside the modal */
.profile-modal .ql-tooltip {
    max-width: calc(100% - 24px) !important;
    white-space: normal !important;
    word-break: break-all !important;
    z-index: 1060 !important;          /* above Bootstrap modal (z-index 1055) */
}
/* ─────────────────────────────────────────────────────────────────────────── */

.profile-modal .mb-3 {
    margin-bottom: 16px !important;
}

/* Save Button - Blue/Purple */
.profile-modal .btn-profile-save {
    background-color: #5865F2 !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    padding: 10px 26px !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    min-width: 85px !important;
}

.profile-modal .btn-profile-save:hover {
    background-color: #4752c4 !important;
    color: #fff !important;
}

/* Cancel Button - Dark/Black */
.profile-modal .btn-profile-cancel {
    background-color: #1a1a1a !important;
    border: none !important;
    border-radius: 10px !important;
    color: #fff !important;
    padding: 10px 26px !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    min-width: 85px !important;
}

.profile-modal .btn-profile-cancel:hover {
    background-color: #333 !important;
    color: #fff !important;
}

/* Delete Button - Red */
.profile-modal .btn-profile-delete {
    background-color: #dc3545 !important;
    border: none !important;
    border-radius: 5px !important;
    color: #fff !important;
    padding: 10px 26px !important;
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease !important;
    min-width: 85px !important;
}

.profile-modal .btn-profile-delete:hover {
    background-color: #bb2d3b !important;
    color: #fff !important;
}

/* ============================================
   SECTION HEADERS & MISC
   ============================================ */

.profile-modal .modal-section-header {
    font-family: "Roboto", sans-serif !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #5865F2 !important;
    border-bottom: 1px solid #eee !important;
    padding-bottom: 8px !important;
    margin-bottom: 14px !important;
    margin-top: 14px !important;
}

.profile-modal .modal-section-header:first-child {
    margin-top: 0 !important;
}

/* Collapsible section header (e.g. Assistant Details) */
.profile-modal .collapsible-header {
    user-select: none;
}

.profile-modal .collapsible-header:hover {
    color: #4752c4 !important;
}

/* Chevron rotation when section is expanded */
.profile-modal .collapsible-icon.rotated {
    transform: rotate(180deg);
}

/* Select2 styling within profile modal */
.profile-modal .select2-container {
    width: 100% !important;
}

.profile-modal .select2-container--default .select2-selection--multiple,
.profile-modal .select2-container--default .select2-selection--single {
    border: 1px solid #e0e0e0 !important;
    border-radius: 4px !important;
    min-height: 40px !important;
    font-family: "Roboto", sans-serif !important;
    background-color: #fff !important;
}

.profile-modal .select2-container--default .select2-selection--multiple .select2-selection__choice {
    background-color: #f0f0f0 !important;
    border: none !important;
    border-radius: 3px !important;
    padding: 2px 8px !important;
    font-size: 13px !important;
}

/* Revenue table styling */
.profile-modal .table {
    width: 100% !important;
    margin-bottom: 16px !important;
}

.profile-modal .table th,
.profile-modal .table td {
    padding: 8px 12px !important;
    font-size: 14px !important;
    vertical-align: middle !important;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .profile-modal .col-md-6 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .profile-modal .modal-dialog.modal-lg,
    .profile-modal .modal-dialog.modal-xl {
        max-width: 95% !important;
        margin: 1rem auto !important;
    }
}

/* Fix Select2 search box hidden by Bootstrap */
.select2-container--default .select2-search--dropdown .select2-search__field {
    display: block !important;
    width: 100% !important;
    padding: 6px !important;
    border: 1px solid #ced4da !important;
}

.select2-dropdown {
    z-index: 9999 !important;
}

/* ============================================
   PROFILE IMAGE CROPPER
   ============================================ */

/* Container that holds the Cropper.js canvas */
.cropper-container-wrapper {
    width: 100%;
    max-width: 400px;
    max-height: 350px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    background-color: #f5f5f5;
}

/* Source image inside cropper - must be block with max dimensions for Cropper.js to init properly */
.cropper-container-wrapper img {
    display: block;
    max-width: 100%;
    max-height: 350px;
}

/* Cropper control buttons row */
.cropper-controls {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.cropper-controls .btn {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
}

.cropper-controls .btn:hover {
    background-color: #5865F2;
    border-color: #5865F2;
    color: #fff;
}

/* Action buttons below cropper (Change Photo / Apply Crop) */
.cropper-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.cropper-actions .btn {
    font-family: "Roboto", sans-serif;
    font-size: 13px;
    border-radius: 8px;
    padding: 6px 16px;
}

/* Profile avatar: circular crop overlay */
.profile-modal .cropper-view-box,
.profile-modal .cropper-face {
    border-radius: 50%;
}

/* Cover image: wider container, rectangular crop — large area for better adjustment */
.cropper-cover-wrapper {
    max-width: 100%;
    max-height: 500px;
    min-height: 300px;
}

.cropper-cover-wrapper img {
    max-height: 500px;
}

/* Override circular crop for cover image modal — keep rectangular */
#modalCover .cropper-view-box,
#modalCover .cropper-face {
    border-radius: 0 !important;
}

/* Dim the area outside the crop region */
.profile-modal .cropper-modal {
    opacity: 0.6;
}