/* Site Visit Counter Styles - Positioned on Left */
.visit-counter,
.visitor-counter {
    position: fixed;
    bottom: 20px;
    left: 20px; /* Positioned on left as requested */
    background: linear-gradient(135deg, rgba(0, 123, 255, 0.95) 0%, rgba(0, 86, 179, 0.9) 100%);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.05);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    z-index: var(--z-visitor-counter, 1000);
    max-width: 200px;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
    display: block; /* Visible by default */
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* Show counter when manually triggered */
.visit-counter.show,
.visitor-counter.show {
    display: block;
    animation: slideInCounter 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.visit-counter:hover,
.visitor-counter:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 
        0 12px 40px rgba(0,0,0,0.15),
        0 4px 12px rgba(0,0,0,0.08);
    background: linear-gradient(135deg, rgba(0, 123, 255, 1) 0%, rgba(0, 86, 179, 1) 100%);
}

.visit-counter.expanded,
.visitor-counter.expanded {
    max-width: 250px;
}

.counter-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.counter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.counter-title {
    font-weight: 600;
    font-size: 14px;
    flex: 1;
    margin-left: 8px;
}

.counter-close {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    opacity: 0.8;
}

.counter-close:hover {
    background: rgba(255, 255, 255, 0.2);
    opacity: 1;
}

.counter-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.counter-label {
    font-size: 11px;
    opacity: 0.9;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.counter-number {
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
}

.counter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.counter-icon {
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    font-weight: 600;
}

.counter-title {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.counter-toggle {
    background: none;
    border: none;
    color: #6b7280;
    font-size: 16px;
    cursor: pointer;
    padding: 2px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.counter-toggle:hover {
    background: rgba(0,0,0,0.05);
    color: #374151;
}

.counter-stats {
    display: grid;
    gap: 8px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: rgba(255,255,255,0.6);
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.06);
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 500;
}

.stat-value {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    display: flex;
    align-items: center;
    gap: 4px;
}

.stat-value .trend {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
}

.trend.up {
    background: rgba(34, 197, 94, 0.1);
    color: #059669;
}

.trend.neutral {
    background: rgba(156, 163, 175, 0.1);
    color: #6b7280;
}

.counter-details {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(0,0,0,0.08);
    display: none;
    animation: fadeInDetails 0.3s ease forwards;
}

.counter-details.show {
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.detail-item {
    text-align: center;
    padding: 8px;
    background: rgba(255,255,255,0.4);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.04);
}

.detail-number {
    font-size: 16px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.detail-label {
    font-size: 10px;
    color: #6b7280;
    font-weight: 500;
    margin: 2px 0 0 0;
}

.counter-footer {
    font-size: 10px;
    color: #9ca3af;
    text-align: center;
    margin-top: 8px;
    font-weight: 500;
}

.counter-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.3);
    animation: pulse 2s infinite;
}

/* Hidden state - panel created but not shown until user clicks footer link */
.visit-counter.hidden {
    opacity: 0 !important;
    transform: translateY(20px) scale(0.95) !important;
    pointer-events: none;
    visibility: hidden;
}

/* Close button in top-right inside the panel */
.counter-close {
    position: absolute;
    top: 8px;
    right: 8px;
    background: transparent;
    border: none;
    font-size: 16px;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
}

.counter-close:hover {
    background: rgba(0,0,0,0.04);
    color: #374151;
}

/* Footer analytics link style */
.footer-analytics-link {
    color: #6b7280;
    text-decoration: none;
    font-weight: 600;
}
.footer-analytics-link:hover {
    color: #374151;
    text-decoration: underline;
}

/* Animations */
@keyframes slideInCounter {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.8);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeInDetails {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

@keyframes countUp {
    0% {
        transform: translateY(20px);
        opacity: 0;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

.number-animation {
    animation: countUp 0.5s ease forwards;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .visit-counter {
        bottom: 80px;
        left: 15px;
        right: 15px;
        max-width: none;
        padding: 14px 16px;
    }
    
    .visit-counter.expanded {
        max-width: none;
    }
    
    .detail-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .detail-item {
        padding: 6px;
    }
    
    .detail-number {
        font-size: 14px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .visit-counter {
        background: linear-gradient(135deg, rgba(31,41,55,0.95) 0%, rgba(17,24,39,0.85) 100%);
        border: 1px solid rgba(255,255,255,0.1);
        color: #f9fafb;
    }
    
    .counter-title {
        color: #f9fafb;
    }
    
    .stat-label {
        color: #9ca3af;
    }
    
    .stat-value {
        color: #f9fafb;
    }
    
    .stat-row {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .detail-item {
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
    }
    
    .detail-number {
        color: #f9fafb;
    }
}