/* Profile Menu Styles */
.profile-menu-container {
    position: relative;
    display: inline-block;
}

.profile-menu-container--open,
.profile-menu-container:has(.profile-menu-dropdown.show) {
    z-index: 1101 !important;
}

.profile-menu-dropdown.show {
    z-index: 1102 !important;
    background-color: #fff !important;
    border: 1px solid rgba(0, 0, 0, 0.12) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16) !important;
}

.profile-menu-dropdown.show .dropdown-item {
    background-color: #fff !important;
}

/* Keep header (and dropdown) above profile tabs/content while menu is open */
.profile-header:has(.profile-menu-dropdown.show),
.profile-header:has(.profile-menu-container--open),
body.profile-menu-open .profile-header {
    z-index: 1100 !important;
}

.profile-header .profile-info,
.profile-header .profile-actions,
.profile-header .profile-menu-container {
    overflow: visible !important;
}

/* Keep profile menu at end of row and prevent shifting on resize (phones, tablets, desktop) */
.profile-actions .profile-menu-container {
    margin-left: auto;
    flex-shrink: 0;
}

.profile-menu-trigger {
    background: none;
    border: none;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 50%;
    transition: all 0.2s ease;
    color: #6c757d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.profile-menu-trigger:hover {
    background-color: rgba(0, 0, 0, 0.1);
    color: #495057;
}

.profile-menu-trigger:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.profile-menu-dropdown {
    min-width: 200px;
    background-color: #fff !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 8px 0;
}

.profile-menu-dropdown .dropdown-item {
    padding: 10px 16px;
    font-size: 14px;
    transition: all 0.2s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
}

.profile-menu-dropdown .dropdown-item:hover {
    background-color: #f8f9fa;
    color: inherit;
}

.profile-menu-dropdown .dropdown-item.text-danger:hover {
    background-color: #f8d7da;
    color: #721c24;
}

.profile-menu-dropdown .dropdown-item.text-warning:hover {
    background-color: #fff3cd;
    color: #856404;
}

.profile-menu-dropdown .dropdown-item.text-secondary:hover {
    background-color: #e2e3e5;
    color: #383d41;
}

.profile-menu-dropdown .dropdown-item i {
    width: 16px;
    margin-right: 8px;
    text-align: center;
}

.profile-menu-dropdown .dropdown-divider {
    margin: 8px 0;
    border-top: 1px solid #dee2e6;
}

/* RTL: Persian profile menu — overrides profile-layout-fixes .profile-header { direction: ltr } */
.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl,
.profile-header .profile-menu-dropdown[dir="rtl"] {
    direction: rtl !important;
    text-align: right !important;
}

.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl .dropdown-item,
.profile-header .profile-menu-dropdown[dir="rtl"] .dropdown-item,
.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl button.dropdown-item,
.profile-header .profile-menu-dropdown[dir="rtl"] button.dropdown-item {
    direction: rtl !important;
    text-align: right !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
    unicode-bidi: isolate;
}

.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl .dropdown-item i,
.profile-header .profile-menu-dropdown[dir="rtl"] .dropdown-item i {
    width: 16px;
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
    text-align: center;
}

/* Beat profile-header .me-2 / .ms-2 margin locks inside the menu */
.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl .dropdown-item [class*="me-"],
.profile-header .profile-menu-dropdown.profile-menu-dropdown--rtl .dropdown-item [class*="ms-"],
.profile-header .profile-menu-dropdown[dir="rtl"] .dropdown-item [class*="me-"],
.profile-header .profile-menu-dropdown[dir="rtl"] .dropdown-item [class*="ms-"] {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

html[dir="rtl"] .profile-actions .profile-menu-container {
    margin-left: 0;
    margin-right: auto;
}

/* Mobile bottom sheet — Persian RTL (more options on guest profile) */
.mobile-bottom-sheet[dir="rtl"] .mobile-bottom-sheet-header,
.mobile-bottom-sheet[dir="rtl"] .mobile-bottom-sheet-title {
    direction: rtl !important;
    text-align: right !important;
}

.mobile-bottom-sheet[dir="rtl"] .mobile-bottom-sheet-action-btn {
    direction: rtl !important;
    text-align: right !important;
    flex-direction: row !important;
    justify-content: flex-start !important;
}

.mobile-bottom-sheet[dir="rtl"] .mobile-bottom-sheet-action-btn > span:not(.mobile-bottom-sheet-margin-icon) {
    text-align: right !important;
}

.mobile-bottom-sheet[dir="rtl"] .mobile-bottom-sheet-action-btn i {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* Blocked Users Page Styles */
.blocked-user-card {
    transition: all 0.2s ease;
    border: 1px solid #dee2e6;
}

.blocked-user-card:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.blocked-user-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.unblock-btn {
    transition: all 0.2s ease;
}

.unblock-btn:hover {
    transform: scale(1.1);
}

/* Empty State Styles */
.empty-state {
    padding: 4rem 2rem;
    text-align: center;
}

.empty-state i {
    opacity: 0.5;
    margin-bottom: 1rem;
}

/* Alert Styles */
.alert {
    border-radius: 8px;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .profile-menu-dropdown {
        min-width: 180px;
    }
    
    .blocked-user-card .card-body {
        padding: 1rem;
    }
    
    .blocked-user-avatar {
        width: 40px;
        height: 40px;
    }
}

/* Animation for loading states */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.fa-spinner {
    animation: spin 1s linear infinite;
}

/* Success/Error states */
.text-success {
    color: #28a745 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-warning {
    color: #ffc107 !important;
}

.text-secondary {
    color: #6c757d !important;
}
