/* Aticus Live Chat Widget Styles */

:root {
    --atk-chat-bg: #0d0f14;
    --atk-chat-bg-glass: rgba(13, 15, 20, 0.92);
    --atk-chat-border: rgba(255, 255, 255, 0.08);
    --atk-chat-border-hover: rgba(255, 255, 255, 0.16);
    --atk-chat-accent: #bef264;
    --atk-chat-accent-dark: #a3e635;
    --atk-chat-text: #f3f4f6;
    --atk-chat-text-muted: rgba(255, 255, 255, 0.45);
    --atk-chat-bubble-visitor: #222938;
    --atk-chat-bubble-operator: #161a22;
}

.atk-chat-wrapper {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--atk-chat-text);
}

/* Launcher Button */
.atk-chat-launcher {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1c222e 0%, #0d1117 100%);
    border: 1px solid var(--atk-chat-border-hover);
    color: var(--atk-chat-accent);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(190, 242, 100, 0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
    outline: none;
}

.atk-chat-launcher:hover {
    transform: scale(1.06);
    box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.7), 0 0 0 2px rgba(190, 242, 100, 0.25);
}

.atk-chat-launcher:active {
    transform: scale(0.96);
}

.atk-chat-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    background: var(--atk-chat-accent);
    color: #0d1117;
    font-size: 11px;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    line-height: 20px;
    border-radius: 10px;
    text-align: center;
    padding: 0 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
    animation: atkBadgePop 0.3s ease;
}

@keyframes atkBadgePop {
    0% { transform: scale(0); }
    80% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Chat Modal Window */
.atk-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);
    background: var(--atk-chat-bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--atk-chat-border);
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.96);
    transform-origin: bottom right;
    transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.28s;
}

.atk-chat-window.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.atk-chat-header {
    padding: 16px 20px;
    background: rgba(22, 27, 36, 0.7);
    border-bottom: 1px solid var(--atk-chat-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.atk-chat-header-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.atk-chat-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(190, 242, 100, 0.12);
    border: 1px solid rgba(190, 242, 100, 0.25);
    color: var(--atk-chat-accent);
    display: flex;
    align-items: center;
    justify-content: center;
}

.atk-chat-title {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: #ffffff;
}

.atk-chat-status {
    font-size: 11px;
    color: var(--atk-chat-text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 1px;
}

.atk-chat-status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 8px #22c55e;
}

.atk-chat-close-btn {
    background: transparent;
    border: none;
    color: var(--atk-chat-text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background-color 0.2s;
}

.atk-chat-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

/* Messages Container */
.atk-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    scroll-behavior: smooth;
    overscroll-behavior: contain;
}

.atk-chat-messages::-webkit-scrollbar {
    width: 5px;
}

.atk-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}

/* Messages */
.atk-msg {
    max-width: 82%;
    display: flex;
    flex-direction: column;
    animation: atkMsgFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes atkMsgFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.atk-msg-operator {
    align-self: flex-start;
}

.atk-msg-visitor {
    align-self: flex-end;
}

.atk-msg-bubble {
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.45;
    word-break: break-word;
}

.atk-msg-operator .atk-msg-bubble {
    background: var(--atk-chat-bubble-operator);
    border: 1px solid var(--atk-chat-border);
    color: #e5e7eb;
    border-bottom-left-radius: 3px;
}

.atk-msg-visitor .atk-msg-bubble {
    background: var(--atk-chat-bubble-visitor);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-bottom-right-radius: 3px;
}

.atk-msg-time {
    font-size: 10px;
    color: var(--atk-chat-text-muted);
    margin-top: 4px;
    padding: 0 4px;
}

.atk-msg-operator .atk-msg-time {
    align-self: flex-start;
}

.atk-msg-visitor .atk-msg-time {
    align-self: flex-end;
}

/* Contact Gate Banner */
.atk-chat-gate {
    margin: 0 16px 12px 16px;
    padding: 12px 14px;
    background: rgba(26, 32, 44, 0.7);
    border: 1px dashed rgba(190, 242, 100, 0.3);
    border-radius: 12px;
    animation: atkMsgFadeIn 0.3s ease;
}

.atk-gate-title {
    font-size: 11.5px;
    font-weight: 500;
    color: #e2e8f0;
    margin-bottom: 8px;
}

.atk-gate-switch {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.atk-gate-tab {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--atk-chat-border);
    color: var(--atk-chat-text-muted);
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.atk-gate-tab.active {
    background: rgba(190, 242, 100, 0.12);
    border-color: var(--atk-chat-accent);
    color: var(--atk-chat-accent);
    font-weight: 600;
}

.atk-gate-input-row {
    display: flex;
    gap: 6px;
}

.atk-gate-input {
    flex: 1;
    background: rgba(13, 15, 20, 0.85);
    border: 1px solid var(--atk-chat-border);
    color: #ffffff;
    font-size: 12.5px;
    padding: 6px 10px;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.2s;
}

.atk-gate-input:focus {
    border-color: var(--atk-chat-accent);
}

.atk-gate-submit {
    background: var(--atk-chat-accent);
    color: #0d1117;
    border: none;
    font-size: 11.5px;
    font-weight: 700;
    padding: 0 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.atk-gate-submit:hover {
    opacity: 0.9;
}

.atk-gate-consent {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    font-size: 10px;
    color: var(--atk-chat-text-muted);
    margin-top: 8px;
    cursor: pointer;
    line-height: 1.3;
}

.atk-gate-consent a {
    color: #cbd5e1;
    text-decoration: underline;
}

.atk-gate-consent a:hover {
    color: #ffffff;
}

/* Footer & Input */
.atk-chat-footer {
    padding: 12px 16px;
    background: rgba(22, 27, 36, 0.75);
    border-top: 1px solid var(--atk-chat-border);
}

.atk-input-container {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    background: rgba(13, 15, 20, 0.85);
    border: 1px solid var(--atk-chat-border);
    border-radius: 12px;
    padding: 6px 8px 6px 12px;
    transition: border-color 0.2s;
}

.atk-input-container:focus-within {
    border-color: var(--atk-chat-border-hover);
}

.atk-chat-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 13.5px;
    resize: none;
    line-height: 1.4;
    max-height: 90px;
    padding: 4px 0;
    font-family: inherit;
}

.atk-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.atk-chat-send-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--atk-chat-accent);
    color: #0d1117;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: opacity 0.2s, transform 0.15s;
}

.atk-chat-send-btn:hover {
    opacity: 0.9;
    transform: scale(1.04);
}

.atk-chat-send-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .atk-chat-wrapper {
        bottom: 16px;
        right: 16px;
    }

    .atk-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
        border: none;
    }

    .atk-chat-footer {
        padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    }
}
