/* =============================================================
   SKIN: 123FlashChat HTML5 
   ? Aggiungere DOPO styles.css nell'HTML:
      <link rel="stylesheet" href="css/skin-123flashchat.css">
   ============================================================= */

/* ============================================
   Basato sui temi HTML5 della 123FlashChat
   ============================================ */

/* RESET & BASE */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
    font-family: Tahoma, 'Segoe UI', Arial, sans-serif;
    font-size: 62.5%;
    background: #1a1f2e;
}

body {
    font-size: 1.2em;
    color: #bf0000;
}

/* MAIN LAYOUT */
.chat-shell {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    min-width: 800px;
    min-height: 500px;
}


/* TOP STRIP - Stile 123FlashChat */
.top-strip {
    position: absolute;
    top: 38px;
    left: 0;
    right: 0;
    height: 50px;
    background: linear-gradient(to bottom, #fff, #e7ebf7);
    border-bottom: 1px solid #8593a0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    z-index: 99;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    height: 38px;
}

.brand-mark {
    font-size: 2em;
    font-weight: bold;
    color: #5987c9;
}

.brand strong {
    font-size: 1.4em;
    color: #015bb6;
}

.top-actions {
    display: flex;
    gap: 8px;
}

.toolbar-label-btn, .toolbar-icon-btn {
    background: linear-gradient(to bottom, #fff, #dde6f6);
    border: 1px solid #bdc1d9;
    //border-radius: 5px;
    //padding: 5px 10px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 1.1em;
    color: #333;
    transition: all 0.2s;
}

.toolbar-label-btn:hover, .toolbar-icon-btn:hover {
    background: linear-gradient(to bottom, #fff, #cdd8ed);
    color: #06c;
    border-color: #bdc1d9;
}

.toolbar-icon-svg {
    width: 18px;
    height: 18px;
}


.select-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 0px solid #5987c9;
}

.select-title-row h1 {
    font-size: 1.8em;
    color: #015bb6;
}

.select-room-top-actions {
    display: flex;
    gap: 10px;
}

.select-rooms-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 2px;
}

/* Il layout della card stanza (avatar, badge LIVE, tag, contatore) vive
   ora interamente in styles.css: qui teniamo solo eventuali accenti di
   colore specifici di questa skin, per non sovrascrivere il nuovo design
   con la cascata (questo file viene caricato dopo styles.css). */
.select-room-copy strong {
    font-size: 1.2em;
}

.select-room-copy small {
    font-size: 0.95em;
}

.select-room-brand {
    font-size: 0.9em;
}

/* CHAT SCREEN */
.chat-screen {
    background: #e7ebf7;
    display: flex;
    flex-direction: column;
}

/* MODULE ROW (top toolbar) - barra icone scura stile screenshot di riferimento */
.module-row {
    position: relative;
    height: 34px;
    background: linear-gradient(to bottom, #1a1f2e, #05070c);
    border-bottom: 0px solid #000;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 6px;
    gap: 2px;
    flex-shrink: 0;
}

.module-spacer {
    flex: 1;
}

.module-row .toolbar-icon-btn,
.module-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 34px;
    height: 30px;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s;
}

.module-row .toolbar-icon-btn:hover,
.module-icon:hover {
    background: rgba(255, 255, 255, 0.12);
}

/* Le icone della module-row sono ora SVG inline con stroke="currentColor":
   il colore si controlla con la propriet  CSS "color", non pi  con filter,
   cos    possibile cambiarlo liberamente (es. da bianco a un altro colore). */
.module-row .module-icon-svg {
    width: 27px;
    height: 32px;
    display: block;
    color: #000000;
    opacity: .92;
    transition: opacity .18s ease, filter .18s ease;
}

.module-row .toolbar-icon-btn:hover .module-icon-svg,
.module-row .toolbar-icon-btn:focus-visible .module-icon-svg {
    opacity: 1;
    filter: drop-shadow(0 0 4px rgba(255,255,255,.85));
}

.module-row .reg-requests-badge-btn .reg-requests-badge-icon {
    filter: none;
}

.module-row .module-camera.is-active .module-icon-svg {
    color: #59d5ff;
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(89, 213, 255, .85));
}

.module-row .module-camera.is-off .module-icon-svg {
    opacity: .55;
}

/* CHAT FRAME */
.chat-frame {
    flex: 1;
    display: flex;
    gap: 1px;
    background: #8593a0;
    overflow: hidden;
}

.main-chat {
    flex: 1;
    background: #f0f5fb;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ROOM TABBAR - Stile 123FlashChat */
.room-tabbar {
    background: #d8e2eb;
    border-bottom: 1px solid #8593a0;
    display: flex;
    gap: 3px;
    padding: 3px 5px 0 5px;
    flex-shrink: 0;
}

.room-tab {
    background: linear-gradient(to bottom, #cddfee, #fff);
    border: 1px solid #8593a0;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 6px 12px;
    font-size: 1.0em;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    position: relative;
}

.room-tab.active {
    background: #fff;
    color: #2668b6;
    margin-bottom: -1px;
    padding-bottom: 7px;
}

.room-tab:hover:not(.active) {
    background: #d2e0eb;
}

.tab-unread {
    background: #ff7d00;
    color: white;
    border-radius: 10px;
    padding: 0 6px;
    font-size: 0.8em;
    min-width: 18px;
    text-align: center;
}

.tab-close {
    color: #999;
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 3px;
    border-radius: 3px;
}

.tab-close:hover {
    background: #b74747;
    color: white;
}



/* MESSAGE STYLES */
.message {
    margin-bottom: 6px;
    clear: both;
    position: relative;
    min-height: 32px;
    padding: 5px 8px;
    border-radius: 8px;
}

.message.system {
    background: rgba(210, 224, 235, 0.6);
    text-align: center;
    font-style: italic;
    color: #000000;
    font-size: 15px;
    font-weight: 600;
}

.message .avatar {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    float: left;
    margin-right: 8px;
    cursor: pointer;
}

.message strong {
    cursor: pointer;
    margin-right: 8px;
}

.msg-own-nick-arrow {
    color: #1a73e8;
    font-weight: 900;
}

.message-time {
    float: right;
    font-size: 0.8em;
    color: #2566e6;
}

.message .chat-image {
    max-width: 320px;
    max-height: 240px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
}

.sound-message {
    background: #eef3f7;
    padding: 5px;
    border-radius: 8px;
    display: inline-block;
}

/* MESSAGE BOX */
.message-box {
    background: #fff;
    border-top: 1px solid #8593a0;
    flex-shrink: 0;
}

.toolbar-line {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 8px;
    background: linear-gradient(to bottom, #dae5eb, #fff);
    border-bottom: 1px solid #fff;
}

.toolbar-line select {
    background: #fff;
    border: 1px solid #a1b5c7;
    border-radius: 4px;
    padding: 3px 5px;
    font-family: Tahoma;
}

.toolbar-grow {
    flex: 1;
}

.input-line {
    display: flex;
    align-items: flex-end;
    padding: 8px;
    gap: 8px;
}

.input-avatar {
    border: 0px solid #a0b4c5;
    border-radius: 5px;
    padding: 2px;
    cursor: pointer;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.input-avatar img {
    width: 42px;
    height: 42px;
    border-radius: 4px;
}

#messageInput {
    flex: 1;
    border: 1px solid #a1b5c7;
    border-radius: 5px;
    padding: 8px;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 14px;
    resize: none;
    min-height: 50px;
    background: #fff;
}

.send-stack button {
    background: linear-gradient(to bottom, #cfd8e9, #e5eaf3);
    border: 1px solid #a1b5c7;
    border-radius: 5px;
    padding: 8px 20px;
    font-weight: bold;
    cursor: pointer;
    color: #333;
}

.send-stack button:hover {
    background: linear-gradient(to bottom, #99abcf, #dae1ee);
    color: #2668b6;
}

/* SIDE PANEL - Stile 123FlashChat */
.side-panel {
    width: 260px;
    background: #f3f6fb;
    border-left: 0px solid #8593a0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.me-card {
    background: linear-gradient(to bottom, #dcedfb, #a9c6dd);
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #000000;
}

.me-card img {
    width: 45px;
    height: 45px;
    border-radius: 5px;
    border: 1px solid white;
}

.me-card strong {
    font-size: 1.1em;
}

.me-card button {
    margin-left: unset;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #e66b00;
    font-size: 1.2em;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 5px;
}

.side-search {
    background: #fff;
    border: 1px solid #a0b4c5;
    border-radius: 5px;
    margin: 10px;
    padding: 5px 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.side-search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
}

.side-tabs {
    display: flex;
    border-bottom: 1px solid #8593a0;
    margin: 0 0px;
}

.side-tabs button {
    flex: 1;
    background: linear-gradient(to bottom, #cddfee, #fff);
    border: 1px solid #8593a0;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 6px;
    cursor: pointer;
    font-weight: bold;
    color: #333;
    margin-right: 2px;
}

.side-tabs button.active {
    background: #fff;
    color: #2668b6;
}

.side-tab-panel {
    flex: 1;
    overflow-y: auto;
    margin: 5px;
}

/* USER LIST - Stile 123FlashChat */
.users-list, .rooms-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: #fff;
    border: 1px solid #e4ebf0;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.2s;
}

.user-item:hover {
    background: #abc8dc;
}

.user-list-inline-avatar {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    vertical-align: middle;
}

.user-mood-icon-wrap {
    display: inline-block;
    margin-right: 5px;
}

.user-mood-icon-img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.user-media-badges {
    display: inline-flex;
    gap: 3px;
    margin-left: 5px;
}

.user-media-badge {
    display: inline-block;
    font-size: 0.8em;
}

/* Nickname Colors */
.nickname-role-superadmin { color: #d4af37; }
.nickname-role-admin { color: #2f72c9; }
.nickname-role-moderator { color: #b74747; }
.nickname-role-dj { color: #7a52c7; }
.nickname-user-male { color: #1f4f7a; }
.nickname-user-female { color: #ad3d71; }
.nickname-user-neutral { color: #4f5965; }
.nickname-role-guest { color: #2E4A62; }

/* MODALI e POPUP - Stile 123FlashChat */
.legacy-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #f3f6fb;
    border: 1px solid #8593a0;
    border-radius: 0px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    z-index: 1000;
    min-width: 300px;
    max-width: 90%;
    max-height: 90%;
    //overflow: auto;
}

.modal-title {
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    padding: 3px 20px;
    color: white;
    font-weight: 700;
    font-size: 1.1em;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0px 0px 0 0;
    text-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.modal-title button {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    color: white;
    font-size: 1.1em;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-title button:hover {
    background: rgba(255, 255, 255, 0.28);
}

.modal-actions {
    padding: 14px 20px 18px;
    display: flex;
    justify-content: center;
    gap: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
}

.modal-actions button {
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 8px;
    padding: 8px 20px;
    cursor: pointer;
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    text-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.modal-actions button:hover {
    background: rgb(0 206 255 / 68%);
    border-color: rgb(44 154 199 / 55%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.modal-actions button[type="submit"] {
    background: rgba(22, 128, 212, 0.70);
    border-color: rgba(22, 128, 212, 0.85);
    box-shadow: 0 2px 10px rgba(22, 128, 212, 0.30);
}

.modal-actions button[type="submit"]:hover {
    background: rgba(22, 128, 212, 0.88);
    box-shadow: 0 6px 18px rgba(22, 128, 212, 0.40);
}

.modal-actions button.secondary {
    background: rgb(255 0 0);
    border-color: rgb(0 0 0 / 92%);
    color: rgba(255, 255, 255, 0.80);
}

/* AVATAR GRID */
.asset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 80px));
    gap: 10px;
    padding: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.asset-grid button {
    background: #fff;
    border: 2px solid #8593a0;
    border-radius: 8px;
    padding: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.asset-grid button.active {
    border-color: #ff7d00;
    background: #fff992;
}

.asset-grid img {
    width: 100%;
    height: auto;
    border-radius: 4px;
}

/* WEBCAM WINDOWS - Stile 123FlashChat */
.webcam-window {
    position: fixed;
    background: #1e293b;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #334155;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    min-width: 250px;
    min-height: 200px;
    z-index: 10000;
}

.webcam-titlebar {
    background: #0f172a;
    padding: 8px 12px;
    cursor: move;
    display: flex;
    justify-content: space-between;
    user-select: none;
}

.webcam-title {
    color: white;
    font-weight: bold;
}

.webcam-action-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    margin: 0 4px;
    font-size: 1.1em;
}

.webcam-action-btn.close:hover {
    color: #ef4444;
}

.webcam-body {
    padding: 10px;
}

.webcam-body video {
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.webcam-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 8px;
}

.webcam-control-btn {
    background: #3b82f6;
    border: none;
    color: white;
    padding: 4px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.webcam-control-btn.stop {
    background: #ef4444;
}

/* PRIVATE CHAT WINDOWS */
.private-chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    height: 450px;
    background: #f3f6fb;
    border: 1px solid #8593a0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 10010;
}

.private-chat-header {
    background: linear-gradient(to bottom, #5987c9, #3b6bb0);
    padding: 8px 12px;
    border-radius: 8px 8px 0 0;
    display: flex;
    gap: 10px;
    cursor: move;
}

.private-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    border: 1px solid white;
}

.private-chat-header-copy {
    flex: 1;
    color: white;
}

.private-chat-title {
    font-weight: bold;
}

.private-chat-meta, .private-chat-status {
    font-size: 0.7em;
    opacity: 0.8;
    display: block;
}

.private-chat-header-actions button {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
}

.private-chat-toolbar {
    background: linear-gradient(to bottom, #dae5eb, #fff);
    padding: 6px;
    display: flex;
    gap: 5px;
    border-bottom: 1px solid #8593a0;
}

.private-chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.private-chat-compose {
    display: flex;
    padding: 8px;
    gap: 8px;
    border-top: 1px solid #8593a0;
}

.private-chat-input {
    flex: 1;
    border: 1px solid #a1b5c7;
    border-radius: 5px;
    padding: 6px;
    resize: none;
}

.private-chat-send, .private-chat-newline {
    background: linear-gradient(to bottom, #cfd8e9, #e5eaf3);
    border: 1px solid #a1b5c7;
    border-radius: 5px;
    padding: 6px 12px;
    cursor: pointer;
}

/* FLOATING POPUPS */
.floating-popup {
    position: fixed;
    background: #f3f6fb;
    border: 1px solid #8593a0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1005;
    min-width: 180px;
}

.popup-title {
    background: linear-gradient(to bottom, #9fc0db, #7299b9);
    padding: 0px 0px;
    color: #000000;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    border-radius: 5px 5px 0 0;
}

/* FONT POPUP */
.font-popup-body {
    display: flex;
    padding: 12px;
    gap: 15px;
}

.font-family-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    max-height: 150px;
    overflow-y: auto;
}

.font-family-list button {
    background: #fff;
    border: 1px solid #a1b5c7;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    text-align: left;
}

.font-family-list button.is-selected {
    background: #90a4b8;
    color: white;
}

.font-size-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
}

.font-size-grid button {
    background: #fff;
    border: 1px solid #a1b5c7;
    border-radius: 4px;
    padding: 3px;
    cursor: pointer;
}

.font-size-grid button.is-selected {
    background: #90a4b8;
    color: white;
}

.font-color-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
}

.font-color-grid button {
    width: 24px;
    height: 24px;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
}

.font-color-grid button.is-selected {
    border: 2px solid #ff7d00;
}

.font-style-row {
    display: flex;
    gap: 5px;
    margin: 8px 0;
}

.font-style-btn {
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #a1b5c7;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.font-style-btn.active {
    background: #90a4b8;
    color: white;
}

.font-preview {
    margin-top: 8px;
    padding: 5px;
    border: 1px solid #8593a0;
    border-radius: 4px;
    text-align: center;
    background: white;
}

/* SMILEY SCROLL WRAPPER — altezza fissa 4 righe, scrollbar verticale a destra */
.smiley-scroll-wrap {
    overflow-y: auto !important;
    overflow-x: hidden !important;
    width: 100% !important;
    height: calc(4 * 44px + 3 * 4px) !important;
    padding: 4px !important;
    box-sizing: border-box !important;
}

/* SMILEY PICKER — 7 colonne fisse, righe auto che crescono verso il basso */
.smiley-picker {
    display: grid !important;
    grid-template-columns: repeat(7, 44px) !important;
    grid-auto-rows: 44px !important;
    grid-auto-flow: row !important;
    gap: 4px !important;
    width: max-content !important;
    overflow: visible !important;
    padding: 0 !important;
}

.smiley-picker button {
    background: none;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1.2em;
    width: 44px !important;
    min-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    padding: 2px !important;
}

.smiley-picker button img {
    width: auto !important;
    height: auto !important;
    max-width: 40px !important;
    max-height: 40px !important;
}

/* GIFT PANEL */
.gift-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 100px));
    gap: 10px;
}

.gift-card {
    background: #fff;
    border: 2px solid #8593a0;
    border-radius: 8px;
    padding: 8px;
    text-align: center;
    cursor: pointer;
}

.gift-card.active {
    border-color: #ff7d00;
    background: #fff992;
}

.gift-card img {
    width: 50px;
    height: 50px;
}

.gift-name {
    display: block;
    font-size: 0.8em;
    font-weight: bold;
}

.gift-card-cost {
    color: #ff7d00;
    font-weight: bold;
}

/* TABS MINI */
.tabs-mini {
    display: flex;
    gap: 2px;
    padding: 8px 12px 0 12px;
    border-bottom: 1px solid #8593a0;
}

.tabs-mini button {
    background: linear-gradient(to bottom, #cddfee, #fff);
    border: 1px solid #8593a0;
    border-bottom: none;
    border-radius: 5px 5px 0 0;
    padding: 5px 12px;
    cursor: pointer;
}

.tabs-mini button.active {
    background: #fff;
    color: #2668b6;
}

/* USER CONTEXT MENU */
.user-context-menu {
    position: fixed;
    width: 210px;
    background: #f3f6fb;
    border: 1px solid #8593a0;
    border-radius: 8px;
    z-index: 10020;
}

.user-context-menu-header {
    background: linear-gradient(to bottom, #5987c9, #3b6bb0);
    padding: 8px;
    border-radius: 8px 8px 0 0;
    color: white;
}

.user-context-menu-options {
    padding: 5px;
}

.user-context-menu-option {
    display: block;
    width: 100%;
    padding: 6px 10px;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
}

.user-context-menu-option:hover {
    background: #abc8dc;
}

.user-context-menu-option.is-danger {
    color: #b74747;
}

/* ADMIN BUTTON */
[data-option="admin"], [data-admin-link] {
    display: none;
}

body[data-can-admin-panel="1"] [data-option="admin"],
body[data-can-admin-panel="1"] [data-admin-link] {
    display: block;
}

/* TOAST */
.app-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 1.2em;
    z-index: 99999;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    pointer-events: none;
}

/* PRELOADER */
.app-preloader {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #1a1f2e;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}

.app-preloader.is-hidden {
    opacity: 0;
    pointer-events: none;
}

.app-preloader-card {
    background: #f3f6fb;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 8px 30px rgba(0,0,0,0.3);
}

.app-preloader-logo {
    width: 120px;
    margin-bottom: 20px;
}

.app-preloader-spinner {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 20px 0;
}

.app-preloader-spinner span {
    width: 12px;
    height: 12px;
    background: #5987c9;
    border-radius: 50%;
    animation: bounce 0.8s infinite ease alternate;
}

.app-preloader-spinner span:nth-child(2) { animation-delay: 0.2s; }
.app-preloader-spinner span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
    0% { transform: translateY(0); }
    100% { transform: translateY(-15px); }
}

.app-preloader-version {
    color: #666;
    font-size: 0.8em;
}

/* SCROLLBAR - Stile 123FlashChat */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #d8e2eb;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb {
    background: #8593a0;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5987c9;
}

/* RESPONSIVE */
@media (max-width: 800px) {
    .chat-shell {
        min-width: 100%;
    }
    
    .side-panel {
        width: 220px;
    }
    
    .radio-banner .radio-title strong {
        display: none;
    }
}

/* FONT POPUP su mobile: le 3 colonne (Carattere/Dimensione/Colore) di questa skin
   usano un layout flex orizzontale senza wrap, quindi sotto i 760px si schiacciavano
   e il testo andava a capo male. Le impiliamo in verticale, a piena larghezza, e
   riduciamo altezze/spaziature/dimensioni per un popup piccolo e compatto. */
@media (max-width: 760px) {
    .font-popup {
        left: 12px;
        right: 12px;
        bottom: 90px;
        width: 280px;
        max-height: 380px;
    }

    .font-popup-body {
        flex-direction: column;
        gap: 6px;
        padding: 6px;
        max-height: 300px;
        overflow-y: auto;
    }

    .font-panel {
        padding: 4px;
    }

    .font-panel-title {
        margin-bottom: 2px;
        font-size: 11px;
    }

    .font-family-list {
        max-height: 64px;
        gap: 2px;
    }

    .font-family-list button {
        min-height: 18px;
        padding: 1px 5px;
        font-size: 11px;
    }

    .font-size-grid {
        grid-template-columns: repeat(auto-fill, minmax(28px, 1fr));
        gap: 3px;
    }

    .font-size-grid button {
        height: 20px;
        min-height: 20px;
        padding: 1px;
        font-size: 11px;
    }

    .font-color-grid {
        grid-template-columns: repeat(auto-fill, minmax(16px, 1fr));
        gap: 3px;
    }

    .font-color-grid button {
        width: 15px;
        height: 15px;
    }

    .font-style-row {
        gap: 3px;
        margin: 3px 0;
    }

    .font-style-btn {
        width: 20px;
        height: 20px;
        min-height: 20px;
        font-size: 12px;
    }

    .font-preview {
        min-height: 20px;
        margin-top: 3px;
        padding: 2px 4px;
        font-size: 11px;
    }
}
/* ----------------------------------------------------------------
   COLORI SKIN VIDEOCHAT   personalizzabili dal pannello admin.
   Override in fondo al file, con !important, per avere sempre
   la priorita sulle dichiarazioni di base della skin qui sopra.
   ---------------------------------------------------------------- */
.user-item {
    background: var(--chatskin-useritem-bg, #ffffff) !important;
}
.user-item:hover {
    background: var(--chatskin-useritem-hover-bg, #abc8dc) !important;
}