/* ============================================
   COLD EMAIL FLOATING PILL
   ============================================
   A sleek, minimal floating indicator for cold
   email VIP clients. Shows timer, spots, and
   logins in a compact, unobtrusive pill.
   ============================================ */

/* ==================== PILL CONTAINER ==================== */
.ce-pill {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 6px;
    background: rgba(15, 15, 18, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 50px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.03) inset;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.ce-pill.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Subtle top highlight */
.ce-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg,
        transparent,
        rgba(201, 169, 98, 0.3),
        transparent
    );
    border-radius: 50%;
}

/* ==================== PILL ITEMS ==================== */
.ce-pill__item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border-radius: 40px;
    transition: all 0.25s ease;
    cursor: default;
    position: relative;
}

.ce-pill__item:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Divider between items */
.ce-pill__divider {
    width: 1px;
    height: 20px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

/* ==================== ITEM ICON ==================== */
.ce-pill__icon {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.ce-pill__icon svg {
    width: 14px;
    height: 14px;
    stroke-width: 2;
    fill: none;
    transition: all 0.3s ease;
}

/* Timer icon */
.ce-pill__icon--timer {
    background: rgba(239, 68, 68, 0.12);
}

.ce-pill__icon--timer svg {
    stroke: #f87171;
}

/* Spots icon */
.ce-pill__icon--spots {
    background: rgba(245, 158, 11, 0.12);
}

.ce-pill__icon--spots svg {
    stroke: #fbbf24;
}

.ce-pill__icon--spots.spots-low {
    background: rgba(239, 68, 68, 0.12);
}

.ce-pill__icon--spots.spots-low svg {
    stroke: #f87171;
}

.ce-pill__icon--spots.spots-high {
    background: rgba(34, 197, 94, 0.12);
}

.ce-pill__icon--spots.spots-high svg {
    stroke: #4ade80;
}

/* Logins icon */
.ce-pill__icon--logins {
    background: rgba(139, 92, 246, 0.12);
}

.ce-pill__icon--logins svg {
    stroke: #a78bfa;
}

.ce-pill__icon--logins.logins-low {
    background: rgba(239, 68, 68, 0.12);
}

.ce-pill__icon--logins.logins-low svg {
    stroke: #f87171;
}

/* ==================== ITEM VALUE ==================== */
.ce-pill__value {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
    transition: color 0.3s ease;
}

.ce-pill__value--timer {
    color: #f87171;
}

.ce-pill__value--spots {
    color: #fbbf24;
}

.ce-pill__value--spots.spots-low {
    color: #f87171;
}

.ce-pill__value--spots.spots-high {
    color: #4ade80;
}

.ce-pill__value--logins {
    color: #a78bfa;
}

.ce-pill__value--logins.logins-low {
    color: #f87171;
}

/* ==================== TOOLTIP ON HOVER ==================== */
.ce-pill__item::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    padding: 6px 10px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    z-index: 10;
}

.ce-pill__item:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ==================== MINI PROGRESS BAR ==================== */
.ce-pill__progress {
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1px;
    overflow: hidden;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.ce-pill__item:hover .ce-pill__progress {
    opacity: 1;
}

.ce-pill__progress-fill {
    height: 100%;
    border-radius: 1px;
    transition: width 0.5s ease;
}

.ce-pill__progress-fill--spots {
    background: #fbbf24;
}

.ce-pill__progress-fill--spots.spots-low {
    background: #f87171;
}

.ce-pill__progress-fill--spots.spots-high {
    background: #4ade80;
}

/* ==================== URGENCY ANIMATION ==================== */
@keyframes urgentPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.ce-pill__value--timer.urgent {
    animation: urgentPulse 1.5s ease-in-out infinite;
}

.ce-pill__icon--timer.urgent {
    animation: urgentPulse 1.5s ease-in-out infinite;
}

/* ==================== EXPIRED STATE ==================== */
.ce-pill.expired {
    border-color: rgba(239, 68, 68, 0.3);
}

.ce-pill.expired::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(239, 68, 68, 0.4),
        transparent
    );
}

/* ==================== LIGHT MODE ==================== */
[data-theme="light"] .ce-pill {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow:
        0 4px 24px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(0, 0, 0, 0.02) inset;
}

[data-theme="light"] .ce-pill::before {
    background: linear-gradient(90deg,
        transparent,
        rgba(180, 150, 80, 0.4),
        transparent
    );
}

[data-theme="light"] .ce-pill__item:hover {
    background: rgba(0, 0, 0, 0.03);
}

[data-theme="light"] .ce-pill__divider {
    background: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .ce-pill__icon--timer {
    background: rgba(239, 68, 68, 0.08);
}

[data-theme="light"] .ce-pill__icon--spots {
    background: rgba(245, 158, 11, 0.08);
}

[data-theme="light"] .ce-pill__icon--logins {
    background: rgba(139, 92, 246, 0.08);
}

[data-theme="light"] .ce-pill__item::after {
    background: rgba(20, 20, 20, 0.95);
}

[data-theme="light"] .ce-pill__progress {
    background: rgba(0, 0, 0, 0.08);
}

/* ==================== MOBILE RESPONSIVE ==================== */
@media (max-width: 600px) {
    .ce-pill {
        bottom: 16px;
        right: 16px;
        left: 16px;
        justify-content: center;
        border-radius: 16px;
        padding: 8px 12px;
        gap: 4px;
    }

    .ce-pill__item {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
        border-radius: 12px;
    }

    .ce-pill__icon {
        width: 24px;
        height: 24px;
    }

    .ce-pill__icon svg {
        width: 12px;
        height: 12px;
    }

    .ce-pill__value {
        font-size: 12px;
    }

    .ce-pill__divider {
        height: 24px;
    }

    /* Hide tooltips on mobile */
    .ce-pill__item::after {
        display: none;
    }
}

/* ==================== HIDE DURING CINEMATIC ==================== */
body.cinematic-playing .ce-pill {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    pointer-events: none !important;
}

/* ==================== REDUCED MOTION ==================== */
@media (prefers-reduced-motion: reduce) {
    .ce-pill,
    .ce-pill__item,
    .ce-pill__icon,
    .ce-pill__value {
        transition: opacity 0.2s ease !important;
        animation: none !important;
    }
}
