/* ==========================================================================
   Visitor Counter Custom Styling - PSU Pattani Archive
   Location: webroot/css_custom/visitor_counter.css
   Compact & Sleek Design
   ========================================================================== */

.visitor-counter-wrapper {
    width: 100%;
    max-width: 380px;
    margin: 1.5rem auto 1rem auto;
    padding: 0 12px;
}

.visitor-counter-card {
    position: relative;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 14px;
    padding: 16px 20px 14px 20px;
    box-shadow: 0 8px 24px -4px rgba(0, 0, 0, 0.45), 
                0 0 18px rgba(56, 189, 248, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow: hidden;
}

/* Glowing top accent line */
.visitor-counter-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2.5px;
    background: linear-gradient(90deg, #0284c7 0%, #38bdf8 50%, #00d2b5 100%);
    background-size: 200% 100%;
    animation: counterGradientShift 6s ease infinite;
}

.visitor-counter-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55), 
                0 0 24px rgba(56, 189, 248, 0.2);
    transform: translateY(-2px);
    border-color: rgba(56, 189, 248, 0.45);
}

/* Header Section */
.visitor-counter-card .counter-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    width: 100%;
}

.visitor-counter-card .counter-icon-box {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: linear-gradient(135deg, #0284c7 0%, #00b4d8 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    box-shadow: 0 3px 10px rgba(2, 132, 199, 0.4);
    flex-shrink: 0;
}

.visitor-counter-card .counter-text-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.visitor-counter-card .counter-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.2px;
    margin: 0;
    line-height: 1.25;
}

.visitor-counter-card .counter-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
}

/* Pulse Live Indicator */
.visitor-counter-card .status-indicator {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 8px;
    height: 8px;
}

.visitor-counter-card .pulse-dot {
    width: 6px;
    height: 6px;
    background-color: #10b981;
    border-radius: 50%;
    z-index: 2;
}

.visitor-counter-card .pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(16, 185, 129, 0.4);
    animation: counterPulseRing 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
    z-index: 1;
}

.visitor-counter-card .status-text {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 400;
}

/* Digit Container Box */
.visitor-counter-card .counter-box {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    background: rgba(15, 23, 42, 0.65);
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.4);
    margin-bottom: 11px;
    max-width: 100%;
    overflow-x: auto;
}

/* Individual Digit (Split-Flap / Mechanical Odometer Style) */
.visitor-counter-card .digit {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 40px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: #ffffff;
    font-family: 'Roboto', 'Sarabun', monospace, sans-serif;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 
                0 3px 8px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    user-select: none;
    transition: transform 0.2s ease;
}

/* Split-Flap Center Crease Line */
.visitor-counter-card .digit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    pointer-events: none;
    z-index: 2;
}

.visitor-counter-card .digit .digit-val {
    position: relative;
    z-index: 1;
    text-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

/* Dim leading zeros to highlight active counts */
.visitor-counter-card .digit.digit-leading {
    opacity: 0.32;
    background: linear-gradient(180deg, #18202d 0%, #0c121a 100%);
    border-color: rgba(255, 255, 255, 0.05);
}

.visitor-counter-card .digit.digit-leading .digit-val {
    color: #64748b;
    text-shadow: none;
}

/* Footer Summary Pill */
.visitor-counter-card .counter-footer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(56, 189, 248, 0.1);
    border: 1px solid rgba(56, 189, 248, 0.22);
    border-radius: 16px;
    padding: 3px 13px;
    font-size: 0.8rem;
    color: #bae6fd;
}

.visitor-counter-card .counter-total-label {
    color: #94a3b8;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.visitor-counter-card .counter-total-number {
    font-weight: 700;
    color: #38bdf8;
    font-size: 0.88rem;
    font-family: 'Roboto', 'Sarabun', sans-serif;
}

.visitor-counter-card .counter-unit {
    color: #94a3b8;
    font-size: 0.75rem;
}

/* Footer Section Divider */
.footer-divider-clean {
    height: 1px;
    width: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.12) 50%, transparent 100%);
    margin: 1.5rem 0 1.25rem 0;
}

/* Animations */
@keyframes counterPulseRing {
    0% {
        transform: scale(0.95);
        opacity: 0.8;
    }
    50% {
        transform: scale(2.2);
        opacity: 0;
    }
    100% {
        transform: scale(2.2);
        opacity: 0;
    }
}

@keyframes counterGradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Mobile Responsive */
@media (max-width: 576px) {
    .visitor-counter-wrapper {
        max-width: 320px;
        margin: 1.25rem auto 0.75rem auto;
        padding: 0 8px;
    }

    .visitor-counter-card {
        padding: 13px 14px 12px 14px;
        border-radius: 12px;
    }

    .visitor-counter-card .counter-header {
        gap: 8px;
        margin-bottom: 10px;
    }

    .visitor-counter-card .counter-icon-box {
        width: 30px;
        height: 30px;
        font-size: 13px;
        border-radius: 8px;
    }

    .visitor-counter-card .counter-title {
        font-size: 0.88rem;
    }

    .visitor-counter-card .counter-box {
        gap: 3px;
        padding: 6px 8px;
        margin-bottom: 10px;
    }

    .visitor-counter-card .digit {
        width: 25px;
        height: 34px;
        font-size: 1.15rem;
        border-radius: 5px;
    }

    .visitor-counter-card .counter-footer {
        font-size: 0.75rem;
        padding: 3px 10px;
    }
}
