/* ==========================================================================
   Smart Duplicate Order Blocker Pro — Frontend Popup Styles v3.6.1
   Custom modal — zero SweetAlert2 dependency for close logic.
   All rules scoped to .sdob-* to avoid theme leaks.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Overlay / backdrop
   -------------------------------------------------------------------------- */
.sdob-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(10, 15, 30, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: sdob-fade-in 0.22s ease both;
}

.sdob-overlay.sdob-overlay-out {
    animation: sdob-fade-out 0.26s ease both;
}

@keyframes sdob-fade-in  { from { opacity: 0; } to { opacity: 1; } }
@keyframes sdob-fade-out { from { opacity: 1; } to { opacity: 0; } }

/* --------------------------------------------------------------------------
   2. Modal card
   -------------------------------------------------------------------------- */
.sdob-modal {
    position: relative;
    background: #fff;
    border-radius: 20px;
    width: 100%;
    max-width: 400px;
    overflow: hidden;
    box-shadow: 0 32px 64px rgba(0,0,0,0.22), 0 8px 24px rgba(0,0,0,0.14);
    animation: sdob-modal-in 0.32s cubic-bezier(0.22,1,0.36,1) both;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sdob-overlay.sdob-overlay-out .sdob-modal {
    animation: sdob-modal-out 0.24s ease both;
}

@keyframes sdob-modal-in  { from { opacity:0; transform:scale(0.88) translateY(20px); } to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes sdob-modal-out { from { opacity:1; transform:scale(1);   } to { opacity:0; transform:scale(0.92); } }

/* --------------------------------------------------------------------------
   3. Top accent stripe
   -------------------------------------------------------------------------- */
.sdob-modal-stripe {
    height: 5px;
    width: 100%;
    /* background set inline by JS per error type */
}

/* --------------------------------------------------------------------------
   4. Icon
   -------------------------------------------------------------------------- */
.sdob-modal-icon {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 28px auto 0;
    /* color & background set inline by JS */
}

.sdob-modal-icon svg {
    width: 34px;
    height: 34px;
    stroke-width: 2;
}

/* --------------------------------------------------------------------------
   5. Title
   -------------------------------------------------------------------------- */
.sdob-modal-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #111827;
    text-align: center;
    margin: 14px 28px 0;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   6. Body (message + countdown + action buttons)
   -------------------------------------------------------------------------- */
.sdob-modal-body {
    padding: 10px 28px 0;
    text-align: center;
}

.sdob-block-message {
    color: #374151;
    font-size: 0.93rem;
    line-height: 1.6;
    margin: 0 0 4px;
}

/* --------------------------------------------------------------------------
   7. Footer — OK button
   -------------------------------------------------------------------------- */
.sdob-modal-footer {
    padding: 20px 28px 26px;
    display: flex;
    justify-content: center;
}

.sdob-btn-ok {
    display: inline-block;
    padding: 11px 40px;
    border: none;
    border-radius: 10px;
    /* color set inline by JS — supports admin-configurable text colour */
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    min-width: 110px;
    /* background set inline by JS */
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    overflow: hidden;
    outline: none;
}

.sdob-btn-ok::after {
    content: '';
    position: absolute;
    top: 0; left: -70%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.22), transparent);
    transform: skewX(-20deg);
    transition: left 0.35s ease;
}

.sdob-btn-ok:hover::after { left: 130%; }
.sdob-btn-ok:hover  { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,0.22); }
.sdob-btn-ok:active { filter: brightness(0.95); transform: translateY(0); }
.sdob-btn-ok:focus  { box-shadow: 0 0 0 3px rgba(0,0,0,0.2); }

/* --------------------------------------------------------------------------
   8. Divider
   -------------------------------------------------------------------------- */
.sdob-popup-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, #e5e7eb 20%, #e5e7eb 80%, transparent);
    margin: 18px 0 0;
}

/* --------------------------------------------------------------------------
   9. Action buttons (WhatsApp / Call)
   -------------------------------------------------------------------------- */
.sdob-action-buttons-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 14px 0 0;
}

.sdob-action-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 11px 18px !important;
    color: #fff !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    flex: 1 1 0;
    min-width: 120px;
    transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18) !important;
    position: relative;
    overflow: hidden;
}

.sdob-action-btn::after {
    content: '';
    position: absolute;
    top: 0; left: -70%;
    width: 50%; height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.24), transparent);
    transform: skewX(-20deg);
    transition: left 0.38s ease;
}

.sdob-action-btn:hover::after { left: 130%; }
.sdob-action-btn:hover  { filter: brightness(1.08) !important; transform: translateY(-2px) !important; box-shadow: 0 6px 18px rgba(0,0,0,0.22) !important; }
.sdob-action-btn:active { transform: translateY(0) !important; }

.sdob-action-btn svg {
    width: 18px; height: 18px;
    flex-shrink: 0;
    fill: currentColor;
    stroke: none;
}

/* ==========================================================================
   10. Per-type stripe fallbacks (in case inline style is stripped)
   ========================================================================== */
.sdob-type-duplicate        .sdob-modal-stripe { background: linear-gradient(90deg,#e53935,#ff5722); }
.sdob-type-blocklist        .sdob-modal-stripe { background: linear-gradient(90deg,#f59e0b,#ef4444); }
.sdob-type-phone_validation .sdob-modal-stripe { background: linear-gradient(90deg,#3b82f6,#6366f1); }

/* ==========================================================================
   11. Countdown Timer
   ========================================================================== */
.sdob-countdown-wrap {
    margin: 18px 0 4px;
    text-align: center;
}

.sdob-cd-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: #6b7280;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 10px;
}

.sdob-cd-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
}

.sdob-cd-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.sdob-cd-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 10px;
    background: #ecfdf5;
    border: 1.5px solid rgba(16,185,129,0.2);
    color: #10b981;
    font-size: 1.45rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
    transition: background 0.5s ease, color 0.5s ease, border-color 0.5s ease;
}

.sdob-cd-unit small {
    font-size: 0.6rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #9ca3af;
    line-height: 1;
}

.sdob-cd-sep {
    font-size: 1.4rem;
    font-weight: 800;
    color: #10b981;
    line-height: 1;
    margin-top: 14px;
    transition: color 0.5s ease;
    flex-shrink: 0;
}

.sdob-cd-expired {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.84rem;
    color: #059669;
    font-weight: 600;
    padding: 10px 16px;
    background: #ecfdf5;
    border-radius: 10px;
    margin: 14px 0 4px;
    border: 1px solid #a7f3d0;
}

.sdob-cd-expired svg { stroke: #059669; flex-shrink: 0; }

/* ==========================================================================
   12. Responsive
   ========================================================================== */
@media (max-width: 480px) {
    .sdob-modal-title  { font-size: 1.05rem; margin: 12px 20px 0; }
    .sdob-modal-body   { padding: 8px 20px 0; }
    .sdob-modal-footer { padding: 16px 20px 22px; }
    .sdob-btn-ok       { width: 100%; }

    .sdob-action-buttons-container { flex-direction: column; }
    .sdob-action-btn { width: 100% !important; flex: none !important; }

    .sdob-cd-card  { width: 46px; height: 46px; font-size: 1.2rem; border-radius: 8px; }
    .sdob-cd-sep   { font-size: 1.2rem; margin-top: 11px; }
}

/* ==========================================================================
   13. Dark mode
   ========================================================================== */
@media (prefers-color-scheme: dark) {
    .sdob-modal          { background: #1f2937; }
    .sdob-modal-title    { color: #f9fafb; }
    .sdob-block-message  { color: #d1d5db; }
    .sdob-popup-divider  { background: linear-gradient(90deg, transparent, #374151 20%, #374151 80%, transparent); }

    .sdob-cd-label       { color: #9ca3af; }
    .sdob-cd-card        { background: #064e3b; border-color: rgba(52,211,153,0.25); color: #34d399; }
    .sdob-cd-unit small  { color: #6b7280; }
    .sdob-cd-sep         { color: #34d399; }
    .sdob-cd-expired     { background: #064e3b; border-color: #065f46; color: #6ee7b7; }
    .sdob-cd-expired svg { stroke: #6ee7b7; }
}
