/* ENVELOPE ICON - Movido para topo.php */
/* .envelope-icon {
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
    margin-right: 0;
    color: white;
    transition: all 0.3s ease;
} */

/* .envelope-icon:hover {
		color: #6B5DF5;
		transform: scale(1.1);
	} */

.envelope-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #ff4757;
    color: white;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    min-width: 20px;
}

/* MESSAGE BUTTON IN PROFILE */
.msg-btn-container {
    position: relative;
    display: flex;
    width: auto;
    text-align: left;
    margin: 0;
}

.msg-btn {
    background: linear-gradient(135deg, #6B5DF5 0%, #8E82F8 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin: 0;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100;
    width: fit-content;
}

.msg-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 93, 245, 0.3);
}

.msg-btn i {
    font-size: 14px;
}

.msg-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    display: none;
    z-index: 1000;
    margin-top: 5px;
    white-space: nowrap;
}

.msg-dropdown.show {
    display: block;
}

.msg-dropdown a {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    font-size: 15px;
}

.msg-dropdown a:last-child {
    border-bottom: none;
}

.msg-dropdown a:hover {
    background-color: #f5f5f5;
    padding-left: 20px;
}

/* MODAL ENVIAR MENSAGEM */
.msg-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.msg-modal.show {
    display: flex;
}

.msg-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    animation: msgModalSlideUp 0.3s ease;
    display: flex;
    flex-direction: column;
    max-height: 85vh;
}

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

.msg-modal-header {
    background: linear-gradient(135deg, #6B5DF5 0%, #8E82F8 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.msg-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.msg-modal-close:hover {
    transform: rotate(90deg);
}

.msg-modal-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    gap: 15px;
}

.msg-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.msg-form-group {
    display: flex;
    flex-direction: column;
}

.msg-form-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    font-size: 14px;
}

.msg-form-group input[type="text"],
.msg-form-group textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 14px;
    transition: all 0.3s ease;
}

.msg-form-group input[type="text"]:focus,
.msg-form-group textarea:focus {
    outline: none;
    border-color: #6B5DF5;
    box-shadow: 0 0 0 3px rgba(107, 93, 245, 0.1);
}

.msg-form-group textarea {
    resize: vertical;
    min-height: 120px;
    max-height: 300px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.msg-form-options {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0 10px 0;
}

.msg-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: text;
    font-size: 13px;
    color: #666;
    transition: all 0.3s ease;
}

.msg-checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--cor-primaria, #6B5DF5);
}

.msg-checkbox-label:hover {
    color: var(--cor-primaria, #333);
}

.msg-form-btn {
    background: linear-gradient(135deg, #6B5DF5 0%, #8E82F8 100%);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.msg-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 93, 245, 0.3);
}

.msg-form-btn:active {
    transform: translateY(0);
}

.msg-form-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* HISTÓRICO DE MENSAGENS */
.messages-history {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 0;
}

.message-item {
    display: flex;
    margin-bottom: 5px;
    gap: 10px;
    width: 100%;
}

.message-item.sent {
    justify-content: flex-end !important;
}

.message-item.received {
    justify-content: flex-start !important;
}

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

.message-bubble {
    padding: 10px 14px;
    border-radius: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
    font-size: 14px;
    line-height: 1.4;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-bubble:hover {
    opacity: 0.9;
}

.message-item.sent .message-bubble {
    background: linear-gradient(135deg, #6B5DF5 0%, #8E82F8 100%);
    color: white;
    border-bottom-right-radius: 4px;
    opacity: 0.5;
}

.message-item.received .message-bubble {
    background-color: #f0f0f0;
    color: #333;
    border-bottom-left-radius: 4px;
}

/* Estilo para mensagens deletadas para todos */
.message-item.deletada .message-bubble {
    background: transparent !important;
    color: #999 !important;
    font-style: italic;
    opacity: 0.7 !important;
}

.message-time {
    font-size: 12px;
    color: #999;
    margin-top: 6px;
    padding: 0 10px;
    animation: fadeIn 0.2s ease;
}

.message-status {
    font-size: 11px;
    margin-left: 4px;
    display: inline;
}

.message-status.enviada {
    color: #999;
}

.message-status.entregue {
    color: #999;
}

.message-status.lida {
    color: #4fc3f7;
}

.message-edited-label {
    font-size: 11px;
    color: #999;
    margin-top: 2px;
    font-style: italic;
    display: inline-block;
    margin-left: 6px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-item.sent .message-time {
    text-align: right;
}

.message-item.received .message-time {
    text-align: left;
}

/* LISTA DE CONVERSAS */
.conversations-list {
    display: flex;
    flex-direction: column;
}

.conversation-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.conversation-item:hover {
    background-color: #f5f5f5;
}

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

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

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

.conversation-message {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.conversation-unread {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background-color: #ff4757;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    font-weight: bold;
}

/* MODO SELEÇÃO MÚLTIPLA */
.msg-checkbox-selector {
    flex-shrink: 0;
    cursor: pointer;
    width: 20px !important;
    height: 20px !important;
}

.msg-checkbox-selector:hover {
    transform: scale(1.15);
    transition: transform 0.2s ease;
}

#msgDeleteMultipleContainer {
    animation: msgModalSlideUp 0.3s ease;
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .msg-modal-content {
        width: 95%;
        max-width: 95%;
        max-height: 70vh;
    }

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

    .msg-dropdown {
        left: 0;
    }

    .msg-dropdown a {
        font-size: 15px;
    }

    /* .envelope-icon {
        margin-right: 10px;
    } */

    .msg-btn-container {
        width: auto;
        text-align: left;
        display: block;
        margin: 12px 0 15px 0;
        position: relative;
        top: -17px;
        margin-bottom: -5px;
    }

    .msg-btn {
        justify-content: center;
        display: flex;
    }

    .message-item.sent .message-bubble,
    .message-item.received .message-bubble {
        font-size: 13px;
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    .msg-modal-content {
        border-radius: 0;
        height: auto;
        max-height: 80vh;
        margin: 20px 0;
    }

    .msg-modal-body {
        max-height: calc(80vh - 150px);
    }

    .message-bubble {
        max-width: 100%;
    }

    /* .envelope-icon {
        font-size: 16px;
    } */

    .msg-btn-container {
        width: auto;
        text-align: left;
        display: block;
        margin: 12px 0 15px 0;
        position: relative;
        top: -17px;
        margin-bottom: -5px;
    }

    .msg-btn {
        font-size: 13px;
        padding: 6px 10px;
        display: flex;
    }

    .msg-dropdown a {
        font-size: 15px;
    }
}

/* MENU DE OPÇÕES DA MENSAGEM */
.message-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
}

.message-wrapper.sent {
    justify-content: flex-end;
}

.message-wrapper.received {
    justify-content: flex-start;
}

.message-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: fit-content;
    max-width: 70%;
}

.message-options {
    position: absolute;
    top: -30px;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    display: none;
    z-index: 100;
    overflow: hidden;
}

.message-options.show {
    display: flex;
}

.message-options button {
    background: none;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    color: #333;
    transition: all 0.2s ease;
    border-right: 1px solid #f0f0f0;
}

.message-options button:last-child {
    border-right: none;
}

.message-options button:hover {
    background-color: #f5f5f5;
}

.message-options button.delete {
    color: #ff4757;
}

.message-options button.delete:hover {
    background-color: #ffe0e0;
}

/* BOTÃO SEGUIR */
.msg-dropdown a#btn-seguir-container {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    font-size: 15px;
}

.msg-dropdown a[id^="btn-seguir-"] {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: all 0.3s ease;
    font-size: 15px;
}

.msg-dropdown a[id^="btn-seguir-"]:hover {
    background-color: #f5f5f5;
    padding-left: 20px;
}

.msg-dropdown a[id^="btn-seguir-"].seguindo {
    color: #6B5DF5;
    font-weight: 600;
}

.msg-dropdown a[id^="btn-seguir-"].seguindo i {
    color: #6B5DF5;
}

/* BOTÃO SEGUIR - Ao lado do ícone do boneco */
.btn-seguir-perfil {
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
    visibility: visible !important;
    opacity: 1 !important;
    z-index: 100;
    width: fit-content;
    font-family: 'Montserrat', sans-serif;
}

.btn-seguir-perfil:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 93, 245, 0.4);
    filter: brightness(0.9);
}

.btn-seguir-perfil:active {
    transform: translateY(0);
}

.btn-seguir-perfil i {
    font-size: 14px;
}

.btn-seguir-perfil.seguindo {
    /* Estado é controlado por JavaScript */
}

.btn-seguir-perfil.seguindo:hover {
    filter: brightness(0.75) saturate(1.2) !important;
    box-shadow: 0 4px 12px rgba(107, 93, 245, 0.4);
}

/* MENSAGENS */

.message-options button.delete:hover {
    background-color: #ffebee;
}

.message-item:hover .message-options {
    display: flex;
}

/* GRID DE SEGUIDORES E SEGUINDO */
.social-redes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .social-redes-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .social-redes-grid {
        grid-template-columns: repeat(auto-fill, minmax(85px, 1fr));
        gap: 10px;
    }
}

.social-redes-card {
    display: flex;
    flex-direction: column;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.social-redes-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(107, 93, 245, 0.15);
    border-color: #6B5DF5;
}

.social-redes-card img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 8px;
}

@media (max-width: 480px) {
    .social-redes-card img {
        height: 70px;
    }
}

.social-redes-card > div:nth-child(2) {
    font-weight: 600;
    color: #2E2652;
    font-size: 0.85rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.social-redes-card > div:nth-child(3) {
    font-size: 0.7rem;
    color: #999;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.social-redes-card > div:nth-child(4) {
    font-size: 0.7rem;
    color: #6B5DF5;
    font-weight: 700;
}

/* MODAL EDITAR MENSAGEM */
.msg-edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 3000;
    align-items: center;
    justify-content: center;
}

.msg-edit-modal.show {
    display: flex;
}

.msg-edit-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.msg-edit-modal-header {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.msg-edit-modal-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    margin-bottom: 15px;
}

/* IMAGENS NAS MENSAGENS DO ADMIN - SEM BORDA */
.msg-admin-img {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
}

.msg-edit-modal-textarea:focus {
    outline: none;
    border-color: #6B5DF5;
    box-shadow: 0 0 0 3px rgba(107, 93, 245, 0.1);
}

.msg-edit-modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.msg-edit-modal-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.msg-edit-modal-buttons .cancel {
    background: #f0f0f0;
    color: #333;
}

.msg-edit-modal-buttons .cancel:hover {
    background: #e0e0e0;
}

.msg-edit-modal-buttons .save {
    background: linear-gradient(135deg, #6B5DF5 0%, #8E82F8 100%);
    color: white;
}

.msg-edit-modal-buttons .save:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(107, 93, 245, 0.3);
}

