/* USER EDIT MODAL AND PROFILE BOX - CLEAN OVERRIDE */
/* Overrides admin.css and other conflicting styles */

/* Base modal - edit box only */
.tk-profile-edit-box {
    display: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 680px !important;
    max-width: 95% !important;
    height: auto !important;
    max-height: 85vh !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    z-index: 999999 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Profile box - different from edit box */
.tk-profile-box {
    display: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    width: 800px !important;
    max-width: 95% !important;
    height: auto !important;
    max-height: 85vh !important;
    background: #ffffff !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
    z-index: 999998 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* Show when active */
.tk-profile-edit-box.tk-active,
.tk-profile-box.tk-active {
    display: block !important;
}

/* Header - for both boxes */
.tk-profile-edit-box .tk-top-bar,
.tk-profile-box .tk-top-bar {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 52px !important;
    padding: 0 16px !important;
    background: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Profile in header - for both boxes - FIXED OVERLAP */
.tk-profile-edit-box .tk-top-bar .tk-profile,
.tk-profile-box .tk-top-bar .tk-profile {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 0 !important;
    font-weight: normal !important;
    flex-shrink: 0 !important;
    position: relative !important;
}

/* Profile image - FIXED POSITION */
.tk-profile-edit-box .tk-top-bar .tk-profile img,
.tk-profile-box .tk-top-bar .tk-profile img {
    width: 30px !important;
    min-width: 30px !important;
    height: 30px !important;
    min-height: 30px !important;
    border-radius: 50% !important;
    border: 1px solid #dee2e6 !important;
    flex-shrink: 0 !important;
    display: inline-block !important;
    object-fit: cover !important;
    position: relative !important;
    margin-right: 8px !important;
}

/* Name - PREVENT OVERLAP */
.tk-profile-edit-box .tk-top-bar .tk-profile span,
.tk-profile-edit-box .tk-top-bar .tk-profile .tk-name,
.tk-profile-box .tk-top-bar .tk-profile span,
.tk-profile-box .tk-top-bar .tk-profile .tk-name {
    font-size: 14px !important;
    font-weight: 600 !important;
    color: #212529 !important;
    line-height: 30px !important;
    white-space: nowrap !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: inline-block !important;
    position: relative !important;
}

/* Header buttons container */
.tk-profile-edit-box .tk-top-bar > div:last-child,
.tk-profile-box .tk-top-bar > div:last-child {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
}

/* All header buttons - better alignment */
.tk-profile-edit-box .tk-top-bar .tk-btn,
.tk-profile-box .tk-top-bar .tk-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    vertical-align: middle !important;
    white-space: nowrap !important;
}

/* Header button icons - prevent overlap */
.tk-profile-edit-box .tk-top-bar .tk-btn i,
.tk-profile-box .tk-top-bar .tk-btn i {
    font-size: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: baseline !important;
    position: static !important;
    float: none !important;
    flex-shrink: 0 !important;
}

.tk-profile-edit-box .tk-top-bar .tk-btn-icon,
.tk-profile-box .tk-top-bar .tk-btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

/* Save button */
.tk-profile-edit-box .tk-save {
    background: #0d6efd !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    cursor: pointer !important;
    border: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 30px !important;
    line-height: 1 !important;
}

/* Style the checkmark icon if you want to keep it */
.tk-profile-edit-box .tk-save i.tk-icon-check {
    font-size: 12px !important;
    margin-right: 2px !important;
}

/* Or hide it - uncomment this if you don't want the checkmark
.tk-profile-edit-box .tk-save i.tk-icon-check {
    display: none !important;
}
*/

/* Edit button - in profile box */
.tk-profile-box .tk-edit {
    background: #6c757d !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    height: 30px !important;
    border: none !important;
    line-height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    pointer-events: auto !important;
}

/* Start conversation button - in profile box */
.tk-profile-box .tk-start-conversation {
    background: #28a745 !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    cursor: pointer !important;
    height: 30px !important;
    border: none !important;
    line-height: 18px !important;
    display: inline-flex !important;
    align-items: center !important;
    pointer-events: auto !important;
}

/* Button layout defined below */

/* Icons in buttons - NO OVERLAP - NUCLEAR OVERRIDE */
.tk-profile-box .tk-btn i,
.tk-profile-edit-box .tk-btn i {
    font-size: 12px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    display: inline-block !important;
    vertical-align: baseline !important;
    position: static !important;
    float: none !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Button text should not be affected by icons */
.tk-profile-box .tk-btn span,
.tk-profile-edit-box .tk-btn span {
    display: inline-block !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: normal !important;
}

/* Ensure text doesn't overlap - override previous styles */
.tk-profile-box .tk-btn,
.tk-profile-edit-box .tk-btn {
    overflow: visible !important;
    position: relative !important;
    z-index: auto !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

/* Icon buttons (email, whatsapp) - for both boxes */
.tk-profile-edit-box .tk-btn-icon,
.tk-profile-box .tk-btn-icon {
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #6c757d !important;
    border-radius: 4px !important;
    background: white !important;
    border: 1px solid #dee2e6 !important;
}

.tk-profile-edit-box .tk-btn-icon:hover,
.tk-profile-box .tk-btn-icon:hover {
    background: #f8f9fa !important;
    border-color: #adb5bd !important;
}

/* Icon size in icon buttons */
.tk-profile-box .tk-btn-icon i,
.tk-profile-edit-box .tk-btn-icon i {
    font-size: 14px !important;
}

/* Close button - for both boxes */
.tk-profile-edit-box .tk-top-bar .tk-close,
.tk-profile-box .tk-top-bar .tk-close {
    width: 30px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    color: #dc3545 !important;
    background: white !important;
    border: 1px solid #dc3545 !important;
    border-radius: 4px !important;
}

.tk-profile-edit-box .tk-top-bar .tk-close:hover,
.tk-profile-box .tk-top-bar .tk-close:hover {
    background: #dc3545 !important;
    color: white !important;
}

/* Close icon */
.tk-profile-edit-box .tk-close i,
.tk-profile-box .tk-close i {
    font-size: 14px !important;
}

/* Main content - NOT flex - for both boxes */
.tk-profile-edit-box .tk-main,
.tk-profile-box .tk-main {
    display: block !important;
    padding: 20px !important;
    background: white !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    max-height: calc(85vh - 52px) !important;
    justify-content: unset !important;
}

/* Override admin.css 50% width */
.tk-profile-edit-box .tk-main > div,
.tk-profile-box .tk-main > div {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    height: auto !important;
}

/* Sections */
.tk-profile-edit-box .tk-details,
.tk-profile-edit-box .tk-additional-details {
    display: block !important;
    margin-bottom: 20px !important;
    width: 100% !important;
}

/* Section titles */
.tk-profile-edit-box .tk-title {
    display: block !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 12px !important;
    padding-bottom: 6px !important;
    border-bottom: 1px solid #e9ecef !important;
}

/* Grid layout */
.tk-profile-edit-box .tk-edit-box {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    width: 100% !important;
}

/* Input container */
.tk-profile-edit-box .tk-input {
    display: block !important;
    position: relative !important;
}

/* Input labels */
.tk-profile-edit-box .tk-input span {
    display: block !important;
    font-size: 11px !important;
    color: #6c757d !important;
    margin-bottom: 4px !important;
    font-weight: 500 !important;
}

/* Inputs */
.tk-profile-edit-box input,
.tk-profile-edit-box select {
    width: 100% !important;
    height: 32px !important;
    padding: 6px 10px !important;
    border: 1px solid #dee2e6 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
}

.tk-profile-edit-box input:focus,
.tk-profile-edit-box select:focus {
    outline: none !important;
    border-color: #0d6efd !important;
    box-shadow: 0 0 0 2px rgba(13,110,253,0.1) !important;
}

/* Profile image field */
.tk-profile-edit-box .tk-profile-image {
    grid-column: 1 / -1 !important;
    text-align: center !important;
}

.tk-profile-edit-box .tk-profile-image .image {
    width: 70px !important;
    height: 70px !important;
    border-radius: 50% !important;
    background-size: cover !important;
    background-position: center !important;
    background-color: #f8f9fa !important;
    margin: 8px auto !important;
    display: inline-block !important;
    border: 2px solid #dee2e6 !important;
}

/* Show user_type and department */
.tk-profile-edit-box #user_type,
.tk-profile-edit-box #department {
    display: block !important;
    grid-column: 1 / -1 !important;
}

/* Full width fields */
.tk-profile-edit-box #profile_image,
.tk-profile-edit-box #email,
.tk-profile-edit-box #password,
.tk-profile-edit-box #address,
.tk-profile-edit-box #country {
    grid-column: 1 / -1 !important;
}

/* Delete button */
.tk-profile-edit-box .tk-delete {
    background: #dc3545 !important;
    color: white !important;
    padding: 6px 12px !important;
    border-radius: 4px !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    display: inline-block !important;
    margin-top: 12px !important;
    cursor: pointer !important;
}

/* Scrollbar */
.tk-profile-edit-box .tk-main::-webkit-scrollbar {
    width: 6px !important;
}

.tk-profile-edit-box .tk-main::-webkit-scrollbar-thumb {
    background: #dee2e6 !important;
    border-radius: 3px !important;
}

/* Hide info */
.tk-profile-edit-box .tk-info {
    display: none !important;
}

/* Remove emoji icons */
.tk-profile-edit-box .tk-input span::before {
    content: none !important;
}

/* Mobile */
@media (max-width: 640px) {
    .tk-profile-edit-box {
        width: 95% !important;
    }
    
    .tk-profile-edit-box .tk-edit-box {
        grid-template-columns: 1fr !important;
    }
    
    .tk-profile-edit-box .tk-input {
        grid-column: 1 / -1 !important;
    }
}

/* Ensure visibility */
.tk-profile-edit-box * {
    visibility: visible !important;
    opacity: 1 !important;
}

/* NUCLEAR OPTION - Force proper button layout */
body .tk-profile-box .tk-btn,
body .tk-profile-edit-box .tk-btn {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    white-space: nowrap !important;
}

/* NUCLEAR OPTION - Force icon positioning */
body .tk-profile-box .tk-btn i,
body .tk-profile-edit-box .tk-btn i {
    position: static !important;
    float: none !important;
    margin: 0 !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}