/**
 * DoorGo Companion Frontend Stylesheet
 */

.door-floating-widget {
    position: fixed;
    bottom: 25px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.door-floating-widget.pos-right {
    right: 25px;
}

.door-floating-widget.pos-left {
    left: 25px;
}

/* Floating Action Button */
.door-float-btn {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    outline: none;
    text-decoration: none;
}

.door-float-btn:hover {
    transform: scale(1.08);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
    color: #fff;
}

.door-float-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #fff;
}

.door-float-icon-close {
    display: none;
    font-size: 32px;
    line-height: 1;
}

.door-floating-widget.is-open .door-float-icon-open {
    display: none;
}

.door-floating-widget.is-open .door-float-icon-close {
    display: block;
}

/* Radar Pulse */
.door-float-pulse {
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: door-pulse 2s infinite cubic-bezier(0.24, 0, 0.38, 1);
    pointer-events: none;
    opacity: 0.6;
}

@keyframes door-pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* Tooltip on Single Channel */
.door-float-tooltip {
    position: absolute;
    right: 75px;
    background: #0f172a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    pointer-events: none;
}

.door-floating-widget.pos-left .door-float-tooltip {
    right: auto;
    left: 75px;
    transform: translateX(-10px);
}

.door-float-single:hover .door-float-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Speed-dial Popover Menu */
.door-float-popover {
    position: absolute;
    bottom: 75px;
    right: 0;
    width: 330px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 16px 40px -10px rgba(15, 23, 42, 0.25);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid #f1f5f9;
}

.door-floating-widget.pos-left .door-float-popover {
    right: auto;
    left: 0;
}

.door-floating-widget.is-open .door-float-popover {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.door-float-popover-header {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.door-agent-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.door-agent-avatar {
    font-size: 26px;
    background: rgba(255,255,255,0.15);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.door-agent-info strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
}

.door-agent-status {
    font-size: 12px;
    color: #34d399;
}

.door-float-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
}

.door-float-close:hover {
    color: #fff;
}

.door-float-popover-body {
    padding: 18px 20px;
}

.door-float-greeting {
    font-size: 13.5px;
    color: #475569;
    margin-bottom: 14px;
    line-height: 1.5;
}

.door-channel-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.door-channel-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px;
    background: #f8fafc;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e2e8f0;
}

.door-channel-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(4px);
}

.door-ch-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #fff;
}

.door-ch-info {
    flex: 1;
}

.door-ch-label {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
}

.door-ch-sub {
    font-size: 12px;
    color: #64748b;
}

.door-ch-arrow {
    color: #94a3b8;
    font-size: 16px;
    transition: transform 0.2s ease;
}

.door-channel-item:hover .door-ch-arrow {
    transform: translateX(3px);
    color: #0f172a;
}

/* WhatsApp Direct Checkout Button */
.door-wa-checkout-wrap {
    margin: 12px 0;
}

.door-btn-wa-checkout {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25D366 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    padding: 12px 24px !important;
    border-radius: 8px !important;
    border: none !important;
    box-shadow: 0 4px 14px rgba(37, 211, 102, 0.35) !important;
    transition: all 0.25s ease !important;
    width: 100%;
    text-align: center;
    cursor: pointer;
    text-decoration: none !important;
    font-size: 14.5px !important;
}

.door-btn-wa-checkout:hover {
    background: #1eb956 !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.45) !important;
    color: #ffffff !important;
}

/* ==========================================================================
   Back-to-Top Button Alignment with Floating Widget
   ========================================================================== */

/* Widget on the RIGHT (default) → move back-to-top button to the LEFT */
body.door-widget-pos-right #dt-back-to-top {
    right: auto;
    left: 30px;
}

/* Widget on the LEFT → keep back-to-top button on the RIGHT (default position) */
body.door-widget-pos-left #dt-back-to-top {
    left: auto;
    right: 30px;
}

/* Mobile overrides */
@media (max-width: 768px) {
    .door-floating-widget {
        bottom: calc(85px + env(safe-area-inset-bottom, 0px)) !important;
        right: 18px !important;
    }
    .door-floating-widget.pos-left {
        left: 18px !important;
        right: auto !important;
    }

    /* Widget on the RIGHT (default) → back-to-top on LEFT on mobile */
    body.door-widget-pos-right #dt-back-to-top {
        right: auto !important;
        left: 18px !important;
    }

    /* Widget on the LEFT → back-to-top on RIGHT on mobile */
    body.door-widget-pos-left #dt-back-to-top {
        left: auto !important;
        right: 18px !important;
    }
}

/* ==========================================================================
   Direct Order Buttons (Single & Archive)
   ========================================================================== */
.door-do-buttons-wrap {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
    align-items: stretch;
}

/* Susunan tombol (port dari Door Direct Order & Catalog) */
.door-do-layout-flex-row { flex-direction: row; }
.door-do-layout-flex-col { flex-direction: column; }
.door-do-layout-flex-col .door-do-btn { width: 100%; }
@media (max-width: 480px) {
    .door-do-layout-flex-row { flex-wrap: wrap; }
    .door-do-layout-flex-row .door-do-btn { flex: 1 1 100%; }
}

.door-do-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    border-radius: 8px;
    text-decoration: none !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
    cursor: pointer;
    border: none;
    box-sizing: border-box;
    flex: 1 1 auto;
    text-align: center;
}

.door-do-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 211, 102, 0.4);
    filter: brightness(1.05);
}

.door-do-btn:active {
    transform: translateY(0);
}

.door-do-btn-icon {
    flex-shrink: 0;
    display: inline-block;
}

.door-do-btn img.emoji {
    display: none !important;
}

.door-do-btn-wa {
    background-color: #25D366;
    color: #ffffff !important;
}

.door-do-btn-wa:hover {
    background-color: #20BA5A;
}

.door-do-btn-mail {
    background-color: #0f172a;
    color: #ffffff !important;
}

.door-do-btn-mail:hover {
    background-color: #1e293b;
}

.door-do-context-single-inside-form {
    margin: 14px 0 0 0;
}

.door-do-context-archive {
    margin: 10px 0 0 0;
    gap: 6px;
}

.door-do-context-archive .door-do-btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 6px;
}
