/* Social Page Styles */

/* Mutuals and Following List */
.social-users-section {
    padding: 1rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--secondary);
    padding-bottom: 2rem;
}

.social-users-scroll {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.5rem 0;
    scrollbar-width: thin;
    scrollbar-color: var(--secondary) transparent;
}

.social-users-scroll::-webkit-scrollbar {
    height: 6px;
}

.social-users-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.social-users-scroll::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

.social-user-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 80px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.social-user-item:hover {
    transform: translateY(-2px);
}

.social-user-avatar-container {
    position: relative;
    width: 64px;
    height: 64px;
}

.social-user-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.social-user-avatar.recent-upload {
    border: 3px solid;
    border-image: linear-gradient(90deg, var(--gradient-1), var(--gradient-2)) 1;
}

.social-user-avatar-placeholder {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary);
    border: 3px solid transparent;
    transition: border-color 0.3s ease;
}

.social-user-avatar-placeholder.recent-upload {
    border: 3px solid;
    border-image: linear-gradient(90deg, var(--gradient-1), var(--gradient-2)) 1;
}

.social-user-status {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-user-status.mutual {
    background: var(--gradient-2);
}

.social-user-status.mutual.offline {
    background: var(--secondary);
}

.social-user-status.following {
    background: #10B981;
}

.social-user-status.following.offline {
    display: none;
}

.social-user-status-icon {
    width: 12px;
    height: 12px;
    fill: var(--background);
}

.social-user-name {
    font-size: 0.75rem;
    color: var(--primary);
    text-align: center;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty state for mutuals */
.social-users-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--secondary);
    font-size: 0.9rem;
}

/* Chat Section */
.chats-section {
    padding: 1rem;
    max-width: 1200px;
    margin: 0 auto;
}

.chat-filters {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.chat-filters::-webkit-scrollbar {
    height: 6px;
}

.chat-filters::-webkit-scrollbar-track {
    background: transparent;
}

.chat-filters::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.chat-filters::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.chat-filter-pill {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 50px;
    background: var(--card);
    color: var(--primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    white-space: nowrap;
}

.chat-filter-pill:hover {
    background: #2A2A2E;
    transform: translateY(-2px);
}

.chat-filter-pill.active {
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
}

.chats-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--card);
    border-radius: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.chat-item:hover {
    background: #2A2A2E;
    transform: translateX(4px);
}

.chat-item.unread {
    font-weight: 600;
}

.chat-item-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.chat-item-avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.chat-item-group-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    flex-shrink: 0;
}

.chat-item-info {
    flex: 1;
    min-width: 0;
}

.chat-item-name {
    font-size: 1rem;
    color: var(--primary);
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-item-status {
    font-size: 0.85rem;
    color: var(--secondary);
}

.chat-item-unread {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-2);
    flex-shrink: 0;
}

.chat-move-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    border: none;
    border-radius: 0.5rem;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.chat-move-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-popup-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.chat-popup-content {
    position: relative;
    width: 100%;
    max-width: 600px;
    height: 80vh;
    max-height: 800px;
    background: var(--card);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
}

.chat-close-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.chat-close-btn svg {
    width: 20px;
    height: 20px;
}

.chat-header-user {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-header-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-header-avatar .avatar-placeholder {
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

.chat-header-info {
    flex: 1;
    min-width: 0;
}

.chat-header-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-header-status {
    font-size: 0.85rem;
    color: var(--secondary);
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
    position: relative;
}

.chat-header-action-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.chat-header-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-header-action-btn svg {
    width: 20px;
    height: 20px;
}

.chat-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card);
    border-radius: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    z-index: 1000;
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-menu-item {
    display: block;
    width: 100%;
    padding: 0.75rem 1rem;
    background: none;
    border: none;
    color: var(--primary);
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease;
}

.chat-menu-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--secondary);
    border-radius: 3px;
}

.new-messages-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
    color: var(--secondary);
    font-size: 0.85rem;
}

.new-messages-divider::before,
.new-messages-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
}

.message {
    display: flex;
    gap: 0.5rem;
    max-width: 70%;
    animation: messageSlideIn 0.3s ease;
}

.message:has(.shared-post-card) {
    max-width: 50%;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.sent {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message.received {
    align-self: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    word-wrap: break-word;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-content:has(.shared-post-card) {
    padding: 0.5rem;
    max-width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.message.sent .message-content {
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    color: var(--primary);
    border-bottom-right-radius: 0.25rem;
}

.message.received .message-content {
    background: var(--background);
    color: var(--primary);
    border-bottom-left-radius: 0.25rem;
}

.message-text {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.4;
}

.message-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.5rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    justify-content: flex-end;
}

.message-time {
    margin-left: auto;
}

.message-edited {
    font-style: italic;
}

.message-deleted {
    font-style: italic;
    opacity: 0.6;
}

.message-seen {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.message-seen-icons {
    display: flex;
    gap: -0.5rem;
    margin-left: 0.5rem;
}

.message-seen-icon {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid var(--card);
    margin-left: -4px;
}

.message-seen-icon:first-child {
    margin-left: 0;
}

.message-reactions {
    display: flex;
    gap: 0.25rem;
    margin-top: 0.25rem;
    flex-wrap: wrap;
}

.message-reaction {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-reaction:hover {
    background: rgba(255, 255, 255, 0.2);
}

.message-reaction-emoji {
    font-size: 0.9rem;
}

.message-reaction-count {
    color: var(--primary);
}

.shared-post-card {
    margin: 0;
    border-radius: 0.5rem;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s ease;
    max-height: 25vh;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.shared-post-card:hover {
    transform: scale(1.02);
}

.shared-post-card img {
    width: 100%;
    height: auto;
    max-height: 20vh;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.shared-post-card-info {
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
}

.shared-post-card-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.shared-post-card-location {
    font-size: 0.75rem;
    color: var(--secondary);
}

.chat-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-attach-btn,
.chat-send-btn {
    background: none;
    border: none;
    color: var(--primary);
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
    flex-shrink: 0;
}

.chat-attach-btn:hover,
.chat-send-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-attach-btn svg,
.chat-send-btn svg {
    width: 20px;
    height: 20px;
}

.chat-send-btn {
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    color: var(--primary);
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.chat-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--background);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    border-color: var(--gradient-1);
}

/* Reaction Picker */
.reaction-picker {
    position: absolute;
    background: var(--card);
    border-radius: 2rem;
    padding: 0.5rem;
    display: flex;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 100;
}

.reaction-emoji {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: transform 0.2s ease;
    border-radius: 50%;
}

.reaction-emoji:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.1);
}

/* Share to Chat Modal */
.share-to-chat-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.share-to-chat-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
}

.share-to-chat-content {
    position: relative;
    width: 100%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--card);
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.share-to-chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.share-to-chat-header h3 {
    margin: 0;
    color: var(--primary);
}

.share-to-chat-close {
    background: none;
    border: none;
    color: var(--primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.share-to-chat-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.share-to-chat-list {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.share-to-chat-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 0.5rem;
}

.share-to-chat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.share-to-chat-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.share-to-chat-item-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.share-to-chat-item-avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--background);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary);
}

.share-to-chat-item-name {
    flex: 1;
    color: var(--primary);
}

.share-to-chat-send-btn {
    margin: 1rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(90deg, var(--gradient-1), var(--gradient-2));
    border: none;
    border-radius: 50px;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.share-to-chat-send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .chat-popup-content {
        width: calc(100% - 2rem);
        height: calc(100vh - 2rem);
        max-height: calc(100vh - 2rem);
        border-radius: 1rem;
        margin: 1rem;
    }

    .social-users-scroll {
        padding: 0.5rem;
    }

    .social-user-item {
        min-width: 70px;
    }

    .social-user-avatar,
    .social-user-avatar-placeholder {
        width: 56px;
        height: 56px;
    }
}

