/* ═══════════════════════════════════════════════════════════════
   Support Chat — Redesigned as separate slide-in panel
   ═══════════════════════════════════════════════════════════════ */

/* ── Modal Contact Option Cards ─────────────────────────────── */
.store-contact-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1.5px solid var(--border-light);
    background: var(--bg-secondary);
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
}

.store-contact-option:hover {
    border-color: var(--accent-primary);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.15);
}

.store-contact-option--chat {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(139, 92, 246, 0.06));
    border-color: rgba(99, 102, 241, 0.25);
}
.store-contact-option--chat:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(139, 92, 246, 0.10));
    border-color: rgba(99, 102, 241, 0.5);
}

.store-contact-option__icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(99, 102, 241, 0.1);
}

.store-contact-option--email .store-contact-option__icon {
    background: rgba(16, 185, 129, 0.1);
}

.store-contact-option__text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    flex: 1;
    min-width: 0;
}

.store-contact-option__label {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}

.store-contact-option__sub {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.store-contact-option__pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    animation: sc-pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.store-contact-option__arrow {
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.store-contact-option:hover .store-contact-option__arrow {
    transform: translateX(3px);
    color: var(--accent-primary);
}


/* ── Chat Panel Overlay ─────────────────────────────────────── */
.sc-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
.sc-overlay.is-open {
    opacity: 1;
    pointer-events: auto;
}


/* ── The Chat Panel ─────────────────────────────────────────── */
.sc-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    height: 560px;
    max-height: calc(100vh - 48px);
    max-width: calc(100vw - 32px);
    z-index: 9999;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;

    /* Glass effect */
    background: var(--bg-primary);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);

    /* Slide-in animation */
    transform: translateY(20px) scale(0.95);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease;
}

.sc-panel.is-open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

/* Light mode adjustments */
[data-theme="light"] .sc-panel {
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow:
        0 25px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.04);
}


/* ── Chat Header ────────────────────────────────────────────── */
.sc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    flex-shrink: 0;
}

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

.sc-header__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    position: relative;
    flex-shrink: 0;
}

.sc-header__online {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: #22c55e;
    border-radius: 50%;
    border: 2.5px solid #6366f1;
    animation: sc-pulse 2s ease-in-out infinite;
}

.sc-header__title {
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: -0.01em;
}

.sc-header__subtitle {
    font-size: 0.75rem;
    opacity: 0.8;
    margin-top: 1px;
}

.sc-header__close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
}
.sc-header__close:hover {
    background: rgba(255, 255, 255, 0.3);
}


/* ── Messages Area ──────────────────────────────────────────── */
.sc-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--bg-secondary);
    scroll-behavior: smooth;
}

[data-theme="light"] .sc-messages {
    background: #f8f9fb;
}

/* Custom scrollbar */
.sc-messages::-webkit-scrollbar { width: 5px; }
.sc-messages::-webkit-scrollbar-track { background: transparent; }
.sc-messages::-webkit-scrollbar-thumb {
    background: rgba(128, 128, 128, 0.3);
    border-radius: 10px;
}

/* Single message */
.sc-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 0.88rem;
    line-height: 1.55;
    word-break: break-word;
    position: relative;
    animation: sc-msg-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes sc-msg-in {
    from { opacity: 0; transform: translateY(8px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Support (left) bubbles */
.sc-msg--support {
    align-self: flex-start;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-bottom-left-radius: 4px;
    color: var(--text-primary);
}

[data-theme="light"] .sc-msg--support {
    background: #ffffff;
    border-color: #e5e7eb;
}

/* User (right) bubbles */
.sc-msg--user {
    align-self: flex-end;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border-bottom-right-radius: 4px;
    border: none;
}

/* Sender label */
.sc-msg__sender {
    display: block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 4px;
    opacity: 0.65;
}

/* Timestamp */
.sc-msg__time {
    display: block;
    font-size: 0.65rem;
    opacity: 0.5;
    margin-top: 4px;
    text-align: right;
}

.sc-msg--support .sc-msg__time { text-align: left; }


/* ── Input Area ─────────────────────────────────────────────── */
.sc-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-primary);
    flex-shrink: 0;
}

[data-theme="light"] .sc-input {
    background: #ffffff;
    border-top-color: #e5e7eb;
}

.sc-input__field {
    flex: 1;
    padding: 10px 14px;
    border: 1.5px solid var(--border-light);
    border-radius: 12px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.88rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: inherit;
}
.sc-input__field::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}
.sc-input__field:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

[data-theme="light"] .sc-input__field {
    background: #f3f4f6;
    border-color: #d1d5db;
}
[data-theme="light"] .sc-input__field:focus {
    background: #fff;
}

.sc-input__send {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease, box-shadow 0.2s;
}
.sc-input__send:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
}
.sc-input__send:active {
    transform: scale(0.95);
}
.sc-input__send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}


/* ── Typing indicator ───────────────────────────────────────── */
.sc-typing {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 14px;
    align-self: flex-start;
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    border-bottom-left-radius: 4px;
}
.sc-typing__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: sc-typing-bounce 1.4s infinite ease-in-out both;
}
.sc-typing__dot:nth-child(2) { animation-delay: 0.14s; }
.sc-typing__dot:nth-child(3) { animation-delay: 0.28s; }

@keyframes sc-typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}


/* ── Animations ─────────────────────────────────────────────── */
@keyframes sc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}


/* ── Welcome message area ───────────────────────────────────── */
.sc-welcome {
    text-align: center;
    padding: 10px 0 6px;
}
.sc-welcome__badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--text-secondary);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}


/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .sc-panel {
        bottom: 0;
        right: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        max-width: 100vw;
        border-radius: 0;
        transform: translateY(100%);
    }
    .sc-panel.is-open {
        transform: translateY(0);
    }
    .store-support-fab__label {
        display: none;
    }
}


/* ═══════════════════════════════════════════════════════════════
   Floating Support Chat FAB
   ═══════════════════════════════════════════════════════════════ */
.store-support-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 50px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow:
        0 8px 24px rgba(99, 102, 241, 0.35),
        0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease;
}

.store-support-fab:hover {
    transform: translateY(-3px) scale(1.04);
    box-shadow:
        0 12px 32px rgba(99, 102, 241, 0.45),
        0 4px 12px rgba(0, 0, 0, 0.2);
}

.store-support-fab:active {
    transform: translateY(-1px) scale(0.98);
}

.store-support-fab__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.store-support-fab__label {
    letter-spacing: 0.02em;
}

.store-support-fab__pulse {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #22c55e;
    border: 2.5px solid #6366f1;
    animation: sc-pulse 2s ease-in-out infinite;
}
