/* Stile generale del contenitore della chat */
#ccp-chat-container {
    display: flexbox;
    width: 80%;
    max-width: 100%;
    margin: 20px auto;
    border: 1px solid #ccc;
    border-radius: 10px;
    background-color: #f9f9f9;
}

/* Contenitore dei messaggi */
#ccp-chat-messages {
    flex: 1;
    max-height: 500px;
    max-width: 100%;
    overflow-y: auto;
    padding: 10px;
    background-color: #fff;
}

#ccp-chat-input{ width: 70;}

/* Sidebar per le notifiche e gli utenti online */
#ccp-chat-sidebar {
    width: 200px;
    border-left: 1px solid #ddd;
    padding: 10px;
}

#ccp-chat-sidebar h3 {
    margin-top: 0;
    display: flex;
    align-items: center;
}

#ccp-notification-icon {
    cursor: pointer;
    margin-left: 5px;
}

#ccp-notification-icon.new-messages {
    color: red;
    animation: blinker 1s linear infinite;
}

@keyframes blinker {
  50% { opacity: 0; }
}

#ccp-online-users {
    margin-top: 10px;
}

.ccp-online-user {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.ccp-online-user img {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    margin-right: 10px;
}

/* Stile dei singoli messaggi */
.ccp-message {
    display: flex;
    align-items: flex-start;
    margin-bottom: 15px;
}

.ccp-message .ccp-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
}

.ccp-message .ccp-message-content {
    max-width: 70%;
    background-color: #e0e0e0;
    padding: 10px;
    border-radius: 10px;
    position: relative;
    color: #000;
}

.ccp-message .ccp-message-content a {
    color: #0066cc;
    text-decoration: underline;
}

.ccp-message .ccp-message-content::after {
    content: '';
    position: absolute;
    top: 10px;
    left: -10px;
    width: 0;
    height: 0;
    border: 10px solid transparent;
    border-right-color: #e0e0e0;
    border-left: 0;
    margin-top: -5px;
    margin-left: -10px;
}

.ccp-message.self {
    flex-direction: row-reverse;
}

.ccp-message.self .ccp-avatar {
    margin-left: 10px;
    margin-right: 0;
}

.ccp-message.self .ccp-message-content {
    background-color: #6e869d;
    color: #fff;
}

.ccp-message.self .ccp-message-content a {
    color: #cce4ff;
}

.ccp-message.self .ccp-message-content::after {
    left: auto;
    right: -10px;
    border-right-color: transparent;
    border-left-color: #0084ff;
    margin-left: 0;
    margin-right: -10px;
}

/* Form della chat */
#ccp-chat-form {
    width: 100%;
    padding: 10px;
    border-top: 1px solid #ddd;
    background-color: #f9f9f9;
}

/* Input del messaggio */
#ccp-chat-input {
    min-height: 80px;
    width: 100%;
    display: block;
    border: 1px solid #ccc;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
    background-color: #fff;
    color: #000;
    overflow-y: auto;
    position: relative;
}

#ccp-chat-input:empty:before {
    content: attr(data-placeholder);
    color: #999;
    position: absolute;
    left: 15px;
    top: 10px;
    pointer-events: none;
}

/* Controlli della chat */
#ccp-chat-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}

#ccp-chat-controls button,
#ccp-chat-controls input[type="file"] {
    margin-right: 5px;
}

#ccp-chat-controls button:last-child {
    margin-right: 0;
}

#ccp-chat-controls button {
    padding: 5px 10px;
    border: none;
    background-color: #ddd;
    border-radius: 5px;
    cursor: pointer;
}

#ccp-chat-controls button:hover {
    background-color: #ccc;
}

#ccp-chat-controls input[type="file"] {
    padding: 5px;
}

#ccp-chat-controls button[type="submit"] {
    background-color: #0084ff;
    color: #fff;
}

#ccp-chat-controls button[type="submit"]:hover {
    background-color: #006bb3;
}

/* Stile per il pulsante di registrazione */
#ccp-audio-record-btn {
    background-color: #ff6666;
    color: #fff;
}

/* Stile per l'indicatore di registrazione */
#ccp-recording-status {
    margin-top: 10px;
    font-weight: bold;
    color: #ff0000;
}

/* Stile per i media */
.ccp-message img,
.ccp-message video,
.ccp-message audio {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 5px 0;
}

/* Stili per i pulsanti di feedback */
.ccp-feedback {
    margin-top: 5px;
}

.ccp-feedback button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.ccp-feedback button:focus {
    outline: none;
}

.ccp-feedback button:hover {
    color: #0073aa;
}

/* Responsività per tablet */
@media (max-width: 768px) {
    #ccp-chat-container {
        flex-direction: column;
        width: 90%;
    }

    #ccp-chat-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #ddd;
        margin-top: 10px;
    }
}

/* Responsività per smartphone */
@media (max-width: 480px) {
    #ccp-chat-container {
        width: 100%;
    }
}
