/* Claude Steen TikTok Countdown — Frontend Styles */
@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@400;500;600&display=swap');

/* =============================================
   BASE WRAPPER
   ============================================= */
.cstc-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--cstc-border-radius, 24px);
    border: var(--cstc-border, none);
    box-shadow: var(--cstc-box-shadow, none);
    font-family: var(--cstc-font-body, 'Inter', sans-serif);
}

.cstc-inner {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--cstc-container-width, 900px);
    padding: var(--cstc-container-pad, 60px) var(--cstc-container-pad, 60px);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
}

/* =============================================
   BACKGROUND VIDEO
   ============================================= */
.cstc-bg-video {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    min-width: 100%; min-height: 100%;
    width: auto; height: auto;
    z-index: 0;
    opacity: 0.3;
    pointer-events: none;
}

/* =============================================
   PARTICLES
   ============================================= */
.cstc-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.cstc-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--cstc-primary, #FE2C55);
    opacity: 0;
    animation: cstcParticleFloat linear infinite;
}

.cstc-particle:nth-child(odd) { background: var(--cstc-secondary, #25F4EE); }
.cstc-particle:nth-child(3n) { width: 2px; height: 2px; }
.cstc-particle:nth-child(4n) { width: 6px; height: 6px; border-radius: 2px; }

/* Generate varied particle positions/timings */
.cstc-particle:nth-child(1)  { left:5%;  animation-duration:8s;  animation-delay:0s; }
.cstc-particle:nth-child(2)  { left:10%; animation-duration:12s; animation-delay:1s; }
.cstc-particle:nth-child(3)  { left:17%; animation-duration:9s;  animation-delay:2s; }
.cstc-particle:nth-child(4)  { left:25%; animation-duration:14s; animation-delay:0.5s; }
.cstc-particle:nth-child(5)  { left:32%; animation-duration:10s; animation-delay:3s; }
.cstc-particle:nth-child(6)  { left:40%; animation-duration:11s; animation-delay:1.5s; }
.cstc-particle:nth-child(7)  { left:48%; animation-duration:7s;  animation-delay:4s; }
.cstc-particle:nth-child(8)  { left:55%; animation-duration:13s; animation-delay:2.5s; }
.cstc-particle:nth-child(9)  { left:63%; animation-duration:9s;  animation-delay:0.8s; }
.cstc-particle:nth-child(10) { left:70%; animation-duration:15s; animation-delay:3.5s; }
.cstc-particle:nth-child(11) { left:78%; animation-duration:8s;  animation-delay:1.2s; }
.cstc-particle:nth-child(12) { left:85%; animation-duration:11s; animation-delay:2.8s; }
.cstc-particle:nth-child(13) { left:92%; animation-duration:10s; animation-delay:0.3s; }
.cstc-particle:nth-child(14) { left:3%;  animation-duration:16s; animation-delay:4.5s; }
.cstc-particle:nth-child(15) { left:22%; animation-duration:12s; animation-delay:1.7s; }
.cstc-particle:nth-child(16) { left:38%; animation-duration:9s;  animation-delay:3.2s; }
.cstc-particle:nth-child(17) { left:52%; animation-duration:14s; animation-delay:0.6s; }
.cstc-particle:nth-child(18) { left:67%; animation-duration:8s;  animation-delay:2.1s; }
.cstc-particle:nth-child(19) { left:80%; animation-duration:11s; animation-delay:4.8s; }
.cstc-particle:nth-child(20) { left:95%; animation-duration:13s; animation-delay:1.4s; }
.cstc-particle:nth-child(21) { left:14%; animation-duration:10s; animation-delay:5s; }
.cstc-particle:nth-child(22) { left:29%; animation-duration:12s; animation-delay:2.3s; }
.cstc-particle:nth-child(23) { left:44%; animation-duration:7s;  animation-delay:3.7s; }
.cstc-particle:nth-child(24) { left:58%; animation-duration:15s; animation-delay:0.9s; }
.cstc-particle:nth-child(25) { left:74%; animation-duration:9s;  animation-delay:1.9s; }

@keyframes cstcParticleFloat {
    0%   { transform: translateY(110%) rotate(0deg); opacity: 0; }
    10%  { opacity: 0.8; }
    90%  { opacity: 0.4; }
    100% { transform: translateY(-20px) rotate(720deg); opacity: 0; }
}

/* =============================================
   LIVE BADGE
   ============================================= */
.cstc-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 100px;
    padding: 6px 16px;
    margin-bottom: 20px;
    backdrop-filter: blur(10px);
}

.cstc-live-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cstc-secondary, #25F4EE);
    animation: cstcDotPulse 1.5s ease-in-out infinite;
}

.cstc-live-text {
    font-family: var(--cstc-font-body);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--cstc-secondary, #25F4EE);
    text-transform: uppercase;
}

@keyframes cstcDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(37,244,238,0.5); }
    50% { box-shadow: 0 0 0 6px rgba(37,244,238,0); }
}

/* =============================================
   TITLE & DESCRIPTION
   ============================================= */
.cstc-title {
    font-family: var(--cstc-font-digits, 'Bebas Neue', cursive);
    font-size: clamp(28px, 5vw, var(--cstc-title-size, 48px));
    color: var(--cstc-title-color, #ffffff);
    margin: 0 0 12px 0;
    line-height: 1.1;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cstc-description {
    font-family: var(--cstc-font-body);
    font-size: 16px;
    color: var(--cstc-desc-color, rgba(255,255,255,0.7));
    margin: 0 0 32px 0;
    max-width: 480px;
    line-height: 1.6;
}

/* =============================================
   PROGRESS BAR
   ============================================= */
.cstc-progress-bar {
    width: 100%;
    max-width: 480px;
    height: 3px;
    border-radius: 2px;
    background: var(--cstc-progress-bg, rgba(255,255,255,0.1));
    margin-bottom: 40px;
    overflow: hidden;
}

.cstc-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--cstc-primary, #FE2C55), var(--cstc-secondary, #25F4EE));
    border-radius: 2px;
    transition: width 1s linear;
    position: relative;
}

.cstc-progress-fill::after {
    content: '';
    position: absolute;
    right: 0; top: 50%;
    transform: translateY(-50%);
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--cstc-secondary, #25F4EE);
    box-shadow: 0 0 10px var(--cstc-secondary, #25F4EE);
}

/* =============================================
   COUNTDOWN UNITS
   ============================================= */
.cstc-countdown {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.cstc-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.cstc-flip-card {
    position: relative;
    perspective: 600px;
}

.cstc-flip-inner {
    position: relative;
    transform-style: preserve-3d;
}

.cstc-digit-display {
    background: var(--cstc-digit-bg, rgba(255,255,255,0.07));
    border-radius: var(--cstc-digit-radius, 16px);
    padding: var(--cstc-digit-padding, 20px) calc(var(--cstc-digit-padding, 20px) * 1.2);
    min-width: calc(var(--cstc-digit-font-size, 80px) * 1.4);
    text-align: center;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.06);
    box-sizing: border-box;
}

/* Middle line for flip effect */
.cstc-digit-display::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    top: 50%;
    height: 1px;
    background: rgba(0,0,0,0.3);
    z-index: 3;
}

/* Top and bottom halves with gradient */
.cstc-digit-display::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, transparent 50%, rgba(0,0,0,0.15) 100%);
    border-radius: inherit;
    pointer-events: none;
}

.cstc-digit-top,
.cstc-digit-bottom,
.cstc-digit-value {
    display: block;
    font-family: var(--cstc-font-digits, 'Bebas Neue', cursive);
    font-size: clamp(40px, 8vw, var(--cstc-digit-font-size, 80px));
    color: var(--cstc-digit-color, #ffffff);
    line-height: 1;
    letter-spacing: -1px;
    position: relative;
    z-index: 2;
}

.cstc-digit-value {
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Flip animation */
.cstc-flip-card.is-flipping .cstc-digit-display {
    animation: cstcFlip3d 0.4s ease-in-out;
}

@keyframes cstcFlip3d {
    0%   { transform: rotateX(0deg); }
    50%  { transform: rotateX(-90deg); }
    100% { transform: rotateX(0deg); }
}

.cstc-flip-card.is-sliding .cstc-digit-display {
    animation: cstcSlide 0.3s ease-out;
}

@keyframes cstcSlide {
    0%   { transform: translateY(-8px); opacity: 0.4; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Glow on digit update */
.cstc-flip-card.just-updated .cstc-digit-display {
    box-shadow: 0 0 20px rgba(254,44,85,0.3), inset 0 0 20px rgba(254,44,85,0.05);
    transition: box-shadow 0.3s ease;
}

/* Pulse on last 10 seconds */
.cstc-wrapper.cstc-urgent .cstc-digit-display {
    animation: cstcUrgentPulse 0.8s ease-in-out infinite;
    border-color: rgba(254,44,85,0.5) !important;
}

@keyframes cstcUrgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(254,44,85,0.3); }
    50% { box-shadow: 0 0 0 8px rgba(254,44,85,0); }
}

.cstc-label {
    font-family: var(--cstc-font-body);
    font-size: var(--cstc-label-size, 14px);
    font-weight: 600;
    color: var(--cstc-label-color, rgba(255,255,255,0.5));
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* =============================================
   SEPARATOR
   ============================================= */
.cstc-separator {
    font-family: var(--cstc-font-digits);
    font-size: clamp(30px, 5vw, 60px);
    color: var(--cstc-sep-color, #FE2C55);
    line-height: 1;
    margin-bottom: 28px; /* align with digits, offset for label */
    opacity: 1;
    animation: cstcSepBlink 1s step-end infinite;
}

@keyframes cstcSepBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.2; }
}

/* =============================================
   BUTTON
   ============================================= */
.cstc-cta {
    margin-bottom: 24px;
}

.cstc-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    font-family: var(--cstc-font-body);
    font-weight: 600;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
    cursor: pointer;
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
}

.cstc-button::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cstc-button:hover::before { opacity: 1; }

/* Sizes */
.cstc-button-small  { font-size: 13px; padding: 10px 20px; border-radius: 8px; }
.cstc-button-medium { font-size: 15px; padding: 14px 28px; border-radius: 10px; }
.cstc-button-large  { font-size: 17px; padding: 18px 40px; border-radius: 14px; }

/* Styles */
.cstc-button-filled {
    background: var(--cstc-btn-bg, #FE2C55);
    color: var(--cstc-btn-color, #ffffff);
    box-shadow: 0 4px 24px rgba(254,44,85,0.35);
}
.cstc-button-filled:hover {
    background: var(--cstc-btn-hover-bg, #25F4EE);
    color: var(--cstc-btn-hover-color, #000000);
    box-shadow: 0 8px 32px rgba(37,244,238,0.4);
    transform: translateY(-2px);
}

.cstc-button-outline {
    background: transparent;
    color: var(--cstc-btn-bg, #FE2C55);
    border: 2px solid var(--cstc-btn-bg, #FE2C55);
}
.cstc-button-outline:hover {
    background: var(--cstc-btn-bg, #FE2C55);
    color: var(--cstc-btn-color, #ffffff);
    transform: translateY(-2px);
}

.cstc-button-pill {
    background: var(--cstc-btn-bg, #FE2C55);
    color: var(--cstc-btn-color, #ffffff);
    border-radius: 100px !important;
    box-shadow: 0 4px 24px rgba(254,44,85,0.35);
}
.cstc-button-pill:hover {
    background: var(--cstc-btn-hover-bg, #25F4EE);
    color: var(--cstc-btn-hover-color, #000000);
    transform: translateY(-2px) scale(1.03);
}

.cstc-button-ghost {
    background: rgba(255,255,255,0.07);
    color: var(--cstc-btn-color, #ffffff);
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
}
.cstc-button-ghost:hover {
    background: rgba(255,255,255,0.12);
    border-color: var(--cstc-primary, #FE2C55);
    transform: translateY(-2px);
}

.cstc-tiktok-icon {
    width: 18px; height: 18px;
    flex-shrink: 0;
}

/* =============================================
   LIVE MESSAGE
   ============================================= */
.cstc-live-message {
    margin: 0 0 24px 0;
}

.cstc-live-now-badge {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: rgba(254,44,85,0.15);
    border: 1px solid rgba(254,44,85,0.5);
    border-radius: 100px;
    padding: 14px 28px;
    font-family: var(--cstc-font-body);
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    animation: cstcLiveGlow 1.5s ease-in-out infinite;
}

.cstc-live-now-dot {
    width: 12px; height: 12px;
    border-radius: 50%;
    background: #FE2C55;
    animation: cstcDotPulse 0.8s ease-in-out infinite;
}

@keyframes cstcLiveGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(254,44,85,0.3); }
    50% { box-shadow: 0 0 40px rgba(254,44,85,0.6); }
}

/* =============================================
   SOCIAL SHARE
   ============================================= */
.cstc-share {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.cstc-share-label {
    font-family: var(--cstc-font-body);
    font-size: 12px;
    color: var(--cstc-label-color, rgba(255,255,255,0.5));
    letter-spacing: 2px;
    text-transform: uppercase;
}

.cstc-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.1);
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.cstc-share-btn:hover {
    background: var(--cstc-primary, #FE2C55);
    border-color: var(--cstc-primary, #FE2C55);
    color: #ffffff;
    transform: translateY(-2px);
}

.cstc-share-btn svg {
    width: 15px; height: 15px;
}

/* =============================================
   ENTRANCE ANIMATIONS
   ============================================= */
.cstc-entrance-fade { animation: cstcFadeIn 0.8s ease-out forwards; }
.cstc-entrance-slide { animation: cstcSlideIn 0.7s cubic-bezier(0.25,0.46,0.45,0.94) forwards; }
.cstc-entrance-zoom { animation: cstcZoomIn 0.6s cubic-bezier(0.175,0.885,0.32,1.275) forwards; }

@keyframes cstcFadeIn {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes cstcSlideIn {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes cstcZoomIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

/* Staggered children */
.cstc-entrance-slide .cstc-live-badge,
.cstc-entrance-slide .cstc-title,
.cstc-entrance-slide .cstc-description,
.cstc-entrance-slide .cstc-countdown,
.cstc-entrance-slide .cstc-cta {
    animation: cstcSlideIn 0.6s ease-out both;
}
.cstc-entrance-slide .cstc-live-badge { animation-delay: 0.1s; }
.cstc-entrance-slide .cstc-title { animation-delay: 0.2s; }
.cstc-entrance-slide .cstc-description { animation-delay: 0.3s; }
.cstc-entrance-slide .cstc-progress-bar { animation-delay: 0.35s; }
.cstc-entrance-slide .cstc-countdown { animation-delay: 0.4s; }
.cstc-entrance-slide .cstc-cta { animation-delay: 0.55s; }
.cstc-entrance-slide .cstc-share { animation-delay: 0.65s; }

/* =============================================
   LAYOUT VARIANTS
   ============================================= */
.cstc-layout-minimal .cstc-digit-display {
    background: transparent;
    border: none;
    border-bottom: 2px solid var(--cstc-primary, #FE2C55);
    border-radius: 0;
    padding: 10px 20px;
}
.cstc-layout-minimal .cstc-digit-display::after,
.cstc-layout-minimal .cstc-digit-display::before { display: none; }

.cstc-layout-neon .cstc-digit-display {
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--cstc-primary, #FE2C55);
    box-shadow: 0 0 10px var(--cstc-primary, #FE2C55),
                inset 0 0 10px rgba(254,44,85,0.1);
}
.cstc-layout-neon .cstc-digit-top,
.cstc-layout-neon .cstc-digit-bottom {
    color: var(--cstc-primary, #FE2C55);
    text-shadow: 0 0 20px var(--cstc-primary, #FE2C55);
}
.cstc-layout-neon .cstc-title {
    text-shadow: 0 0 30px var(--cstc-secondary, #25F4EE);
    color: var(--cstc-secondary, #25F4EE);
}

.cstc-layout-card .cstc-inner {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 24px;
    backdrop-filter: blur(20px);
    padding: 48px;
}

.cstc-layout-fullscreen {
    min-height: 100vh;
}
.cstc-layout-fullscreen .cstc-inner {
    padding: 40px 20px;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 768px) {
    .cstc-inner { padding: 40px 20px; }
    .cstc-countdown { gap: 8px; }
    .cstc-digit-display { min-width: calc(var(--cstc-digit-font-size, 80px) * 1.1); }
    .cstc-separator { font-size: 28px; margin-bottom: 22px; }
    .cstc-title { font-size: clamp(24px, 8vw, 40px); }
}

@media (max-width: 480px) {
    .cstc-countdown { gap: 5px; }
    .cstc-separator { font-size: 20px; margin-bottom: 16px; }
    .cstc-share { flex-wrap: wrap; justify-content: center; }
    .cstc-button-large { font-size: 15px; padding: 14px 28px; }
}

/* =============================================
   TIKTOK CREATOR EMBED
   ============================================= */
.cstc-tiktok-embed-wrap {
    width: 100%;
    max-width: 780px;
    margin-top: 32px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
}

.cstc-tiktok-embed-wrap .tiktok-embed {
    margin: 0 !important;
    border-radius: 16px;
    width: 100% !important;
    max-width: 100% !important;
}

/* =============================================
   COPY TOOLTIP
   ============================================= */
.cstc-copy-tooltip {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(37,244,238,0.9);
    color: #000;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 9999;
    font-family: 'Inter', sans-serif;
}
.cstc-copy-tooltip.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
