/* Overlay and Modal Container */

.friend-status.online {
    color: #22c55e; /* Verde */
}

.friend-status.away {
    color: #f59e0b; /* Amarelo/Laranja */
}

.friend-status.busy {
    color: #ef4444; /* Vermelho */
}

.friend-status.offline {
    color: #6b7280; /* Cinza */
}

#friends-modal.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px; /* Adiciona padding para telas pequenas */
}

#friends-modal .modal-container {
    background: #181c24;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    max-width: min(480px, calc(100vw - 40px)); /* Responsivo com limite máximo */
    width: 100%;
    margin: 0 auto;
    padding: 0;
    overflow: hidden;
    color: #fff;
    max-height: calc(100vh - 40px); /* Previne overflow vertical */
    display: flex;
    flex-direction: column;
}

#friends-modal .modal-header {
    background: #23283a;
    padding: 20px 24px 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0; /* Mantém header fixo */
}

#friends-modal .modal-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin: 0;
}

#friends-modal .modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: 12px;
    transition: opacity 0.2s;
}

#friends-modal .modal-close:hover {
    opacity: 0.7;
}

#friends-modal .modal-body {
    padding: 20px 24px 0 24px;
    flex: 1;
    overflow-y: auto; /* Permite scroll no body se necessário */
    min-height: 0; /* Fix para Firefox */
}

#friends-modal .modal-footer {
    background: #23283a;
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #23283a;
    flex-shrink: 0; /* Mantém footer fixo */
}

.friends-container {
    padding: 0;
    max-height: 60vh;
    overflow-y: auto;
}

/* Scrollbar customizada */
.friends-container::-webkit-scrollbar,
#friends-modal .modal-body::-webkit-scrollbar {
    width: 8px;
}

.friends-container::-webkit-scrollbar-track,
#friends-modal .modal-body::-webkit-scrollbar-track {
    background: #23283a;
    border-radius: 4px;
}

.friends-container::-webkit-scrollbar-thumb,
#friends-modal .modal-body::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.friends-container::-webkit-scrollbar-thumb:hover,
#friends-modal .modal-body::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.search-input {
    width: 100%;
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    background: #23283a;
    color: #fff;
    outline: none;
    margin-bottom: 0;
}

.friends-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-bottom: 2px solid #23283a;
}

.tab-button {
    flex: 1;
    padding: 10px 0;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 15px;
    color: #aaa;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-bottom 0.2s;
}

.tab-button.active {
    color: #fff;
    border-bottom: 2px solid #2196f3;
    background: #23283a;
}

.friends-list {
    margin-bottom: 12px;
}

.friend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #23283a;
    gap: 10px;
}

.friend-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Permite text truncation */
}

.friend-avatar {
    width: 36px;
    height: 36px;
    background: #2196f3;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0; /* Previne avatar de encolher */
}

.friend-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0; /* Permite text truncation */
}

.friend-name {
    font-weight: 500;
    color: #fff;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-status {
    font-size: 0.85rem;
    color: #6ee7b7;
    font-weight: 400;
}
.friend-status.online {
    color: #6ee7b7;
}
.friend-status.offline {
    color: #f87171;
}

.friend-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* Previne botões de encolher */
}

.action-button {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.action-button.invite {
    background: #22c55e;
    color: #fff;
}
.action-button.remove {
    background: #ef4444;
    color: #fff;
}
.action-button:hover {
    opacity: 0.85;
}

.friend-request-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #23283a;
}

.request-info {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0; /* Permite text truncation */
}

.request-avatar {
    width: 36px;
    height: 36px;
    background: #64748b;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
    flex-shrink: 0; /* Previne avatar de encolher */
}

.request-name {
    font-weight: 500;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.request-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0; /* Previne botões de encolher */
}

.accept-button, .decline-button {
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}
.accept-button {
    background: #22c55e;
    color: #fff;
}
.decline-button {
    background: #ef4444;
    color: #fff;
}

.add-friend-section {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #23283a;
    margin-bottom: 12px;
    padding-bottom: 12px;
    flex-wrap: wrap; /* Permite quebra em telas pequenas */
}

.friend-input {
    flex: 1;
    min-width: 200px; /* Largura mínima antes de quebrar */
    padding: 10px 14px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    background: #23283a;
    color: #fff;
    outline: none;
}

.add-friend-button {
    padding: 10px 20px;
    background: #2196f3;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}
.add-friend-button:hover {
    background: #1769aa;
}

.empty-state {
    text-align: center;
    padding: 32px 0;
    color: #aaa;
    font-size: 1rem;
}

.modal-button {
    padding: 10px 24px;
    background: #64748b;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s;
}
.modal-button:hover {
    background: #475569;
} 

/* Botão de cancelar pedido */
.cancel-button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    background-color: #6c757d;
    color: white;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cancel-button:hover {
    background-color: #5a6268;
}

.request-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cancel {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
}

.btn-cancel:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.05);
}

.btn-cancel:active {
    transform: scale(0.95);
}

.icon-cancel {
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.sent-label {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Media Queries Responsivas */
@media (max-width: 640px) {
    #friends-modal .modal-container {
        max-width: calc(100vw - 32px);
    }
    
    #friends-modal .modal-header,
    #friends-modal .modal-body,
    #friends-modal .modal-footer {
        padding-left: 16px;
        padding-right: 16px;
    }
    
    .friends-container {
        max-height: 50vh;
    }
}

@media (max-width: 480px) {
    #friends-modal.modal-overlay {
        padding: 16px;
    }
    
    #friends-modal .modal-title {
        font-size: 1.2rem;
    }
    
    .action-button {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    
    .friend-input {
        min-width: 150px;
    }
}

@media (max-width: 390px) {
    #friends-modal .modal-container {
        max-width: calc(100vw - 24px);
    }
    
    .friend-actions,
    .request-actions {
        gap: 4px;
    }
    
    .action-button,
    .accept-button,
    .decline-button {
        padding: 4px 8px;
        font-size: 0.8rem;
    }
    
    .add-friend-button {
        padding: 8px 16px;
        font-size: 0.9rem;
    }
}

/* Landscape mode - telas pequenas */
@media (max-height: 500px) and (orientation: landscape) {
    #friends-modal.modal-overlay {
        padding: 10px;
    }
    
    #friends-modal .modal-container {
        max-height: calc(100vh - 20px);
    }
    
    .friends-container {
        max-height: 40vh;
    }
    
    #friends-modal .modal-header {
        padding-top: 12px;
        padding-bottom: 8px;
    }
}


/* Adicione estes estilos ao seu CSS */

.friend-avatar.clickable {
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.friend-avatar.clickable:hover {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

.friend-avatar.clickable:active {
    transform: scale(0.95);
}

/* Botão de visualizar perfil */
.action-button.view-profile {
    background: #007bff;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.action-button.view-profile:hover {
    background: #0056b3;
}

/* Ajustar botão de remover */
.action-button.remove {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.action-button.remove:hover {
    background: #c82333;
}