/* ============================================================
   Pmedia Countdown Timer – Frontend Styles
   All selectors use classes/IDs for easy CSS overriding.
   ============================================================ */

/* ---------- Base wrapper ---------- */
.pmct-timer {
    display: inline-block;
    text-align: center;
    font-family: inherit;
    padding: 24px;
    box-sizing: border-box;
}

/* ---------- Title ---------- */
.pmct-timer-title {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0 0 18px;
    color: inherit;
}

/* ---------- Units container ---------- */
.pmct-units {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

/* ---------- Individual unit ---------- */
.pmct-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 70px;
    padding: 10px 14px;
    background: #1e293b;
    color: #ffffff;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
}

/* ---------- Number ---------- */
.pmct-number {
    display: block;
    font-size: 2.4em;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1px;
    position: relative;
}

/* ---------- Label ---------- */
.pmct-label {
    display: block;
    font-size: 0.65em;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-top: 6px;
    opacity: 0.75;
}

/* ---------- Separator ---------- */
.pmct-separator {
    font-size: 2em;
    font-weight: 700;
    color: #1e293b;
    line-height: 1;
    padding-bottom: 22px;
    opacity: 0.6;
    align-self: center;
}

/* ---------- Expired message ---------- */
.pmct-expired {
    font-size: 1.3em;
    font-weight: 700;
    color: #dc2626;
    padding: 20px;
}

/* ---------- Error ---------- */
.pmct-error { color: #dc2626; font-style: italic; }


/* ============================================================
   ANIMATION STYLES
   ============================================================ */

/* ---- Flip ---- */
.pmct-anim-flip .pmct-number {
    transition: none;
    transform-style: preserve-3d;
    perspective: 300px;
}
.pmct-anim-flip .pmct-unit { perspective: 300px; }
.pmct-anim-flip .pmct-number.pmct-animating {
    animation: pmct-flip 0.45s ease forwards;
}
@keyframes pmct-flip {
    0%   { transform: rotateX(0deg); opacity: 1; }
    49%  { transform: rotateX(90deg); opacity: 0; }
    50%  { transform: rotateX(-90deg); opacity: 0; }
    100% { transform: rotateX(0deg); opacity: 1; }
}

/* ---- Fade ---- */
.pmct-anim-fade .pmct-number.pmct-animating {
    animation: pmct-fade 0.4s ease;
}
@keyframes pmct-fade {
    0%   { opacity: 1; }
    45%  { opacity: 0; }
    55%  { opacity: 0; }
    100% { opacity: 1; }
}

/* ---- Slide Up ---- */
.pmct-anim-slide .pmct-unit { overflow: hidden; }
.pmct-anim-slide .pmct-number.pmct-animating {
    animation: pmct-slide 0.4s ease;
}
@keyframes pmct-slide {
    0%   { transform: translateY(0);    opacity: 1; }
    49%  { transform: translateY(-100%); opacity: 0; }
    50%  { transform: translateY(100%);  opacity: 0; }
    100% { transform: translateY(0);    opacity: 1; }
}

/* ---- Bounce ---- */
.pmct-anim-bounce .pmct-number.pmct-animating {
    animation: pmct-bounce 0.5s cubic-bezier(.36,.07,.19,.97);
}
@keyframes pmct-bounce {
    0%   { transform: scale(1); }
    20%  { transform: scale(1.35); }
    40%  { transform: scale(0.85); }
    60%  { transform: scale(1.15); }
    80%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

/* ---- Zoom ---- */
.pmct-anim-zoom .pmct-number.pmct-animating {
    animation: pmct-zoom 0.4s ease;
}
@keyframes pmct-zoom {
    0%   { transform: scale(1);   opacity: 1; }
    45%  { transform: scale(1.6); opacity: 0; }
    55%  { transform: scale(0.4); opacity: 0; }
    100% { transform: scale(1);   opacity: 1; }
}

/* ---- Pulse ---- */
.pmct-anim-pulse .pmct-unit {
    animation: pmct-pulse-bg 0s; /* placeholder until triggered */
}
.pmct-anim-pulse .pmct-number.pmct-animating {
    animation: pmct-pulse 0.5s ease;
}
@keyframes pmct-pulse {
    0%   { transform: scale(1); }
    25%  { transform: scale(1.2); }
    50%  { transform: scale(0.9); }
    75%  { transform: scale(1.1); }
    100% { transform: scale(1); }
}


/* ============================================================
   RESPONSIVE & CENTERING
   ============================================================ */

/* Centre by default — override with your own CSS if needed */
.pmct-timer {
    display: block;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
}

.pmct-units {
    justify-content: center;
}

/* ---- Fluid number sizing using clamp() ---- */
.pmct-number {
    font-size: clamp(1.6rem, 5vw, 3rem);
}

.pmct-unit {
    min-width: clamp(54px, 12vw, 80px);
    padding: clamp(8px, 2vw, 14px) clamp(10px, 2.5vw, 18px);
    border-radius: clamp(5px, 1vw, 8px);
}

.pmct-label {
    font-size: clamp(0.55rem, 1.5vw, 0.7rem);
}

.pmct-separator {
    font-size: clamp(1.2rem, 3.5vw, 2rem);
    padding-bottom: clamp(14px, 3vw, 26px);
}

.pmct-timer-title {
    font-size: clamp(1rem, 3vw, 1.4em);
    margin-bottom: clamp(10px, 2vw, 18px);
}

/* ---- Small phones (< 380px) ---- */
@media (max-width: 380px) {
    .pmct-units {
        gap: 4px;
    }
    .pmct-separator {
        display: none; /* hide colons on very tight screens */
    }
}

/* ---- Tablets (481px – 768px) ---- */
@media (min-width: 481px) and (max-width: 768px) {
    .pmct-unit {
        min-width: 68px;
    }
}

/* ---- Desktop (769px+) — restore full sizing ---- */
@media (min-width: 769px) {
    .pmct-number {
        font-size: 2.4rem;
    }
    .pmct-unit {
        min-width: 80px;
        padding: 12px 18px;
    }
    .pmct-label {
        font-size: 0.65rem;
    }
    .pmct-separator {
        font-size: 2rem;
        padding-bottom: 24px;
    }
}
