/* ==========================================================================
   POMOSYNC - SISTEMA DRAG & DROP E RICHIESTA INVIO ALLEGATI TEMATIZZATO
   Supporta i 3 temi: Apple, Minimal, Discord
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. OVERLAY DRAG & DROP GLOBALE
   -------------------------------------------------------------------------- */
#drag-drop-overlay {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}

#drag-drop-overlay.active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Backdrop specifico per tema */
body.theme-apple #drag-drop-overlay {
    background: rgba(40, 40, 45, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

body.theme-minimal #drag-drop-overlay {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

body.theme-discord #drag-drop-overlay {
    background: rgba(30, 31, 34, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* --------------------------------------------------------------------------
   VISIBILITÀ SCHEDE DRAG IN BASE AL TEMA ATTIVO
   -------------------------------------------------------------------------- */
.drag-card {
    display: none !important;
    width: 100%;
    max-width: 480px;
    flex-direction: column;
    box-sizing: border-box;
    position: relative;
    user-select: none;
    pointer-events: none;
    animation: dragCardPop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes dragCardPop {
    0% { transform: scale(0.92); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

body.theme-apple #drag-drop-overlay .drag-card-apple { display: flex !important; }
body.theme-minimal #drag-drop-overlay .drag-card-minimal { display: flex !important; }
body.theme-discord #drag-drop-overlay .drag-card-discord { display: flex !important; }

/* --------------------------------------------------------------------------
   2. GRAFICA DRAG & DROP: TEMA APPLE (Mac OS X Aqua / Finder)
   -------------------------------------------------------------------------- */
.drag-card-apple {
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0.15) 1px, transparent 1px, transparent 3px), linear-gradient(180deg, #ececec, #cfcfcf);
    border: 2px dashed #3a75c4;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), 0 0 25px rgba(58, 117, 196, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Lucida Grande", "Segoe UI", sans-serif;
    color: #333;
}

.drag-card-apple .drag-mac-titlebar {
    background: linear-gradient(180deg, #f2f4f5 0%, #d1d6da 49%, #c3c9cf 50%, #b2b8bf 100%);
    border-bottom: 1px solid #777;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 0 #fff;
}

.drag-card-apple .mac-dots-row {
    display: flex;
    gap: 7px;
}

.drag-card-apple .drag-title {
    font-size: 13px;
    font-weight: bold;
    color: #444;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-left: 6px;
}

.drag-card-apple .drag-card-body {
    padding: 36px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.drag-card-apple .drag-icon-apple-box {
    width: 80px;
    height: 80px;
    background: linear-gradient(180deg, #ffffff 0%, #dcdcdc 100%);
    border: 1px solid #999;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    box-shadow: inset 0 1px 0 #fff, 0 8px 18px rgba(0, 0, 0, 0.2);
    animation: macDropPulse 1.5s infinite ease-in-out;
}

@keyframes macDropPulse {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-6px) scale(1.05); }
}

.drag-card-apple .drag-prompt-title {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
}

.drag-card-apple .drag-prompt-sub {
    font-size: 13px;
    color: #555;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.drag-card-apple .drag-pill-info {
    margin-top: 6px;
    padding: 5px 14px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    background: linear-gradient(180deg, #74a9fe 0%, #3a75c4 100%);
    color: #fff;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
}

/* --------------------------------------------------------------------------
   3. GRAFICA DRAG & DROP: TEMA MINIMAL (PomoFocus Flat/Clean)
   -------------------------------------------------------------------------- */
.drag-card-minimal {
    background: #ffffff;
    border: 2px dashed #e74c3c;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(231, 76, 60, 0.15), 0 8px 25px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2c3e50;
}

.drag-card-minimal .drag-card-body {
    padding: 40px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.drag-card-minimal .drag-icon-minimal-box {
    width: 80px;
    height: 80px;
    background: #fff5f5;
    border: 2px solid #ffd8d8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    animation: minimalPulse 1.6s infinite ease-in-out;
}

@keyframes minimalPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.drag-card-minimal .drag-prompt-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    letter-spacing: -0.3px;
}

.drag-card-minimal .drag-prompt-sub {
    font-size: 14px;
    color: #666;
    max-width: 320px;
}

.drag-card-minimal .minimal-badge-tag {
    margin-top: 6px;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 600;
    background: #e74c3c;
}

/* --------------------------------------------------------------------------
   4. GRAFICA DRAG & DROP: TEMA DISCORD (DiscPomodoro Dark UI)
   -------------------------------------------------------------------------- */
.drag-card-discord {
    background: #2b2d31;
    border: 2px dashed #5865F2;
    border-radius: 12px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(88, 101, 242, 0.4);
    overflow: hidden;
    font-family: 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    color: #dbdee1;
}

.drag-card-discord .drag-card-body {
    padding: 38px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.drag-card-discord .discord-cloud-box {
    width: 84px;
    height: 84px;
    background: #1e1f22;
    border: 1px solid #35373c;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    position: relative;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    animation: discordCloudBounce 1.5s infinite ease-in-out;
}

@keyframes discordCloudBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.drag-card-discord .discord-arrow-badge {
    position: absolute;
    bottom: -4px;
    right: -4px;
    background: #5865F2;
    color: #fff;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    border: 2px solid #2b2d31;
}

.drag-card-discord .drag-prompt-title {
    font-size: 20px;
    font-weight: 800;
    color: #f2f3f5;
    letter-spacing: -0.2px;
}

.drag-card-discord .drag-prompt-sub {
    font-size: 14px;
    color: #949ba4;
}

.drag-card-discord .discord-drop-tip {
    margin-top: 6px;
    padding: 6px 14px;
    background: #1e1f22;
    border-radius: 8px;
    font-size: 12px;
    color: #dbdee1;
}

.drag-card-discord .discord-drop-tip span {
    color: #23a559;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   7. FEEDBACK HOVER SULLE AREE CHAT
   -------------------------------------------------------------------------- */
.chat-drag-active {
    outline: 2px dashed var(--accent, #5865F2) !important;
    outline-offset: -3px;
    transition: outline 0.15s ease;
}

body.theme-apple .chat-drag-active { outline-color: #3a75c4 !important; }
body.theme-minimal .chat-drag-active { outline-color: #e74c3c !important; }
body.theme-discord .chat-drag-active { outline-color: #5865F2 !important; }

/* --------------------------------------------------------------------------
   8. MODALE "RICHIESTA INVIO ALLEGATI" TEMATIZZATA (#attachment-request-modal)
   -------------------------------------------------------------------------- */
#attachment-request-modal {
    position: fixed;
    inset: 0;
    z-index: 10003;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
}

#attachment-request-modal.active {
    display: flex;
}

.attachment-modal-card {
    width: 100%;
    max-width: 440px;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    animation: modalSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
    0% { transform: translateY(20px) scale(0.96); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.attachment-modal-header {
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: bold;
    font-size: 16px;
}

.attachment-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.attachment-modal-close {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    border-radius: 4px;
    line-height: 1;
}

.attachment-mac-dots {
    display: none !important;
}

body.theme-apple .attachment-mac-dots {
    display: flex !important;
    gap: 7px;
    align-items: center;
}
body.theme-apple .attachment-modal-close {
    display: none !important;
}

.attachment-modal-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Box di Anteprima File */
.attachment-preview-box {
    border-radius: 10px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-sizing: border-box;
    overflow: hidden;
}

.attachment-preview-thumb {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    font-size: 32px;
}

.attachment-preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.attachment-meta-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-width: 0;
}

.attachment-file-name {
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-file-meta-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.attachment-file-size {
    opacity: 0.75;
}

.attachment-ext-tag {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
}

/* Campo Commento / Messaggio */
.attachment-comment-wrapper {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.attachment-comment-label {
    font-size: 12px;
    font-weight: 600;
    opacity: 0.8;
}

.attachment-comment-input {
    width: 100%;
    min-height: 68px;
    max-height: 130px;
    padding: 10px 12px;
    border-radius: 8px;
    box-sizing: border-box;
    resize: none;
    font-size: 13px;
    font-family: inherit;
    line-height: 1.4;
}

/* Barra di Avanzamento Upload */
.attachment-upload-progress {
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 8px 0;
}

.attachment-upload-progress.active {
    display: flex;
}

.attachment-progress-track {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
}

.attachment-progress-bar {
    height: 100%;
    width: 0%;
    transition: width 0.2s ease;
    animation: indeterminateProgress 1.4s infinite linear;
}

@keyframes indeterminateProgress {
    0% { transform: translateX(-100%); width: 40%; }
    50% { transform: translateX(50%); width: 60%; }
    100% { transform: translateX(200%); width: 40%; }
}

.attachment-progress-label {
    font-size: 11px;
    text-align: center;
    opacity: 0.8;
}

/* Footer & Pulsanti */
.attachment-modal-footer {
    padding: 14px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    box-sizing: border-box;
}

.attachment-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
}

.attachment-btn:active {
    transform: scale(0.97);
}

.attachment-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* --------------------------------------------------------------------------
   STILI TEMATIZZATI PER LA MODALE DI RICHIESTA ALLEGATI
   -------------------------------------------------------------------------- */

/* TEMA APPLE */
body.theme-apple .attachment-modal-card {
    background: repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.15) 0, rgba(255, 255, 255, 0.15) 1px, transparent 1px, transparent 3px), linear-gradient(180deg, #ececec, #cfcfcf);
    border: 1px solid #777;
    border-radius: 12px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    color: #333;
}
body.theme-apple .attachment-modal-header {
    background: linear-gradient(180deg, #f2f4f5 0%, #d1d6da 49%, #c3c9cf 50%, #b2b8bf 100%);
    border-bottom: 1px solid #777;
    color: #444;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}
body.theme-apple .attachment-preview-box {
    background: #d8d8d8;
    border: 1px solid #b0b0b0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
body.theme-apple .attachment-preview-thumb {
    background: #c5c5c5;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}
body.theme-apple .attachment-ext-tag {
    background: #3a75c4;
    color: white;
}
body.theme-apple .attachment-comment-input {
    background: #fff;
    border: 1px solid #999;
    color: #000;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
}
body.theme-apple .attachment-progress-track {
    background: #ccc;
}
body.theme-apple .attachment-progress-bar {
    background: linear-gradient(180deg, #74a9fe 0%, #3a75c4 100%);
}
body.theme-apple .attachment-cancel-btn {
    background: linear-gradient(180deg, #f8f8f8 0%, #d8d8d8 49%, #cecece 50%, #bcbcbc 100%);
    border: 1px solid #777;
    color: #333;
    border-radius: 20px;
    text-shadow: 0 1px 0 #fff;
    box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(0, 0, 0, 0.2);
}
body.theme-apple .attachment-send-btn {
    background: linear-gradient(180deg, #74a9fe 0%, #3a75c4 49%, #2860b0 50%, #1f519b 100%);
    border: 1px solid #1455a2;
    color: #fff;
    border-radius: 20px;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* TEMA MINIMAL */
body.theme-minimal .attachment-modal-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 16px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
    color: #2c3e50;
}
body.theme-minimal .attachment-modal-header {
    background: #fafafa;
    border-bottom: 1px solid #eee;
    color: #222;
}
body.theme-minimal .attachment-preview-box {
    background: #f8f9fa;
    border: 1px solid #eee;
}
body.theme-minimal .attachment-preview-thumb {
    background: #fff;
    border: 1px solid #e2e8f0;
}
body.theme-minimal .attachment-ext-tag {
    background: #e74c3c;
    color: white;
}
body.theme-minimal .attachment-comment-input {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #222;
}
body.theme-minimal .attachment-comment-input:focus {
    border-color: #e74c3c;
    outline: none;
    background: #fff;
}
body.theme-minimal .attachment-progress-track {
    background: #f1f3f5;
}
body.theme-minimal .attachment-progress-bar {
    background: #e74c3c;
}
body.theme-minimal .attachment-cancel-btn {
    background: #f1f3f5;
    color: #495057;
    border-radius: 8px;
}
body.theme-minimal .attachment-cancel-btn:hover {
    background: #e9ecef;
}
body.theme-minimal .attachment-send-btn {
    background: #e74c3c;
    color: #fff;
    border-radius: 8px;
}
body.theme-minimal .attachment-send-btn:hover {
    background: #c0392b;
/* TEMA DISCORD */
body.theme-discord .attachment-modal-card {
    background: #313338;
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
    color: #dbdee1;
    font-family: 'gg sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}
body.theme-discord .attachment-modal-header {
    background: #313338;
    border-bottom: 1px solid #2b2d31;
    color: #f2f3f5;
}
body.theme-discord .attachment-preview-box {
    background: #2b2d31;
    border-radius: 6px;
}
body.theme-discord .attachment-preview-thumb {
    background: #1e1f22;
}
body.theme-discord .attachment-ext-tag {
    background: #5865F2;
    color: white;
}
body.theme-discord .attachment-comment-input {
    background: #1e1f22;
    border: 1px solid #1e1f22;
    color: #dbdee1;
    border-radius: 4px;
}
body.theme-discord .attachment-comment-input:focus {
    border-color: #5865F2;
    outline: none;
}
body.theme-discord .attachment-progress-track {
    background: #1e1f22;
}
body.theme-discord .attachment-progress-bar {
    background: #5865F2;
}
body.theme-discord .attachment-cancel-btn {
    background: transparent;
    color: #dbdee1;
    border: none;
}
body.theme-discord .attachment-cancel-btn:hover {
    text-decoration: underline;
    color: #fff;
}
body.theme-discord .attachment-send-btn {
    background: #5865F2;
    color: #fff;
    border-radius: 4px;
}
body.theme-discord .attachment-send-btn:hover {
    background: #4752c4;
}

/* --------------------------------------------------------------------------
   RESPONSIVE DESIGN (MOBILE & TABLET)
   -------------------------------------------------------------------------- */
@media (max-width: 600px) {
    .drag-card {
        max-width: 90vw;
    }
    .drag-card-body {
        padding: 24px 16px !important;
    }
    .drag-prompt-title {
        font-size: 16px !important;
    }
    .attachment-modal-card {
        max-width: 95vw;
    }
    .attachment-modal-body {
        padding: 14px;
        gap: 10px;
    }
    .attachment-preview-box {
        padding: 10px;
        gap: 10px;
    }
    .attachment-preview-thumb {
        width: 52px;
        height: 52px;
        font-size: 26px;
    }
}

/* ==========================================================================
   GARANZIA TESTO BIANCO TEMA POMODORO (MINIMAL) PER UTENTI ONLINE
   ========================================================================== */
body.theme-minimal .online-users,
body.theme-minimal .online-users *,
body.theme-minimal .online-users-placeholder {
    color: #ffffff !important;
}

.online-users-placeholder {
    font-size: 12px;
    opacity: 0.85;
}

/* ==========================================================================
   PULSANTE KICK NELLA LISTA UTENTI ONLINE (.user-kick-btn)
   ========================================================================== */
.user-pill {
    position: relative;
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.user-pill:hover {
    filter: brightness(1.08);
}

.user-kick-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    margin-left: auto;
    padding: 2px 6px;
    font-size: 13px;
    border-radius: 4px;
    opacity: 0.65;
    transition: all 0.2s ease;
    line-height: 1;
}

.user-kick-btn:hover {
    opacity: 1;
    transform: scale(1.22);
    background: rgba(231, 76, 60, 0.25);
}

body.theme-minimal .user-kick-btn {
    color: #ffffff !important;
}

body.theme-minimal .user-kick-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

body.theme-discord .user-kick-btn {
    color: #b5bac1;
}

body.theme-discord .user-kick-btn:hover {
    color: #ed4245;
    background: rgba(237, 66, 69, 0.2);
}

/* ==========================================================================
   MODALE OFFLINE PERSONALIZZATO PER TUTTI I 5 TEMI (#offline-modal)
   ========================================================================== */
#offline-modal {
    position: fixed;
    inset: 0;
    z-index: 10005;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

#offline-modal.active {
    display: flex !important;
}

#offline-modal .offline-card {
    display: none !important;
    width: 100%;
    box-sizing: border-box;
    animation: offlineModalPop 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes offlineModalPop {
    0% { transform: scale(0.92) translateY(18px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

/* Mostra solo la scheda corrispondente al tema attivo */
body.theme-apple #offline-modal .offline-card-apple { display: flex !important; flex-direction: column; }
body.theme-minimal #offline-modal .offline-card-minimal { display: flex !important; flex-direction: column; }
body.theme-discord #offline-modal .offline-card-discord { display: flex !important; flex-direction: column; }

/* --------------------------------------------------------------------------
   1. OFFLINE CARD: APPLE MAC OS X
   -------------------------------------------------------------------------- */
.offline-card-apple {
    max-width: 480px;
    background: linear-gradient(180deg, #ececec 0%, #dcdcdc 50%, #cecece 100%);
    border: 1px solid #999;
    border-radius: 8px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Lucida Grande", "Segoe UI", sans-serif;
    color: #222;
}

.offline-apple-header {
    background: linear-gradient(180deg, #e6e6e6 0%, #cccccc 100%);
    border-bottom: 1px solid #a8a8a8;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    position: relative;
    user-select: none;
}

.offline-apple-title {
    margin: 0 auto;
    font-size: 13px;
    font-weight: bold;
    color: #333;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.7);
}

.offline-apple-body {
    padding: 22px 24px;
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.offline-apple-icon {
    flex-shrink: 0;
}

.mac-caution-sign {
    font-size: 46px;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.25));
}

.offline-apple-heading {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: bold;
    color: #111;
}

.offline-apple-desc {
    margin: 0 0 14px 0;
    font-size: 13px;
    line-height: 1.45;
    color: #444;
}

.offline-apple-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 12px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    color: #555;
}

.offline-badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e74c3c;
    box-shadow: 0 0 4px #e74c3c;
}

.offline-apple-footer {
    background: #dfdfdf;
    border-top: 1px solid #c2c2c2;
    padding: 12px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.offline-apple-btn {
    border-radius: 14px;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    background: linear-gradient(180deg, #ffffff 0%, #ececec 50%, #d8d8d8 100%);
    border: 1px solid #a0a0a0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    color: #222;
}

.offline-apple-btn:active {
    background: #c8c8c8;
}

.offline-apple-btn.primary {
    background: linear-gradient(180deg, #6ba4f8 0%, #2b74e6 50%, #155bc9 51%, #357be8 100%);
    border: 1px solid #1048a0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.45);
    color: #fff;
    font-weight: bold;
    text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
}

.offline-apple-btn.primary:active {
    background: #155bc9;
/* --------------------------------------------------------------------------
   2. OFFLINE CARD: MINIMAL / POMODORO
   -------------------------------------------------------------------------- */
.offline-card-minimal {
    max-width: 440px;
    background: #ba4949;
    border-radius: 20px;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4);
    color: #ffffff;
    text-align: center;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.offline-minimal-body {
    padding: 34px 28px;
}

.offline-minimal-art {
    margin-bottom: 16px;
}

.offline-tomato-mascot {
    font-size: 52px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: tomatoFloat 2.6s ease-in-out infinite alternate;
}

@keyframes tomatoFloat {
    0% { transform: translateY(0); }
    100% { transform: translateY(-8px); }
}

.sleep-z {
    font-size: 26px;
    animation: floatZ 1.8s ease-in-out infinite;
    display: inline-block;
    margin-left: -10px;
    margin-top: -24px;
}

@keyframes floatZ {
    0% { opacity: 0; transform: translateY(6px) scale(0.8); }
    50% { opacity: 1; }
    100% { opacity: 0; transform: translateY(-16px) scale(1.2); }
}

.offline-minimal-heading {
    margin: 0 0 10px 0;
    font-size: 22px;
    font-weight: bold;
    color: #ffffff;
}

.offline-minimal-desc {
    margin: 0 0 18px 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.offline-minimal-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 16px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    margin-bottom: 24px;
}

.offline-minimal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.offline-minimal-btn {
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 14px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.15s ease;
}

.offline-minimal-btn.primary {
    background: #ffffff;
    color: #ba4949;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.offline-minimal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.offline-minimal-btn.secondary {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.offline-minimal-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* --------------------------------------------------------------------------
   3. OFFLINE CARD: DISCORD
   -------------------------------------------------------------------------- */
.offline-card-discord {
    max-width: 440px;
    background: #313338;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.65);
    color: #dbdee1;
    font-family: "gg sans", "Noto Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.offline-discord-header {
    background: #2b2d31;
    padding: 14px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.offline-discord-title {
    font-size: 15px;
    font-weight: bold;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.offline-discord-close {
    background: transparent;
    border: none;
    color: #949ba4;
    font-size: 16px;
    cursor: pointer;
}

.offline-discord-close:hover {
    color: #ffffff;
}

.offline-discord-body {
    padding: 24px 20px;
    text-align: center;
}

.offline-discord-art {
    font-size: 44px;
    margin-bottom: 12px;
}

.offline-discord-heading {
    margin: 0 0 8px 0;
    font-size: 17px;
    font-weight: bold;
    color: #ffffff;
}

.offline-discord-desc {
    margin: 0 0 16px 0;
    font-size: 13px;
    line-height: 1.45;
    color: #949ba4;
}

.offline-discord-rtc-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(237, 66, 69, 0.12);
    border: 1px solid rgba(237, 66, 69, 0.35);
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    color: #ed4245;
    font-weight: 500;
}

.rtc-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ed4245;
    box-shadow: 0 0 6px #ed4245;
}

.offline-discord-footer {
    background: #2b2d31;
    padding: 12px 18px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.offline-discord-btn {
    border-radius: 4px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: background 0.15s ease;
}

.offline-discord-btn.primary {
    background: #5865F2;
    color: #ffffff;
}

.offline-discord-btn.primary:hover {
    background: #4752c4;
}

.offline-discord-btn.secondary {
    background: transparent;
    color: #dbdee1;
}

.offline-discord-btn.secondary:hover {
    text-decoration: underline;
    color: #ffffff;
}

/* ==========================================================================
   VOTE KICK MODALS STYLING
   ========================================================================== */
.vote-modal-card, .kick-modal-card, .kicked-modal-card {
    animation: offlineModalPop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.vote-yes-btn:hover {
    background: #219653 !important;
    filter: brightness(1.1);
}

.vote-no-btn:hover {
    background: #636e72 !important;
    filter: brightness(1.1);
}

/* ==========================================================================
   POPUP SUGGERIMENTI MENZIONI @ (STILE WHATSAPP)
   ========================================================================== */
.chat-input-wrapper,
.chat-input-area,
.discord-chat-input-wrapper {
    position: relative !important;
}

.mention-autocomplete-popup {
    position: absolute;
    bottom: 100%;
    left: 12px;
    right: 12px;
    margin-bottom: 8px;
    z-index: 1005;
    max-height: 250px;
    display: none;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    animation: mentionPopupIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    font-family: inherit;
}

@keyframes mentionPopupIn {
    0% { transform: translateY(8px) scale(0.98); opacity: 0; }
    100% { transform: translateY(0) scale(1); opacity: 1; }
}

.mention-popup-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    user-select: none;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.mention-header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-weight: bold;
    font-size: 11px;
}

.mention-header-title {
    font-size: 11px;
    font-weight: bold;
}

.mention-header-count {
    margin-left: auto;
    font-size: 10px;
    opacity: 0.7;
    font-weight: normal;
}

.mention-popup-list {
    overflow-y: auto;
    max-height: 180px;
    display: flex;
    flex-direction: column;
}

.mention-popup-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    user-select: none;
    transition: background 0.1s ease, color 0.1s ease;
}

.mention-avatar-box {
    position: relative;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
}

.mention-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.05);
}

.mention-online-indicator {
    position: absolute;
    bottom: -1px;
    right: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    border: 1.5px solid #fff;
}

.mention-user-details {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.mention-user-name {
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mention-match-highlight {
    font-weight: 800;
    text-decoration: underline;
}

.mention-you-pill {
    font-size: 9px;
    padding: 1px 5px;
    border-radius: 8px;
    font-weight: bold;
    text-transform: uppercase;
}

.mention-user-status {
    font-size: 11px;
    opacity: 0.7;
}

.mention-select-hint {
    font-size: 11px;
    opacity: 0;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    transition: opacity 0.15s ease;
}

.mention-popup-item.active .mention-select-hint {
    opacity: 0.8;
}

.mention-popup-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 14px;
    font-size: 10px;
    opacity: 0.65;
    user-select: none;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   THEME STYLING: APPLE MAC OS X
   -------------------------------------------------------------------------- */
body.theme-apple .mention-autocomplete-popup {
    background: rgba(242, 244, 245, 0.95);
    backdrop-filter: blur(16px);
    border: 1px solid #999;
    color: #222;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}
body.theme-apple .mention-popup-header {
    background: linear-gradient(180deg, #e6e6e6 0%, #d0d0d0 100%);
    color: #333;
    border-bottom: 1px solid #b8b8b8;
}
body.theme-apple .mention-header-icon {
    background: #3b79d6;
    color: #fff;
}
body.theme-apple .mention-popup-item:hover,
body.theme-apple .mention-popup-item.active {
    background: linear-gradient(180deg, #5c9df5 0%, #2970e6 100%);
    color: #fff;
}
body.theme-apple .mention-popup-item.active .mention-user-status {
    color: rgba(255, 255, 255, 0.85);
}
body.theme-apple .mention-popup-item.active .mention-online-indicator {
    border-color: #2970e6;
}
body.theme-apple .mention-you-pill {
    background: rgba(0, 0, 0, 0.15);
    color: inherit;
}
body.theme-apple .mention-popup-footer {
    background: #dfdfdf;
    border-top: 1px solid #ccc;
    color: #555;
}

/* --------------------------------------------------------------------------
   THEME STYLING: MINIMAL / POMODORO
   -------------------------------------------------------------------------- */
body.theme-minimal .mention-autocomplete-popup {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #2d3748;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.22);
    border-radius: 12px;
}
body.theme-minimal .mention-popup-header {
    background: #f7fafc;
    border-bottom: 1px solid #edf2f7;
    color: #4a5568;
}
body.theme-minimal .mention-header-icon {
    background: #ba4949;
    color: #fff;
}
body.theme-minimal .mention-popup-item:hover,
body.theme-minimal .mention-popup-item.active {
    background: rgba(186, 73, 73, 0.1);
    color: #ba4949;
}
body.theme-minimal .mention-match-highlight {
    color: #ba4949;
}
body.theme-minimal .mention-you-pill {
    background: #ba4949;
    color: #fff;
}
body.theme-minimal .mention-popup-footer {
    background: #f7fafc;
    border-top: 1px solid #edf2f7;
    color: #718096;
}

/* --------------------------------------------------------------------------
   THEME STYLING: DISCORD
   -------------------------------------------------------------------------- */
body.theme-discord .mention-autocomplete-popup {
    background: #2b2d31;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
    color: #dbdee1;
    border-radius: 8px;
}
body.theme-discord .mention-popup-header {
    background: #1e1f22;
    border-bottom: 1px solid #232428;
    color: #949ba4;
}
body.theme-discord .mention-header-icon {
    background: #5865F2;
    color: #fff;
}
body.theme-discord .mention-popup-item:hover,
body.theme-discord .mention-popup-item.active {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}
body.theme-discord .mention-match-highlight {
    color: #5865F2;
}
body.theme-discord .mention-you-pill {
    background: #5865F2;
    color: #fff;
}
body.theme-discord .mention-popup-footer {
    background: #1e1f22;
    border-top: 1px solid #232428;
    color: #80848e;
}

/* --------------------------------------------------------------------------
   BADGE MENZIONE NEI MESSAGGI CHAT (.chat-mention)
   -------------------------------------------------------------------------- */
.chat-mention {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.95em;
    background: rgba(88, 101, 242, 0.18);
    color: var(--accent, #5865F2);
    border: 1px solid rgba(88, 101, 242, 0.3);
    cursor: pointer;
    transition: all 0.15s ease;
    vertical-align: baseline;
    user-select: all;
}

.chat-mention:hover {
    background: rgba(88, 101, 242, 0.32);
    transform: translateY(-1px);
}

.chat-mention.mention-me {
    background: rgba(255, 215, 0, 0.28) !important;
    color: #d35400 !important;
    border-color: rgba(255, 215, 0, 0.6) !important;
    font-weight: 700;
}

body.theme-discord .chat-mention {
    background: rgba(88, 101, 242, 0.3);
    color: #c9cdfb;
    border-color: transparent;
}

body.theme-discord .chat-mention.mention-me {
    background: rgba(240, 178, 50, 0.22) !important;
    color: #f0b232 !important;
    border-color: rgba(240, 178, 50, 0.45) !important;
}

body.theme-minimal .chat-mention {
    background: rgba(186, 73, 73, 0.15);
    color: #ba4949;
    border-color: rgba(186, 73, 73, 0.3);
}

body.theme-minimal .chat-mention.mention-me {
    background: rgba(255, 255, 255, 0.38) !important;
    color: #ba4949 !important;
    border-color: rgba(255, 255, 255, 0.65) !important;
}

@media (max-width: 600px) {
    .mention-autocomplete-popup {
        left: 8px;
        right: 8px;
        max-height: 210px;
    }
    .mention-popup-item {
        padding: 6px 10px;
    }
    .mention-popup-footer {
        display: none;
    }
}

/* ==========================================================================
   FEEDBACK VISIVO MESSAGGIO SELEZIONATO PER RISPOSTA
   ========================================================================== */
.msg.msg-selected-reply .msg-bubble {
    animation: replyBubbleHighlight 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@keyframes replyBubbleHighlight {
    0% {
        transform: scale(0.97);
        box-shadow: 0 0 0 3px rgba(88, 101, 242, 0.7);
        filter: brightness(1.2);
    }
    40% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(88, 101, 242, 0.85);
        filter: brightness(1.3);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(88, 101, 242, 0);
        filter: brightness(1);
    }
}

body.theme-apple .msg.msg-selected-reply .msg-bubble {
    animation: replyBubbleApple 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes replyBubbleApple {
    0% {
        transform: scale(0.97);
        box-shadow: 0 0 0 3px rgba(59, 121, 214, 0.75);
    }
    40% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(59, 121, 214, 0.9);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(59, 121, 214, 0);
    }
}

body.theme-minimal .msg.msg-selected-reply .msg-bubble {
    animation: replyBubbleMinimal 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes replyBubbleMinimal {
    0% {
        transform: scale(0.97);
        box-shadow: 0 0 0 3px rgba(186, 73, 73, 0.7);
    }
    40% {
        transform: scale(1.02);
        box-shadow: 0 0 0 4px rgba(186, 73, 73, 0.85);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(186, 73, 73, 0);
    }
}

