/* =========================
   Judge IA - Commercial UI
   ========================= */

.judgeia-widget {
    position: fixed;
    z-index: 999999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.judgeia-widget.bottom-right {
    bottom: 20px;
    right: 20px;
}

.judgeia-widget.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* ================= BOTÃO ================= */

.judgeia-button {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--judgeia-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    position: relative;
}

.judgeia-button img {
    width: 60%;
    height: 60%;
    border-radius: 50%;
    object-fit: cover;
}

.judgeia-default-icon {
    font-size: 26px;
    color: #fff;
}

.judgeia-led {
    width: 10px;
    height: 10px;
    background: red;
    border-radius: 50%;
    position: absolute;
    top: 6px;
    right: 6px;
}

/* ================= CHAT ================= */

.judgeia-chat {
    width: 415px;   /* antes 360 */
    height: 600px;  /* antes 520 */
    position: fixed;
    right: 20px;
    bottom: 20px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.25s ease;
}
.judgeia-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
}
.judgeia-hidden {
    display: none !important;
}
/* ================= ESTADO EXPANDIDO ================= */

.judgeia-expanded {
    width: 80vw !important;
    height: 85vh !important;
    right: 10vw !important;
    bottom: 7vh !important;
}
/* ================= ESTADO MINIMIZADO ================= */

.judgeia-chat.judgeia-minimized {
    height: 70px;
}

.judgeia-chat.judgeia-minimized .judgeia-messages,
.judgeia-chat.judgeia-minimized .judgeia-input-area,
.judgeia-chat.judgeia-minimized #judgeia-limit-counter {
    opacity: 0;
    pointer-events: none;
}

.judgeia-chat .judgeia-messages,
.judgeia-chat .judgeia-input-area,
#judgeia-limit-counter {
    transition: opacity 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ================= HEADER ================= */

.judgeia-header {
    background: var(--judgeia-primary);
    color: #fff;
    padding: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.judgeia-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.judgeia-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}

.judgeia-header-actions button {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    margin-left: 6px;
}

/* ================= MENSAGENS ================= */

.judgeia-messages {
    flex: 1;
    padding: 14px;
    overflow-y: auto;
    background: #f5f7fa;
}

.judgeia-message {
    margin-bottom: 12px;
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
    position: relative;
}

.judgeia-user {
    background: var(--judgeia-primary);
    color: #fff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.judgeia-ai {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
}

.judgeia-audio-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    margin-top: 6px;
    color: var(--judgeia-primary);
}

/* ================= INPUT ================= */

.judgeia-input-area {
    display: flex;
    border-top: 1px solid #eee;
}

.judgeia-input-area input {
    flex: 1;
    padding: 12px;
    border: none;
    outline: none;
    font-size: 14px;
}

.judgeia-input-area button {
    background: var(--judgeia-primary);
    color: #fff;
    border: none;
    padding: 0 18px;
    cursor: pointer;
}

/* ================= LOADER ================= */

.judgeia-loader {
    display: flex;
    justify-content: center;
    padding: 10px;
}

.judgeia-loader span {
    width: 6px;
    height: 6px;
    margin: 0 3px;
    background: var(--judgeia-primary);
    border-radius: 50%;
    animation: bounce 1s infinite ease-in-out;
}

.judgeia-loader span:nth-child(2) { animation-delay: .2s; }
.judgeia-loader span:nth-child(3) { animation-delay: .4s; }

@keyframes bounce {
    0%,80%,100% { transform: scale(0); }
    40% { transform: scale(1); }
}