/**
 * Universal Trial Badge - Compact Header Button
 * iOS 26 Liquid Glass Design
 *
 * Usage: Include this CSS and trial-bar.js, then add <div id="universalTrialBar"></div> to your header
 */

/* Trial Badge - Compact Pill Button */
.trial-badge-pill {
    display: none; /* Hidden by default, shown via JS when on trial */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 0.5rem 1rem;
    min-width: 130px;
    cursor: pointer;

    /* Glassmorphic Effect */
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.15) 0%,
        rgba(99, 102, 241, 0.12) 100%
    );
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);

    /* Borders & Shadow */
    border: 1px solid rgba(139, 92, 246, 0.25);
    border-radius: 12px;
    box-shadow:
        0 4px 12px -2px rgba(139, 92, 246, 0.2),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.15);

    /* Smooth transitions */
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Mode */
.dark .trial-badge-pill {
    background: linear-gradient(
        135deg,
        rgba(139, 92, 246, 0.18) 0%,
        rgba(99, 102, 241, 0.15) 100%
    );
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow:
        0 4px 12px -2px rgba(139, 92, 246, 0.3),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.08);
}

/* Hover Effect */
.trial-badge-pill:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px -4px rgba(139, 92, 246, 0.35),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(139, 92, 246, 0.4);
}

.dark .trial-badge-pill:hover {
    box-shadow:
        0 8px 20px -4px rgba(139, 92, 246, 0.45),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
}

/* Active/Click Effect */
.trial-badge-pill:active {
    transform: translateY(0);
}

/* Main Text - "Upgrade Now" */
.trial-badge-main {
    font-size: 0.875rem;
    font-weight: 700;
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.01em;
    margin-bottom: 0.0625rem;
    line-height: 1.2;
}

.dark .trial-badge-main {
    background: linear-gradient(135deg, #c4b5fd 0%, #a5b4fc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Subtext - "X days remaining" */
.trial-badge-days {
    font-size: 0.6875rem;
    font-weight: 500;
    color: #8b5cf6;
    opacity: 0.85;
    line-height: 1.2;
}

.dark .trial-badge-days {
    color: #c4b5fd;
    opacity: 0.9;
}

/* Pulse animation for urgency (when < 3 days) */
.trial-badge-pill.trial-urgent {
    animation: pulse-urgent 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse-urgent {
    0%, 100% {
        box-shadow:
            0 4px 12px -2px rgba(239, 68, 68, 0.3),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
        border-color: rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow:
            0 4px 16px -2px rgba(239, 68, 68, 0.45),
            inset 0 1px 0 0 rgba(255, 255, 255, 0.15);
        border-color: rgba(239, 68, 68, 0.5);
    }
}

/* Urgent colors */
.trial-badge-pill.trial-urgent .trial-badge-main {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.trial-badge-pill.trial-urgent .trial-badge-days {
    color: #ef4444;
}

.dark .trial-badge-pill.trial-urgent .trial-badge-main {
    background: linear-gradient(135deg, #fca5a5 0%, #f87171 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dark .trial-badge-pill.trial-urgent .trial-badge-days {
    color: #fca5a5;
}

/* Mobile Responsive */
@media (max-width: 640px) {
    .trial-badge-pill {
        padding: 0.4375rem 0.875rem;
        min-width: 115px;
    }

    .trial-badge-main {
        font-size: 0.8125rem;
    }

    .trial-badge-days {
        font-size: 0.625rem;
    }
}

/* Show animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.trial-badge-pill.trial-badge-show {
    display: flex;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
