/* ================================================== */
/* TELEGRAM GROUP PLUGIN - THÈME ULTRA-COMPACT */
/* ================================================== */

/* ===== STYLES DE BASE ULTRA-COMPACTS ===== */
.telegram-group-compact.telegram-group-live {
    border-radius: 4px;
    margin: 4px 0;
    border: 1px solid #e1e8ed;
    background: #fff;
    box-shadow: none;
}

/* ===== EN-TÊTE ULTRA-COMPACTE ===== */
.telegram-group-compact .telegram-group-header {
    padding: 6px 8px;
    gap: 6px;
    background: #667eea;
    color: white;
    min-height: auto;
}

.telegram-group-compact .telegram-group-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
}

.telegram-group-compact .telegram-group-icon svg {
    width: 12px;
    height: 12px;
}

.telegram-group-compact .telegram-group-info h3 {
    font-size: 14px;
    margin: 0;
    line-height: 1.2;
}

.telegram-group-compact .telegram-group-info p {
    font-size: 11px;
    margin: 0;
    opacity: 0.9;
    line-height: 1.2;
}

.telegram-group-compact .telegram-group-status {
    padding: 2px 4px;
    font-size: 10px;
    background: rgba(255, 255, 255, 0.15);
    min-width: auto;
}

.telegram-group-compact .telegram-live-dot {
    width: 4px;
    height: 4px;
    animation: none;
    background: #4cd964;
}

/* ===== CONTENEUR DES MESSAGES ULTRA-COMPACT ===== */
.telegram-group-compact .telegram-messages-container {
    max-height: 300px;
    height: 300px;
    min-height: calc(100vh - 340px);
    background: #f8f9fa;
    box-shadow: none;
}

.telegram-group-compact .telegram-messages-list {
    padding: 4px 0;
}

/* ===== MESSAGES ULTRA-COMPACTS ===== */
.telegram-group-compact .telegram-group-message {
    padding: 4px 6px;
    margin: 0;
    animation: none;
    min-height: auto;
}

.telegram-group-compact .telegram-group-message:hover {
    background: rgba(0, 136, 204, 0.03);
}

.telegram-group-compact .telegram-sender-info {
    gap: 4px;
    margin-bottom: 2px;
    align-items: center;
}

.telegram-group-compact .telegram-avatar {
    width: 20px;
    height: 20px;
    font-size: 10px;
    background: #667eea;
    box-shadow: none;
    flex-shrink: 0;
}

.telegram-group-compact .telegram-sender-details {
    gap: 0;
}

.telegram-group-compact .telegram-sender-name {
    font-size: 12px;
    line-height: 1.2;
}

.telegram-group-compact .telegram-message-time {
    font-size: 9px;
    line-height: 1.2;
}

.telegram-group-compact .telegram-message-content {
    margin-left: 24px;
    margin-top: -2px;
}

/* Style quand l'expéditeur n'est pas affiché */
.telegram-group-compact .telegram-group-message:not(.has-sender) .telegram-message-content {
    margin-left: 0;
    margin-top: 0;
}

/* ===== TEXTE DES MESSAGES ULTRA-COMPACT ===== */
.telegram-group-compact .telegram-message-text {
    padding: 4px 6px;
    font-size: 13px;
    line-height: 1.3;
    border-radius: 4px;
    background: white;
    border: 1px solid #e9ecef;
    box-shadow: none;
    margin: 0;
}

.telegram-group-compact .telegram-message-text::before {
    display: none;
}

/* ===== MÉDIAS ULTRA-COMPACTS ===== */
.telegram-group-compact .telegram-message-media {
    margin-bottom: 2px;
    border-radius: 2px;
    box-shadow: none;
    border: 1px solid #e9ecef;
}

.telegram-group-compact .telegram-message-media:hover {
    transform: none;
    box-shadow: none;
}

.telegram-group-compact .telegram-media {
    border-radius: 2px;
}

.telegram-group-compact .telegram-audio-wrapper {
    padding: 4px 6px;
    gap: 4px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    box-shadow: none;
    margin: 2px 0;
}

.telegram-group-compact .telegram-audio {
    height: 30px;
}

.telegram-group-compact .telegram-voice-message {
    background: #f0f9ff;
    border-color: #b3e0ff;
}

.telegram-group-compact .telegram-voice-label {
    background: #0088cc;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 9px;
    box-shadow: none;
}

.telegram-group-compact .telegram-sticker {
    max-width: 80px;
}

.telegram-group-compact .telegram-file-link {
    padding: 3px 6px;
    font-size: 11px;
    background: #0088cc;
    color: white;
    border-radius: 3px;
    box-shadow: none;
    margin: 1px 0;
}

.telegram-group-compact .telegram-file-link:hover {
    background: #0077b3;
    transform: none;
    box-shadow: none;
}

/* ===== SONDAGES ULTRA-COMPACTS ===== */
.telegram-group-compact .telegram-poll {
    padding: 6px;
    border-radius: 4px;
    margin: 2px 0;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    box-shadow: none;
}

.telegram-group-compact .telegram-poll-question {
    font-size: 13px;
    padding: 4px 6px;
    margin-bottom: 4px;
    border-radius: 3px;
    background: white;
    border: 1px solid #e9ecef;
    box-shadow: none;
    text-align: left;
}

.telegram-group-compact .telegram-poll-options {
    gap: 3px;
    margin-bottom: 4px;
}

.telegram-group-compact .telegram-poll-option {
    padding: 3px 4px;
    border-radius: 2px;
    background: white;
    border: 1px solid #e9ecef;
    box-shadow: none;
    margin: 0;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.telegram-group-compact .telegram-poll-option:hover {
    border-color: #0088cc;
    box-shadow: none;
    transform: none;
}

.telegram-group-compact .telegram-poll-option.winner {
    border-color: #28a745;
    background: #f8fff9;
    box-shadow: none;
}

.telegram-group-compact .telegram-poll-option.correct {
    border-color: #28a745;
    background: #f8fff9;
    box-shadow: none;
}

.telegram-group-compact .telegram-poll-winner-badge {
    font-size: 12px;
    top: 2px;
    right: 2px;
}

.telegram-group-compact .telegram-poll-correct-badge {
    background: #28a745;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 9px;
    margin-left: 4px;
}

.telegram-group-compact .telegram-poll-rank {
    background: #667eea;
    color: white;
    padding: 1px 4px;
    border-radius: 6px;
    font-size: 9px;
    margin-right: 4px;
    flex-shrink: 0;
}

.telegram-group-compact .telegram-poll-option-content {
    margin: 0;
    flex: 1;
}

.telegram-group-compact .telegram-poll-option-header {
    margin-bottom: 2px;
    gap: 4px;
    align-items: center;
}

.telegram-group-compact .telegram-poll-option-text {
    font-size: 12px;
    line-height: 1.2;
    flex: 1;
}

.telegram-group-compact .telegram-poll-percentage {
    font-size: 12px;
    min-width: 30px;
    text-align: right;
    font-weight: bold;
}

.telegram-group-compact .telegram-poll-results {
    gap: 4px;
    align-items: center;
}

.telegram-group-compact .telegram-poll-bar {
    height: 3px;
    border-radius: 1px;
    background: #e9ecef;
    box-shadow: none;
    flex: 1;
}

.telegram-group-compact .telegram-poll-bar-fill {
    background: #0088cc;
    border-radius: 1px;
    transition: width 0.1s ease-in-out;
}

.telegram-group-compact .telegram-poll-bar-fill::after {
    display: none;
}

.telegram-group-compact .telegram-poll-option.winner .telegram-poll-bar-fill {
    background: #28a745;
}

.telegram-group-compact .telegram-poll-option.correct .telegram-poll-bar-fill {
    background: #ffc107;
}

.telegram-group-compact .telegram-poll-votes {
    font-size: 9px;
    min-width: 40px;
    text-align: right;
}

.telegram-group-compact .telegram-poll-footer {
    padding-top: 3px;
    flex-direction: row;
    gap: 6px;
    align-items: center;
    border-top: 1px solid #dee2e6;
    justify-content: space-between;
}

.telegram-group-compact .telegram-poll-total {
    font-size: 10px;
    margin: 0;
}

.telegram-group-compact .telegram-poll-total-votes {
    padding: 1px 4px;
    font-size: 9px;
    background: #0088cc;
    color: white;
    border-radius: 8px;
    box-shadow: none;
}

.telegram-group-compact .telegram-poll-meta {
    gap: 3px;
}

.telegram-group-compact .telegram-poll-type,
.telegram-group-compact .telegram-poll-status {
    font-size: 8px;
    padding: 1px 3px;
    border-radius: 6px;
}

/* Styles pour les sondages ouverts vs fermés */
.telegram-group-compact .telegram-poll.open .telegram-poll-bar-fill {
    background: #667eea;
}

.telegram-group-compact .telegram-poll.closed .telegram-poll-bar-fill {
    background: #28a745;
}

.telegram-group-compact .telegram-poll.quiz .telegram-poll-bar-fill {
    background: #ffc107;
}

/* ===== PIED DE PAGE ULTRA-COMPACT ===== */
.telegram-group-compact .telegram-group-footer {
    padding: 4px 6px;
    gap: 4px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    box-shadow: none;
    min-height: auto;
}

.telegram-group-compact .telegram-refresh-btn {
    padding: 3px 8px;
    font-size: 11px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 3px;
    box-shadow: none;
    min-height: auto;
    line-height: 1.2;
}

.telegram-group-compact .telegram-refresh-btn:hover:not(:disabled) {
    background: #0077b3;
    transform: none;
    box-shadow: none;
}

.telegram-group-compact .telegram-refresh-btn:disabled {
    background: #adb5bd;
}

.telegram-group-compact .telegram-countdown {
    padding: 2px 4px;
    font-size: 10px;
    min-width: 40px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 2px;
    box-shadow: none;
    text-align: center;
    line-height: 1.2;
    transition: all 0.3s ease;
}

.telegram-group-compact .telegram-countdown.loading {
    border-color: #0088cc;
    background: #f0f9ff;
    animation: none;
}

.telegram-group-compact .telegram-countdown.error {
    border-color: #e74c3c;
    background: #fee;
}

.telegram-group-compact .telegram-countdown.success {
    border-color: #28a745;
    background: #f8fff9;
    color: #28a745;
}

.telegram-group-compact .telegram-spinner-mini {
    width: 8px;
    height: 8px;
    border-width: 1px;
}

/* ===== NOTIFICATIONS ULTRA-COMPACTES ===== */
.telegram-group-compact .telegram-media-playing-notification {
    padding: 3px 6px;
    font-size: 10px;
    background: #ff9800;
    color: white;
    border-radius: 3px;
    box-shadow: none;
    animation: none;
    top: 4px;
    min-width: 250px;
    z-index: 10000;
}

.telegram-group-compact .telegram-media-playing-notification .telegram-notification-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.telegram-group-compact .telegram-notification-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.telegram-group-compact .telegram-refresh-anyway {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 2px;
    font-size: 8px;
    border-radius: 1px;
    line-height: 1.2;
}

.telegram-group-compact .telegram-refresh-anyway:hover {
    background: rgba(255, 255, 255, 0.3);
}

.telegram-group-compact .telegram-notification-close {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0 2px;
    font-size: 8px;
    border-radius: 1px;
    line-height: 1.2;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.telegram-group-compact .telegram-new-messages-indicator {
    padding: 2px 4px;
    font-size: 9px;
    bottom: 35px;
    right: 6px;
    background: #667eea;
    color: white;
    border-radius: 8px;
    box-shadow: none;
    animation: none;
}

/* ===== ÉTATS D'ERREUR ULTRA-COMPACTS ===== */
.telegram-group-compact .telegram-error,
.telegram-group-compact .telegram-info {
    padding: 6px 8px;
    margin: 3px;
    font-size: 12px;
    border-radius: 3px;
    box-shadow: none;
    line-height: 1.3;
}

.telegram-group-compact .telegram-error {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
}

.telegram-group-compact .telegram-info {
    background: #eff;
    border: 1px solid #cef;
    color: #366;
}

/* ===== SCROLLBAR ULTRA-COMPACTE ===== */
.telegram-group-compact .telegram-messages-container::-webkit-scrollbar {
    width: 3px;
}

.telegram-group-compact .telegram-messages-container::-webkit-scrollbar-track {
    margin: 0;
    border-radius: 1px;
    background: #f1f3f4;
}

.telegram-group-compact .telegram-messages-container::-webkit-scrollbar-thumb {
    border-radius: 1px;
    background: #667eea;
    border: none;
}

.telegram-group-compact .telegram-messages-container::-webkit-scrollbar-thumb:hover {
    background: #5a6fd8;
}

/* ===== ANIMATIONS MINIMALES ===== */
.telegram-group-compact .telegram-group-message {
    animation: none;
}

.telegram-group-compact .telegram-poll-bar-fill {
    transition: width 0.1s ease-in-out;
}

.telegram-database-notice {
    background: #e7f3ff;
    border: 1px solid #b8daff;
    border-radius: 4px;
    padding: 8px 12px;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #004085;
    text-align: center;
}

.telegram-source-indicator {
    font-size: 0.8em;
    margin-left: 5px;
    opacity: 0.7;
}

.telegram-group-message.from-database {
    opacity: 0.95;
    border-left: 3px solid #6c757d;
}

.telegram-group-message.from-database .telegram-message-time {
    font-style: italic;
}

/* ===== DESIGN RESPONSIVE ULTRA-COMPACT ===== */
@media (max-width: 768px) {
    .telegram-group-compact.telegram-group-live {
        border-radius: 3px;
        margin: 3px 0;
    }
    
    .telegram-group-compact .telegram-group-header {
        padding: 4px 6px;
    }
    
    .telegram-group-compact .telegram-messages-container {
        max-height: 200px;
        height: 200px;
        min-height: calc(100vh - 240px);
    }
    
    .telegram-group-compact .telegram-group-message {
        padding: 3px 4px;
    }
    
    .telegram-group-compact .telegram-group-footer {
        padding: 3px 4px;
        flex-direction: row;
        gap: 3px;
    }
    
    .telegram-group-compact .telegram-refresh-btn {
        width: auto;
        flex: 1;
    }
    
    .telegram-group-compact .telegram-countdown {
        width: auto;
    }
}

@media (max-width: 480px) {
    .telegram-group-compact.telegram-group-live {
        border-radius: 2px;
        margin: 2px 0;
    }
    
    .telegram-group-compact .telegram-group-header {
        padding: 3px 4px;
        flex-direction: row;
        gap: 4px;
    }
    
    .telegram-group-compact .telegram-messages-container {
        max-height: 150px;
        height: 150px;
        min-height: calc(100vh - 180px);
    }
    
    .telegram-group-compact .telegram-group-message {
        padding: 2px 3px;
    }
    
    .telegram-group-compact .telegram-message-text {
        padding: 3px 4px;
        font-size: 12px;
    }
}

/* ===== THÈME SOMBRE ULTRA-COMPACT ===== */
@media (prefers-color-scheme: dark) {
    .telegram-group-compact.telegram-group-live {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .telegram-group-compact .telegram-group-header {
        background: #4a5568;
    }
    
    .telegram-group-compact .telegram-messages-container {
        background: #2d3748;
    }
    
    .telegram-group-compact .telegram-message-text {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .telegram-group-compact .telegram-audio-wrapper {
        background: #4a5568;
        border-color: #718096;
    }
    
    .telegram-group-compact .telegram-group-footer {
        background: #4a5568;
        border-color: #718096;
    }
    
    .telegram-group-compact .telegram-countdown {
        background: #2d3748;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .telegram-group-compact .telegram-countdown.loading {
        border-color: #0088cc;
        background: #2d5a5a;
    }
    
    .telegram-group-compact .telegram-countdown.success {
        border-color: #28a745;
        background: #2d5a2d;
        color: #a3d9a5;
    }
    
    .telegram-group-compact .telegram-poll {
        background: #4a5568;
        border-color: #718096;
    }
    
    .telegram-group-compact .telegram-poll-question {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .telegram-group-compact .telegram-poll-option {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .telegram-group-compact .telegram-poll-option.winner {
        background: #2d5a2d;
        border-color: #48bb78;
    }
    
    .telegram-group-compact .telegram-poll-bar {
        background: #718096;
    }
}
