/**
 * Deals2Buy — Phase 1 CSS Stylesheet
 * Contains styles for:
 * 1. "Who Joined" Social Proof Avatar Strip
 * 2. Buyer Protection Badge & Overlay Modal
 * 3. Milestone Price Meter
 * 4. General frontend adjustments (enhanced timers, share icons)
 */

:root {
    --d2b-success: #10b981;
    --d2b-warning: #f59e0b;
    --d2b-danger: #ef4444;
    --d2b-info: #3b82f6;
    --d2b-gray-50: #f9fafb;
    --d2b-gray-100: #f3f4f6;
    --d2b-gray-200: #e5e7eb;
    --d2b-gray-300: #d1d5db;
    --d2b-gray-500: #6b7280;
    --d2b-gray-700: #374151;
    --d2b-gray-900: #111827;
    --d2b-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --d2b-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --d2b-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --d2b-radius-sm: 6px;
    --d2b-radius-md: 12px;
    --d2b-radius-lg: 16px;
    --d2b-font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   1. Social Proof — "Who Joined" Widget
   ========================================================================== */
.d2b-social-proof {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    padding: 10px 14px;
    background: var(--d2b-gray-50);
    border: 1px solid var(--d2b-gray-200);
    border-radius: var(--d2b-radius-md);
    box-shadow: var(--d2b-shadow-sm);
    font-family: var(--d2b-font-sans);
}

.d2b-sp-avatars {
    display: flex;
    align-items: center;
    position: relative;
}

.d2b-sp-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: var(--d2b-shadow-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: var(--d2b-gray-700);
    background-color: var(--d2b-gray-200);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.d2b-sp-avatars .d2b-sp-avatar:not(:first-child) {
    margin-left: -12px;
}

.d2b-sp-avatar:hover {
    transform: translateY(-4px) scale(1.1);
    z-index: 10;
}

/* Skeleton loader for avatars */
.d2b-sp-skeleton {
    background: linear-gradient(90deg, var(--d2b-gray-200) 25%, var(--d2b-gray-100) 50%, var(--d2b-gray-200) 75%);
    background-size: 200% 100%;
    animation: d2b-shimmer 1.5s infinite;
}

@keyframes d2b-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.d2b-sp-more {
    background-color: var(--d2b-primary);
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    z-index: 2;
}

.d2b-sp-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.d2b-sp-count {
    font-size: 14px;
    color: var(--d2b-gray-900);
    font-weight: 600;
}

.d2b-sp-target {
    font-size: 12px;
    color: var(--d2b-success);
    font-weight: 600;
}

/* ==========================================================================
   2. Buyer Protection Badge & Modal
   ========================================================================== */
.d2b-protection-badge {
    margin: 16px 0;
    font-family: var(--d2b-font-sans);
}

.d2b-protection-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid var(--d2b-gray-200);
    border-radius: var(--d2b-radius-md);
    padding: 10px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--d2b-gray-700);
    box-shadow: var(--d2b-shadow-sm);
    transition: all 0.2s ease;
    width: 100%;
    justify-content: space-between;
}

.d2b-protection-trigger:hover,
.d2b-protection-trigger:focus {
    border-color: var(--d2b-primary);
    background-color: var(--d2b-gray-50);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 143, 98, 0.15);
}

.d2b-shield-icon {
    font-size: 16px;
}

.d2b-bp-arrow {
    font-size: 18px;
    color: var(--d2b-gray-500);
    line-height: 1;
}

/* Modal Overlay & Box */
.d2b-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
    box-sizing: border-box;
}

.d2b-modal-overlay:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

.d2b-modal-box {
    background: #ffffff;
    border-radius: var(--d2b-radius-lg);
    box-shadow: var(--d2b-shadow-lg);
    max-width: 480px;
    width: 100%;
    padding: 30px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    font-family: var(--d2b-font-sans);
}

.d2b-modal-overlay:not([hidden]) .d2b-modal-box {
    transform: translateY(0);
}

.d2b-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--d2b-gray-500);
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.d2b-modal-close:hover {
    background-color: var(--d2b-gray-100);
    color: var(--d2b-gray-900);
}

.d2b-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.d2b-modal-icon {
    font-size: 44px;
    display: inline-block;
    margin-bottom: 12px;
    animation: d2b-float 3s ease-in-out infinite;
}

@keyframes d2b-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.d2b-modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: var(--d2b-gray-900);
    margin: 0 0 6px 0 !important;
}

.d2b-modal-header p {
    font-size: 14px;
    color: var(--d2b-gray-500);
    margin: 0;
}

.d2b-protection-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.d2b-pl-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.d2b-pl-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1.2;
}

.d2b-pl-item div strong {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--d2b-gray-900);
    margin-bottom: 4px;
}

.d2b-pl-item div p {
    font-size: 13px;
    color: var(--d2b-gray-500);
    margin: 0;
    line-height: 1.45;
}

.d2b-modal-footer {
    display: flex;
    justify-content: center;
}

.d2b-modal-close-btn {
    width: 100%;
    padding: 12px;
    background-color: var(--d2b-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--d2b-radius-md);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.d2b-modal-close-btn:hover {
    filter: brightness(0.9);
}

/* ==========================================================================
   3. Milestone Price Meter
   ========================================================================== */
.d2b-milestone-meter {
    margin: 20px 0;
    padding: 18px;
    background: #ffffff;
    border: 1px solid var(--d2b-gray-200);
    border-radius: var(--d2b-radius-lg);
    box-shadow: var(--d2b-shadow-sm);
    font-family: var(--d2b-font-sans);
}

.d2b-mm-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}

.d2b-mm-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--d2b-gray-700);
    margin: 0 !important;
}

.d2b-mm-hint {
    font-size: 12px;
    font-weight: 600;
    color: var(--d2b-primary);
    background-color: rgba(15, 143, 98, 0.1);
    padding: 4px 8px;
    border-radius: 20px;
}

.d2b-mm-track-container {
    position: relative;
    height: 12px;
    background: var(--d2b-gray-100);
    border-radius: 6px;
    margin: 24px 0;
}

.d2b-mm-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--d2b-primary) 0%, #10b981 100%);
    border-radius: 6px;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
}

.d2b-mm-dots {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.d2b-mm-dot {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: 3px solid var(--d2b-gray-300);
    box-shadow: var(--d2b-shadow-sm);
    transition: all 0.3s ease;
    z-index: 2;
}

.d2b-mm-dot.is-active {
    border-color: var(--d2b-success);
    background: var(--d2b-success);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.d2b-mm-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
}

.d2b-mm-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 11px;
    color: var(--d2b-gray-500);
}

.d2b-mm-label.is-active {
    color: var(--d2b-gray-900);
    font-weight: 600;
}

.d2b-mm-label span:first-child {
    font-weight: 600;
}

/* ==========================================================================
   4. Sharing Tooltip & Copied State
   ========================================================================== */
.d2b-share-btn-copy {
    position: relative;
    cursor: pointer;
}

.d2b-share-btn-copy::after {
    content: "Link copied!";
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    background: var(--d2b-gray-900);
    color: #ffffff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: var(--d2b-radius-sm);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.d2b-share-btn-copy.is-copied::after {
    opacity: 1;
    transform: translateX(-50%) translateY(-10px);
}
