/* ============================================
   PROFILE SOCIAL FEATURES - SceneLink Round 9.1
   Edit Profile, Friends System, Messaging, Cuisines
   ============================================ */

/* Hide auth modal on profile page (demo mode) */
#sl-auth-modal {
    display: none !important;
}

/* ---- GLOBAL MODAL STYLES ---- */
.sl-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.sl-modal-overlay.active {
    display: flex;
    opacity: 1;
}
.sl-modal {
    background: #111;
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 16px;
    width: 90%;
    max-width: 560px;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
    animation: slModalIn 0.3s ease forwards;
}
@keyframes slModalIn {
    from { transform: translateY(30px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.sl-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.sl-modal-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}
.sl-modal-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
    border: none;
    color: #999;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.sl-modal-close:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}
.sl-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}
.sl-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

/* ---- BUTTONS ---- */
.sl-btn {
    padding: 10px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.sl-btn-primary {
    background: linear-gradient(135deg, #D4AF37, #b8962e);
    color: #0a0a0a;
}
.sl-btn-primary:hover {
    background: linear-gradient(135deg, #e0bf4a, #D4AF37);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}
.sl-btn-secondary {
    background: rgba(255,255,255,0.08);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.12);
}
.sl-btn-secondary:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.sl-btn-danger {
    background: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.25);
}
.sl-btn-danger:hover {
    background: rgba(220, 53, 69, 0.25);
}
.sl-btn-sm {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}
.sl-btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    color: #999;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
}
.sl-btn-icon:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
    color: #D4AF37;
}

/* ---- FORM ELEMENTS ---- */
.sl-form-group {
    margin-bottom: 20px;
}
.sl-form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #aaa;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.sl-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}
.sl-input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.5);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}
.sl-input::placeholder {
    color: #666;
}
textarea.sl-input {
    resize: vertical;
    min-height: 80px;
}
.sl-char-count {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 4px;
}

/* ---- EDIT PROFILE MODAL ---- */
.edit-profile-avatar-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.edit-profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid #D4AF37;
    position: relative;
    flex-shrink: 0;
}
.edit-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.edit-profile-avatar-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    cursor: pointer;
    border-radius: 50%;
}
.edit-profile-avatar:hover .edit-profile-avatar-overlay {
    opacity: 1;
}
.edit-profile-avatar-overlay i {
    color: #fff;
    font-size: 20px;
}
.edit-profile-avatar-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.edit-profile-avatar-actions .sl-btn-sm {
    font-size: 12px;
}

/* ---- PROFILE ACTIONS ROW ENHANCEMENT ---- */
.profile-actions-row .btn-edit-profile {
    background: linear-gradient(135deg, #D4AF37, #b8962e);
    color: #0a0a0a;
    border: none;
    padding: 10px 22px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-size: 14px;
}
.profile-actions-row .btn-edit-profile:hover {
    background: linear-gradient(135deg, #e0bf4a, #D4AF37);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(212, 175, 55, 0.3);
}

/* ---- FIX: Ensure View All Friends button is visible ---- */
.profile-widget .btn-view-all {
    display: block !important;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: rgba(212, 175, 55, 0.08);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 10px;
    color: #D4AF37;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.profile-widget .btn-view-all:hover {
    background: rgba(212, 175, 55, 0.15);
    border-color: rgba(212, 175, 55, 0.4);
}

/* ---- FRIENDS WIDGET ENHANCED ---- */
.friends-search-wrapper {
    margin-bottom: 14px;
    position: relative;
}
.friends-search-wrapper input {
    width: 100%;
    padding: 10px 14px 10px 36px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    transition: all 0.2s;
    box-sizing: border-box;
}
.friends-search-wrapper input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255,255,255,0.08);
}
.friends-search-wrapper input::placeholder {
    color: #666;
}
.friends-search-wrapper .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 13px;
    pointer-events: none;
}

/* Friend Item Enhanced */
.friend-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
    gap: 12px;
    position: relative;
}
.friend-item:hover {
    background: rgba(255,255,255,0.06);
}
.friend-item img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.friend-info {
    flex: 1;
    min-width: 0;
}
.friend-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.friend-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #888;
}
.friend-status .status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    display: inline-block;
}
.friend-status .status-dot.online {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
.friend-status .status-dot.offline {
    background: #555;
}
.friend-item-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
}
.friend-item:hover .friend-item-actions {
    opacity: 1;
}

/* ---- ALL FRIENDS MODAL ---- */
.friends-modal-tabs {
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
    background: rgba(255,255,255,0.04);
    border-radius: 10px;
    padding: 3px;
}
.friends-modal-tab {
    flex: 1;
    padding: 9px 12px;
    border: none;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
}
.friends-modal-tab.active {
    background: rgba(212, 175, 55, 0.15);
    color: #D4AF37;
}
.friends-modal-tab:hover:not(.active) {
    color: #ccc;
    background: rgba(255,255,255,0.04);
}
.friends-modal-search {
    position: relative;
    margin-bottom: 16px;
}
.friends-modal-search input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s;
}
.friends-modal-search input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.4);
    background: rgba(255,255,255,0.08);
}
.friends-modal-search input::placeholder {
    color: #666;
}
.friends-modal-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 14px;
}
.friends-modal-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 400px;
    overflow-y: auto;
}
.friends-modal-list::-webkit-scrollbar {
    width: 5px;
}
.friends-modal-list::-webkit-scrollbar-track {
    background: transparent;
}
.friends-modal-list::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 4px;
}
.friend-modal-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    gap: 14px;
    transition: all 0.2s;
}
.friend-modal-item:hover {
    background: rgba(255,255,255,0.05);
}
.friend-modal-item img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.friend-modal-info {
    flex: 1;
    min-width: 0;
}
.friend-modal-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}
.friend-modal-meta {
    font-size: 12px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 8px;
}
.friend-modal-meta .mutual {
    color: #D4AF37;
}
.friend-modal-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
/* Add Friend search result */
.friend-add-item {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-radius: 10px;
    gap: 14px;
    transition: all 0.2s;
}
.friend-add-item:hover {
    background: rgba(255,255,255,0.05);
}
.friend-add-item img {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    flex-shrink: 0;
}
.friend-add-info {
    flex: 1;
}
.friend-add-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.friend-add-detail {
    font-size: 12px;
    color: #888;
}
.btn-add-friend {
    padding: 7px 16px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid rgba(212, 175, 55, 0.4);
    background: rgba(212, 175, 55, 0.1);
    color: #D4AF37;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-add-friend:hover {
    background: rgba(212, 175, 55, 0.2);
}
.btn-add-friend.sent {
    border-color: rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #888;
    cursor: default;
}
.friends-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}
.friends-empty-state i {
    font-size: 36px;
    margin-bottom: 12px;
    color: #444;
}
.friends-empty-state p {
    font-size: 14px;
    margin: 0;
}

/* ---- MESSAGE MODAL ---- */
.sl-modal.message-modal {
    max-width: 480px;
    height: 70vh;
    max-height: 600px;
}
.message-recipient {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.message-recipient img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
}
.message-recipient-info {
    flex: 1;
}
.message-recipient-name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}
.message-recipient-status {
    font-size: 12px;
    color: #22c55e;
}
.message-thread {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.message-thread::-webkit-scrollbar {
    width: 4px;
}
.message-thread::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
}
.message-bubble {
    max-width: 78%;
    padding: 11px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}
.message-bubble.received {
    background: rgba(255,255,255,0.08);
    color: #ddd;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}
.message-bubble.sent {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.25), rgba(212, 175, 55, 0.15));
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}
.message-time {
    font-size: 10px;
    color: #666;
    margin-top: 4px;
    display: block;
}
.message-date-divider {
    text-align: center;
    font-size: 11px;
    color: #666;
    padding: 8px 0;
    position: relative;
}
.message-date-divider::before,
.message-date-divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: calc(50% - 50px);
    height: 1px;
    background: rgba(255,255,255,0.06);
}
.message-date-divider::before { left: 0; }
.message-date-divider::after { right: 0; }
.message-input-row {
    display: flex;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid rgba(255,255,255,0.06);
    background: rgba(255,255,255,0.02);
}
.message-input-row input {
    flex: 1;
    padding: 11px 16px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px;
    color: #fff;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s;
}
.message-input-row input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.4);
}
.message-input-row input::placeholder {
    color: #666;
}
.message-send-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D4AF37, #b8962e);
    border: none;
    color: #0a0a0a;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.message-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.3);
}

/* ---- FAVORITE CUISINES ENHANCED ---- */
.cuisine-tags-editable {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.cuisine-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    background: rgba(212, 175, 55, 0.12);
    border: 1px solid rgba(212, 175, 55, 0.25);
    color: #D4AF37;
    transition: all 0.2s;
}
.cuisine-tag .remove-cuisine {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #999;
    font-size: 10px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    padding: 0;
    line-height: 1;
}
.cuisine-tags-editable.editing .cuisine-tag .remove-cuisine {
    display: flex;
}
.cuisine-tag .remove-cuisine:hover {
    background: rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
}
.cuisine-add-row {
    display: none;
    gap: 8px;
    margin-top: 8px;
}
.cuisine-add-row.active {
    display: flex;
}
.cuisine-add-row input {
    flex: 1;
    padding: 8px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
}
.cuisine-add-row input:focus {
    outline: none;
    border-color: rgba(212, 175, 55, 0.4);
}
.cuisine-add-row input::placeholder {
    color: #666;
}
.cuisine-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.cuisine-suggestion-btn {
    padding: 5px 12px;
    border-radius: 16px;
    font-size: 12px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.1);
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
}
.cuisine-suggestion-btn:hover {
    border-color: rgba(212, 175, 55, 0.3);
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.08);
}
.btn-edit-cuisines {
    padding: 6px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.12);
    color: #888;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}
.btn-edit-cuisines:hover {
    border-color: rgba(212, 175, 55, 0.3);
    color: #D4AF37;
}
.btn-edit-cuisines.active {
    border-color: #D4AF37;
    color: #D4AF37;
    background: rgba(212, 175, 55, 0.08);
}

/* ---- TOAST NOTIFICATIONS ---- */
.sl-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a1a;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 14px 24px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 99999;
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.sl-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sl-toast i {
    color: #D4AF37;
    font-size: 16px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
    .sl-modal {
        width: 95%;
        max-height: 90vh;
    }
    .sl-modal.message-modal {
        height: 80vh;
    }
    .friend-item-actions {
        opacity: 1;
    }
    .edit-profile-avatar-section {
        flex-direction: column;
        text-align: center;
    }
    .friends-modal-tabs {
        flex-wrap: wrap;
    }
}