/* ChatUni - Modals CSS */
/* Modali, chat UI, form, bottoni, preloader */

/* Modal */
.modal {
    position: fixed;
    z-index: 2000;
    left: 0;

    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    /* backdrop-filter removed - causes black squares on Android */
    opacity: 0;
    pointer-events: none;
    transition: 0.4s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

body:has(.modal.active) .nav-arrow {
    display: none !important;
}

.modal-content {
    background: rgba(5, 5, 10, 0.95);
    padding: 30px;
    border: 1px solid #00f2ff;
    width: 500px;
    max-width: 95%;
    height: auto;
    max-height: calc(85vh - 60px);
    margin-top: 60px;
    box-shadow: 0 0 40px rgba(0, 242, 255, 0.2);
    text-align: center;
    position: relative;
    display: flex;
    flex-direction: column;
}

.message-modal .modal-content {
    border-color: #ff00ff;
    box-shadow: 0 0 40px rgba(255, 0, 255, 0.2);
}

.alert-modal .modal-content {
    border: 2px solid #ff003c !important;
    box-shadow: 0 0 50px rgba(255, 0, 60, 0.3) !important;
    width: 400px;
    max-width: 90%;
    z-index: 10001;
}

.close-modal-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #ff00ff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: 0.3s;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.close-modal-btn:hover {
    color: #fff;
    text-shadow: 0 0 10px #ff00ff;
}

h2,
h3 {
    margin-bottom: 25px;
    color: #00f2ff;
    letter-spacing: 4px;
    text-transform: uppercase;
}

.alert-message {
    font-size: 0.9rem;
    color: #ddd;
    line-height: 1.5;
    letter-spacing: 1px;
}

/* Login */
#login-modal .modal-content {
    width: 450px;
    padding: 40px;
    display: block;
}

#login-form button {
    width: 100%;
    background: rgba(0, 242, 255, 0.1);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
    padding: 15px;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #00f2ff;
    color: #00f2ff;
    font-family: 'Orbitron', sans-serif;
    outline: none;
    text-align: center;
    font-size: 1rem;
    transition: 0.3s;
}

input[type="password"]:focus {
    border-color: #ff00ff;
}

textarea {
    width: 100%;
    height: 140px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #ff00ff;
    color: #ff00ff;
    font-family: inherit;
    margin-bottom: 15px;
    resize: none;
    outline: none;
}

.modal-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

button {

    padding: 12px;
    background: transparent;
    border: 1px solid #00f2ff;
    color: #00f2ff;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: 0.3s;
}

button:hover {
    background: rgba(0, 242, 255, 0.1);
    box-shadow: 0 0 10px rgba(0, 242, 255, 0.3);
}

.alert-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.alert-cancel-btn {
    border-color: #ff003c !important;
    color: #ff003c !important;
}

.alert-confirm-btn {
    border-color: #00ff41 !important;
    color: #00ff41 !important;
}

/* Chat UI */
.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 0, 255, 0.3);
    padding: 0 40px 10px 0;
    margin-bottom: 15px;
    position: relative;
}

.chat-header-info {
    display: flex;
    flex-direction: column;
}

.chat-location {
    font-size: 0.85rem;
    color: #00f2ff;
    letter-spacing: 1px;
    font-weight: bold;
}

.chat-status {
    color: #00ff41;
    font-size: 0.7rem;
    opacity: 0.8;
}

.chat-timer {
    color: #ff003c;
    font-weight: bold;
    font-size: 0.9rem;
    text-shadow: 0 0 8px rgba(255, 0, 60, 0.4);
    margin-right: 15px;
    min-width: 60px;
    text-align: right;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.force-close-btn {
    padding: 6px 3px;
    background: #ff003c;
    color: white;
    border: 1px solid #ff3366;
    border-radius: 4px;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    box-shadow: 0 0 8px rgba(255, 0, 60, 0.4);
    font-size: 0.7rem;
    min-width: 40px;
    height: 28px;
}

.force-close-btn:hover {
    background: #ff3366;
    box-shadow: 0 0 15px rgba(255, 0, 60, 0.6);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 200px;
    padding: 15px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    scrollbar-width: thin;
    scrollbar-color: #ff00ff rgba(0, 0, 0, 0);
    margin-bottom: 10px;
}

.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #ff00ff;
    border-radius: 10px;
}

.chat-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    position: relative;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    user-select: text !important;
    cursor: pointer;
}

.chat-message:active {
    background: rgba(255, 255, 255, 0.1);
}

/* Media Messages */
.media-message {
    max-width: 90%;
    padding: 12px;
    border-radius: 12px;
    position: relative;
    word-break: break-word;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.media-content {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.media-audio .media-audio-player {
    width: 250px;
    height: 40px;
    border-radius: 20px;
    border: 1px solid rgba(0, 242, 255, 0.3);
    background: rgba(0, 0, 0, 0.4);
}

.media-image .media-img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 1px solid rgba(0, 242, 255, 0.2);
}

.media-image .media-img:hover {
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
}

.media-expiry {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.65rem;
    color: #ffb800;
    font-family: 'Share Tech Mono', monospace;
    margin-top: 4px;
    padding: 4px 8px;
    background: rgba(255, 184, 0, 0.1);
    border: 1px solid rgba(255, 184, 0, 0.2);
    border-radius: 4px;
    width: fit-content;
}

.media-expiry .media-countdown {
    color: #ffb800;
    font-weight: bold;
}

/* Secondary buttons chat bar */
.chat-secondary-bar {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px;
    background: rgba(0, 0, 0, 0.3);
    border-top: 1px solid rgba(0, 242, 255, 0.2);
    margin-top: 8px;
}

.msg-sent {
    align-self: flex-end;
    background: rgba(0, 242, 255, 0.2);
    border: 1px solid #00f2ff;
    border-bottom-right-radius: 2px;
    color: #fff;
}

.msg-received {
    align-self: flex-start;
    background: rgba(255, 0, 255, 0.15);
    border: 1px solid #ff00ff;
    border-bottom-left-radius: 2px;
    color: #fff;
}

.message-sender {
    display: block;
    font-size: 0.65rem;
    font-weight: bold;
    margin-bottom: 4px;
    opacity: 0.7;
    text-transform: uppercase;
    color: #00f2ff;
}

.msg-received .message-sender {
    color: #ff00ff;
}

.chat-input-container {
    display: flex;
    gap: 6px;
    padding: 12px 0;
    align-items: center;
}

.chat-input-container .voice-record-btn {
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.chat-input-container .voice-record-btn:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 12px rgba(255, 0, 255, 0.4);
    transform: scale(1.05);
}

#chat-msg-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.07);
    border: 2px solid rgba(255, 0, 255, 0.3);
    border-radius: 24px;
    padding: 12px 20px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    min-width: 0;
}

#chat-msg-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

#chat-msg-input:focus {
    border-color: #ff00ff;
    background: rgba(255, 0, 255, 0.08);
    box-shadow: 0 0 16px rgba(255, 0, 255, 0.25);
}

.chat-send-btn {
    background: #ff00ff;
    color: #000;
    border: none;
    border-radius: 8px;
    width: 38px;
    height: 38px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-size: 0.9rem;
    padding: 0;
}

.chat-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.5);
    background: #ff33ff;
}

/* Secondary Bar */
.chat-secondary-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0 4px;
    justify-content: center;
    align-items: center;
    border-top: 1px solid rgba(255, 0, 255, 0.15);
    margin-top: 8px;
}

.secondary-btn {
    background: transparent;
    border: 1px solid rgba(255, 0, 255, 0.3);
    color: #ff00ff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.6rem;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.secondary-btn:hover {
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

.secondary-btn.security-monitor-btn {
    border-color: rgba(255, 184, 0, 0.4);
    color: #ffb800;
}

.secondary-btn.security-monitor-btn:hover {
    background: rgba(255, 184, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 184, 0, 0.3);
}

.secondary-btn.matrix-bot-btn {
    border-color: rgba(0, 255, 65, 0.4);
    color: #00ff41;
}

.secondary-btn.matrix-bot-btn:hover {
    background: rgba(0, 255, 65, 0.15);
    box-shadow: 0 0 8px rgba(0, 255, 65, 0.3);
}

.secondary-btn.anti-shinigami-btn {
    border-color: rgba(255, 0, 60, 0.4);
    color: #ff003c;
}

.secondary-btn.anti-shinigami-btn:hover {
    background: rgba(255, 0, 60, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 60, 0.3);
}

.secondary-select {
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid rgba(255, 0, 60, 0.4);
    color: #ff003c;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.55rem;
    padding: 5px 6px;
    outline: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-select:hover {
    background: rgba(255, 0, 60, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 60, 0.2);
}

/* Burn Group */
.burn-group {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
}

.burn-all-btn {
    border-color: rgba(255, 0, 60, 0.5) !important;
    color: #ff003c !important;
}

.burn-all-btn:hover {
    background: rgba(255, 0, 60, 0.2) !important;
    box-shadow: 0 0 10px rgba(255, 0, 60, 0.4) !important;
}

/* Voice Record Secondary Button */
.secondary-btn.voice-record-secondary-btn {
    border-color: rgba(255, 0, 255, 0.4);
    color: #ff00ff;
}

.secondary-btn.voice-record-secondary-btn:hover {
    background: rgba(255, 0, 255, 0.15);
    box-shadow: 0 0 8px rgba(255, 0, 255, 0.3);
}

/* Upload Button */
.secondary-btn.upload-btn {
    border-color: rgba(0, 242, 255, 0.4);
    color: #00f2ff;
}

.secondary-btn.upload-btn:hover {
    background: rgba(0, 242, 255, 0.15);
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.3);
}

/* Tortuga TV Button */
.secondary-btn.tortuga-tv-btn {
    border-color: rgba(255, 102, 0, 0.4);
    color: #ff6600;
}

.secondary-btn.tortuga-tv-btn:hover {
    background: rgba(255, 102, 0, 0.15);
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.3);
}

/* Voice */
.voice-recording-container {
    margin-top: 15px;
    text-align: center;
}

.voice-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.voice-record-btn {
    background: transparent;
    border: 2px solid #ff00ff;
    color: #ff00ff;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
}

.voice-record-btn:hover {
    background: #ff00ff;
    color: #000;
    box-shadow: 0 0 20px #ff00ff;
}

.voice-record-btn.recording {
    background: #ff00ff;
    color: #000;
    animation: pulse 1s infinite;
    box-shadow: 0 0 30px #ff00ff;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Preloader */
.preloader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00f2ff;
    font-family: 'Orbitron', sans-serif;
    overflow: hidden;
}

#matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.preloader-content {
    max-width: 500px;
    padding: 30px;
    border: 2px solid #00f2ff;
    background: rgba(5, 5, 10, 0.98);
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.3);
    text-align: center;
    position: relative;
    z-index: 2;
}

.preloader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(0, 242, 255, 0.3);
    padding-bottom: 10px;
}

.close-x {
    cursor: pointer;
    font-size: 1.5rem;
    color: #ff00ff;
    transition: 0.3s;
}

.close-x:hover {
    transform: scale(1.2);
    text-shadow: 0 0 10px #ff00ff;
}

.warning-text {
    color: #ff00ff;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9rem;
    text-transform: uppercase;
}

.info-scroll {
    text-align: left;
    background: rgba(255, 255, 255, 0.03);
    padding: 15px;
    border-left: 3px solid #00f2ff;
    margin-bottom: 20px;
}

.info-scroll p {
    margin-bottom: 10px;
    font-size: 0.85rem;
    line-height: 1.4;
}

.critical {
    color: #ff0000;
    font-weight: bold;
    text-shadow: 0 0 5px #ff0000;
}

.proxy-btn {
    background: transparent;
    border: 1px solid #00f2ff;
    color: #00f2ff;
    padding: 12px 25px;
    cursor: pointer;
    margin-top: 10px;
    font-family: inherit;
    font-size: 0.8rem;
    letter-spacing: 1px;
    transition: 0.3s;
}

.proxy-btn:hover {
    background: rgba(0, 242, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.4);
}

.counter-container {
    margin-top: 25px;
    font-size: 0.75rem;
    opacity: 0.7;
    letter-spacing: 1px;
}

#preloader-counter {
    color: #ff00ff;
    font-weight: bold;
}

.message-limits-display {
    display: none !important;
}

/* ────────────────────────────────────────────────────────────
   VPN Key Login Modal
   ──────────────────────────────────────────────────────────── */
#vpn-key-login-modal .modal-content {
    max-width: 480px;
    border: 2px solid #ff003c !important;
    box-shadow: 0 0 40px rgba(255, 0, 60, 0.3), inset 0 0 20px rgba(255, 0, 60, 0.1) !important;
}

#vpn-key-login-modal .vpn-warning {
    animation: vpn-pulse 2s infinite;
}

@keyframes vpn-pulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(255, 0, 60, 0.3);
    }

    50% {
        box-shadow: 0 0 20px rgba(255, 0, 60, 0.5);
    }
}

#vpn-premium-key-input {
    font-size: 0.9rem !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
}

#vpn-premium-key-input:focus {
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.5) !important;
    border-color: #ffb800 !important;
}

#vpn-key-form button[type="submit"] {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 2px;
    transition: all 0.3s ease;
}

#vpn-key-form button[type="submit"]:hover {
    background: rgba(255, 184, 0, 0.3) !important;
    box-shadow: 0 0 20px rgba(255, 184, 0, 0.4);
    transform: scale(1.02);
}

/* ────────────────────────────────────────────────────────────
   Cambia Nome Button (Premium)
   ──────────────────────────────────────────────────────────── */
#change-name-btn {
    transition: all 0.3s ease;
    font-size: 0.75rem;
}

#change-name-btn:hover {
    box-shadow: 0 0 20px rgba(0, 242, 255, 0.5) !important;
    transform: scale(1.05);
    background: rgba(0, 242, 255, 0.2) !important;
}

/* ═══════════════════════════════════════════════════════════════════
   OPEN TORTUGA - Modale Multi-Chat Desktop
   ═══════════════════════════════════════════════════════════════════ */

.multi-chat-modal .modal-content {
    width: 1100px;
    max-width: 98%;
    height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    border-color: #00ff41 !important;
    box-shadow: 0 0 50px rgba(0, 255, 65, 0.3) !important;
}

.multi-chat-header {
    flex-shrink: 0;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 255, 65, 0.05);
}

.multi-chat-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.multi-chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 10px;
    scrollbar-width: thin;
    scrollbar-color: #00ff41 rgba(0, 0, 0, 0);
    min-height: 0;
}

.multi-chat-messages::-webkit-scrollbar {
    width: 8px;
}

.multi-chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

.multi-chat-messages::-webkit-scrollbar-thumb {
    background: #00ff41;
    border-radius: 10px;
}

.multi-chat-messages::-webkit-scrollbar-thumb:hover {
    background: #00ff88;
}

.multi-chat-input-area {
    flex-shrink: 0;
    padding: 15px;
    border-top: 1px solid rgba(0, 255, 65, 0.2);
    background: rgba(0, 0, 0, 0.2);
}

.free-user-timer {
    color: #ffb800;
    font-size: 0.8rem;
    padding: 5px 10px;
    background: rgba(255, 184, 0, 0.1);
    border-radius: 4px;
    border: 1px solid rgba(255, 184, 0, 0.3);
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

/* Responsive per modale multi-chat */
@media (max-width: 900px) {
    .multi-chat-modal .modal-content {
        width: 100%;
        height: 95vh;
    }
}

/* ═══════════════════════════════════════════════════════════════════
   TORTEGA WALLET Modal - Desktop Fix
   ═══════════════════════════════════════════════════════════════════ */
@media (min-width: 769px) {
    #wallet-modal .modal-content {
        max-width: 420px !important;
        max-height: 75vh !important;
        overflow-y: auto !important;
        padding: 25px !important;
    }

    #wallet-modal h2 {
        font-size: 1.2rem !important;
        margin-bottom: 12px !important;
    }

    #wallet-modal h3 {
        font-size: 0.85rem !important;
        margin-bottom: 8px !important;
    }

    #wallet-modal input {
        padding: 10px !important;
        font-size: 0.85rem !important;
    }

    #wallet-modal button {
        padding: 10px !important;
        font-size: 0.8rem !important;
    }

    #wallet-modal p {
        font-size: 0.75rem !important;
        margin-bottom: 8px !important;
    }
}

/* Scrollbar personalizzata per modale wallet */
#wallet-modal .modal-content::-webkit-scrollbar {
    width: 6px;
}

#wallet-modal .modal-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
}

#wallet-modal .modal-content::-webkit-scrollbar-thumb {
    background: #ffd700;
    border-radius: 10px;
}