/* Messages Container */
.messages-container {
    display: flex;
    height: calc(100vh - 80px);
    margin-top: 80px;
    background: #000;
    overflow: hidden;
}

/* Conversations Sidebar */
.conversations-sidebar {
    width: 400px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
}

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

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin: 0;
}

.new-message-btn {
    background: none;
    border: none;
    color: #ffd700;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.new-message-btn:hover {
    background: rgba(255, 215, 0, 0.1);
    transform: scale(1.05);
}

.conversations-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.conversations-list::-webkit-scrollbar {
    width: 6px;
}

.conversations-list::-webkit-scrollbar-track {
    background: transparent;
}

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

.conversation-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    margin-bottom: 4px;
    position: relative;
}

.conversation-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.conversation-item.active {
    background: rgba(255, 215, 0, 0.1);
}

.conversation-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

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

.conversation-name {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    margin-bottom: 4px;
}

.conversation-last-message {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.conversation-item.unread .conversation-last-message {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.conversation-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.4);
    position: absolute;
    top: 12px;
    right: 16px;
}

.unread-badge {
    position: absolute;
    bottom: 12px;
    right: 16px;
    background: #ffd700;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.loading {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.5);
}

/* Chat Area */
.chat-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #000;
}

.no-chat-selected {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
}

.no-chat-selected svg {
    margin-bottom: 24px;
    opacity: 0.3;
}

.no-chat-selected h3 {
    font-size: 24px;
    color: #fff;
    margin-bottom: 8px;
}

.no-chat-selected p {
    font-size: 14px;
    margin-bottom: 24px;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
}

.chat-user-info {
    display: flex;
    align-items: center;
}

.chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 12px;
    border: 2px solid rgba(255, 215, 0, 0.3);
}

.chat-username {
    font-weight: 600;
    color: #fff;
    font-size: 16px;
}

.chat-actions {
    display: flex;
    gap: 8px;
}

.chat-action-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.chat-action-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

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

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

.no-messages {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 15px;
    text-align: center;
    padding: 48px 24px;
}

.message {
    display: flex;
    gap: 8px;
    max-width: 70%;
    animation: messageSlideIn 0.2s ease-out;
}

@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-content {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 16px;
    border-radius: 18px;
    color: #fff;
    word-wrap: break-word;
    position: relative;
}

.message.sent .message-content {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.3);
    margin-top: 4px;
    text-align: right;
}

.message.sent .message-time {
    color: rgba(0, 0, 0, 0.4);
}

.chat-input-container {
    padding: 16px 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 8px 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
}

.chat-input-wrapper:focus-within {
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
}

.chat-input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    font-size: 15px;
    outline: none;
    font-family: 'Inter', sans-serif;
    padding: 8px 0;
}

.chat-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.send-btn {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: none;
    color: #000;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: #1a1a1a;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
}

.modal-large {
    max-width: 600px;
    max-height: 85vh;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.modal-header h3 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

.modal-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.close-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    padding: 4px;
    transition: all 0.2s;
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.search-users {
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.search-input-wrapper {
    position: relative;
    margin-bottom: 16px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.3);
    pointer-events: none;
}

.search-users input {
    width: 100%;
    padding: 14px 16px 14px 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s;
}

.search-users input:focus {
    outline: none;
    border-color: #ffd700;
    background: rgba(255, 255, 255, 0.08);
}

.search-users input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.search-results {
    flex: 1;
    overflow-y: auto;
    margin-top: 8px;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: transparent;
}

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

.search-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.3);
    text-align: center;
}

.search-hint svg {
    margin-bottom: 16px;
    opacity: 0.5;
}

.search-hint p {
    font-size: 14px;
    margin: 0;
}

.search-loading {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.search-no-results {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.user-search-item {
    display: flex;
    align-items: center;
    padding: 12px;
    cursor: pointer;
    border-radius: 12px;
    transition: all 0.2s;
    gap: 12px;
}

.user-search-item:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.user-search-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 215, 0, 0.3);
    flex-shrink: 0;
}

.user-search-info {
    flex: 1;
    min-width: 0;
}

.user-search-name {
    font-weight: 600;
    color: #fff;
    font-size: 15px;
    margin-bottom: 2px;
}

.user-search-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
}

.user-search-points {
    color: rgba(255, 215, 0, 0.8);
}

.user-search-rank {
    color: rgba(255, 255, 255, 0.5);
}

.user-search-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-message {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.btn-message:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

/* Notificaciones */
.notification-container {
    position: fixed;
    top: 100px;
    right: 24px;
    z-index: 10001;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
}

.notification {
    background: rgba(26, 26, 26, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(20px);
    animation: notificationSlideIn 0.3s ease-out;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.notification:hover {
    transform: translateX(-4px);
    border-color: rgba(255, 215, 0, 0.5);
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.notification.removing {
    animation: notificationSlideOut 0.3s ease-out forwards;
}

@keyframes notificationSlideOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.notification-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 215, 0, 0.3);
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-sender {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    margin-bottom: 4px;
}

.notification-message {
    color: rgba(255, 255, 255, 0.7);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.notification-time {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin-top: 4px;
}

.notification-badge {
    background: #ffd700;
    color: #000;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .notification-container {
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .conversations-sidebar {
        width: 100%;
        border-right: none;
    }

    .chat-area {
        position: fixed;
        top: 80px;
        left: 0;
        right: 0;
        bottom: 0;
        display: none;
    }

    .chat-area.active {
        display: flex;
    }

    .message {
        max-width: 85%;
    }
}

/* Buttons */
.btn-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 15px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(255, 215, 0, 0.3);
}
