/* Styles de base pour rendre le contenu visible */
.tpge-group-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    max-height: 600px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.tpge-messages-list {
    padding: 15px;
    min-height: 200px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.tpge-message {
    margin-bottom: 16px;
    padding: 12px;
    border-radius: 8px;
    background: #f8f9fa;
    border-left: 4px solid #007cba;
}

.tpge-message:hover {
    background: #f1f3f4;
}

.tpge-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tpge-avatar {
    margin-right: 10px;
}

.tpge-avatar-initial {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.tpge-sender-info {
    flex: 1;
}

.tpge-sender {
    font-weight: 600;
    color: #1a73e8;
    display: block;
    font-size: 13px;
}

.tpge-time {
    color: #5f6368;
    font-size: 11px;
}

.tpge-message-content {
    color: #202124;
}

.tpge-text {
    margin-bottom: 8px;
    word-wrap: break-word;
}

.tpge-text a {
    color: #1a73e8;
    text-decoration: none;
}

.tpge-text a:hover {
    text-decoration: underline;
}

.tpge-media {
    margin: 8px 0;
}

.tpge-photo {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
}

.tpge-video, .tpge-audio {
    max-width: 100%;
    border-radius: 6px;
    display: block;
}

.tpge-video {
    max-height: 500px;
    background: #000;
}

.tpge-media-video {
    margin: 8px 0;
}

.tpge-media-video video {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #e1e1e1;
}

.tpge-video-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 14px;
    background: #202124;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    gap: 8px;
}

.tpge-video-link::before {
    content: '\1F4FA';
    font-size: 15px;
}

.tpge-video-link:hover {
    background: #3c4043;
}

.tpge-document, .tpge-other-media {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: #1a73e8;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 12px;
    gap: 6px;
}

.tpge-document:hover, .tpge-other-media:hover {
    background: #1669d6;
}

/* Styles pour les sondages */
.tpge-poll-results {
    margin-top: 12px;
    padding: 12px;
    background: white;
    border: 1px solid #dadce0;
    border-radius: 6px;
}

.tpge-poll-question {
    font-weight: 600;
    margin-bottom: 10px;
    color: #202124;
    font-size: 14px;
}

.tpge-poll-option {
    margin-bottom: 8px;
}

.tpge-poll-option-text {
    margin-bottom: 4px;
    font-size: 13px;
    color: #3c4043;
}

.tpge-poll-bar {
    height: 6px;
    background: #f1f3f4;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 4px;
}

.tpge-poll-bar-fill {
    height: 100%;
    background: #1a73e8;
    transition: width 0.3s ease;
}

.tpge-poll-numbers {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #5f6368;
}

/* États */
.tpge-loading {
    text-align: center;
    padding: 20px;
    color: #5f6368;
    background: #f8f9fa;
}

.tpge-spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.tpge-no-messages {
    text-align: center;
    padding: 40px 20px;
    color: #5f6368;
}

.tpge-admin-notice {
    margin-top: 10px;
    padding: 8px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.tpge-status-bar {
    display: flex;
    justify-content: space-between;
    padding: 8px 15px;
    background: #f8f9fa;
    border-top: 1px solid #e1e1e1;
    font-size: 11px;
    color: #5f6368;
    cursor: pointer;
    flex: 0 0 auto;
}

.tpge-status-bar:hover {
    background: #f1f3f4;
}

/* Animation pour nouveaux messages */
@keyframes tpge-highlight {
    0% { background-color: #e3f2fd; }
    100% { background-color: #f8f9fa; }
}

.tpge-message.new-message {
    animation: tpge-highlight 2s ease-in-out;
}

/* Styles pour le sélecteur d'emojis - Popup flottant */
.tpge-emoji-picker-popup {
    position: fixed;
    width: 320px;
    height: 350px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.tpge-emoji-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9fa;
}

.tpge-emoji-tabs {
    display: flex;
    gap: 4px;
    flex: 1;
    overflow-x: auto;
    scrollbar-width: thin;
}

.tpge-emoji-tabs::-webkit-scrollbar {
    height: 4px;
}

.tpge-emoji-tab {
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: #5f6368;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    white-space: nowrap;
    transition: all 0.2s;
}

.tpge-emoji-tab:hover {
    background: #e8eaed;
    color: #202124;
}

.tpge-emoji-tab.active {
    background: #1a73e8;
    color: #fff;
}

.tpge-emoji-close {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: #5f6368;
    font-size: 16px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    margin-left: 8px;
}

.tpge-emoji-close:hover {
    background: #e8eaed;
    color: #202124;
}

.tpge-emoji-picker-content {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.tpge-emoji-categories {
    height: 100%;
    position: relative;
}

.tpge-emoji-category {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 12px;
    overflow-y: auto;
    display: none;
    scrollbar-width: thin;
}

.tpge-emoji-category.active {
    display: block;
}

.tpge-emoji-category::-webkit-scrollbar {
    width: 6px;
}

.tpge-emoji-category::-webkit-scrollbar-track {
    background: #f1f3f4;
}

.tpge-emoji-category::-webkit-scrollbar-thumb {
    background: #dadce0;
    border-radius: 3px;
}

.tpge-emoji-category::-webkit-scrollbar-thumb:hover {
    background: #bdc1c6;
}

.tpge-emoji-category-items {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
}

.tpge-emoji-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    user-select: none;
}

.tpge-emoji-item:hover {
    background-color: #f1f3f4;
    transform: scale(1.1);
}

.tpge-emoji-item:active {
    background-color: #e8eaed;
    transform: scale(0.95);
}

.tpge-emoji-btn {
    cursor: pointer;
    transition: opacity 0.2s;
}

.tpge-emoji-btn:hover {
    opacity: 0.8;
}

/* Responsive */
@media (max-width: 768px) {
    .tpge-group-container {
        max-height: 400px;
        font-size: 13px;
    }
    
    .tpge-messages-list {
        padding: 10px;
    }
    
    .tpge-message {
        padding: 10px;
        margin-bottom: 12px;
    }
    
    .tpge-emoji-picker-popup {
        width: 280px;
        height: 300px;
    }
    
    .tpge-emoji-tab {
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .tpge-emoji-category-items {
        grid-template-columns: repeat(6, 1fr);
    }
    
    .tpge-emoji-item {
        width: 28px;
        height: 28px;
        font-size: 18px;
    }
}
