﻿/* ===============================
   TICKET MODAL
================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow-x: auto;
    overflow-y: auto;
    padding: 20px;
    cursor: default;
}

.modal-ticket {
    max-width: 1000px;
}

.hidden {
    display: none;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    width: min(1400px, 96vw);
    max-width: 1400px;
    max-height: 90vh;
    padding: 28px;
    position: relative;
    overflow-y: auto;
    animation: scaleIn .2s ease;
}

/* Close button */
.modal-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-muted);
}

    .modal-close:hover {
        color: var(--text-main);
    }

/* Title */
.modal-title {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

/* Meta */
.modal-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
}

.badge {
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--primary-soft);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 600;
}

/* Sections */
.modal-section h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.modal-section p {
    font-size: 0.95rem;
    line-height: 1.5;
    padding: 18px;
}

/* Grid */
.modal-grid {
    margin-top: 24px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

    .modal-grid label {
        font-size: 0.7rem;
        text-transform: uppercase;
        color: var(--text-muted);
    }

    .modal-grid span {
        font-size: 0.9rem;
        font-weight: 500;
    }

/* Animation */
@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile */
@media (max-width: 900px) {

    .modal {
        width: 96vw;
        max-width: 96vw;
        padding: 18px;
    }

    .modal-meta-grid {
        grid-template-columns: 1fr;
    }

    .chat-bubble {
        max-width: 85%;
    }
}

/* CHAT */

.chat-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px 0;
    background: aliceblue;
    border-radius: 15px;
}

/* mensagem */

.chat-message {
    display: flex;
    width: 100%;
}

    /* minhas mensagens */

    .chat-message.me {
        justify-content: flex-end;
    }

    /* outros tecnicos*/
    .chat-message.me-outro {
        justify-content: flex-end;
    }

    /* mensagens recebidas */

    
    

    .chat-message.other {
        justify-content: flex-start;
    }

/* balões */

.chat-bubble {
    max-width: 65%;
    padding: 8px 12px;
    border-radius: 14px;
    font-size: 0.9rem;
    line-height: 1.4;
    word-break: break-word;
}

/* cliente */

.chat-message.me .chat-bubble {
    background: #dcfce7;
}

/* admin / técnico */

.chat-message.other .chat-bubble {
    background: #e5e7eb;
}

/* Outro admin/técnico → direita → azul claro */
.chat-message.me-outro .chat-bubble {
    background: #3b82f6; /* azul claro */
    
}

/* meta */

.chat-meta {
    font-size: 0.65rem;
    opacity: .7;
    margin-bottom: 2px;
}

/* autor */

.chat-author {
    font-weight: 600;
}

/* data */

.chat-date {
    margin-left: 6px;
}

/* texto */

.chat-content {
    white-space: normal;
}

/* input */

.chat-input {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

    .chat-input textarea {
        flex: 1;
        resize: none;
        padding: 8px;
        border-radius: 10px;
        border: 1px solid #e5e7eb;
    }

    .chat-input button {
        padding: 0 16px;
        border: none;
        border-radius: 10px;
        background: #16a34a;
        color: white;
        cursor: pointer;
    }

        .chat-input button:hover {
            background: #15803d;
        }

.chat-container::-webkit-scrollbar {
    width: 6px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

/*ChatImage*/
.chat-anexos ul {
    list-style: none;
    padding: 0;
    margin: 5px 0 0 0;
}

.chat-anexos li {
    margin-bottom: 6px;
}

.chat-image-preview {
    width: 200px;
    height: 150px;
    object-fit: cover; /* 🔥 mantém proporção e corta excesso */
    border-radius: 6px;
    margin-top: 4px;
    cursor: pointer;
    transition: transform 0.2s;
}

    .chat-image-preview:hover {
        transform: scale(1.1);
        box-shadow: 0 0 6px rgba(0,0,0,0.3);
    }