/**
 * Visitor Tracking Frontend Styles
 * 
 * @package VisitorTracking
 * @version 1.0.0
 */

/* Visitor Count Display */
.current-visitors {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    color: #495057;
    transition: all 0.2s ease;
    cursor: pointer;
    user-select: none;
}

.current-visitors:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.current-visitors:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.visitor-count {
    font-weight: 700;
    font-size: 18px;
    color: #007bff;
    min-width: 24px;
    text-align: center;
    transition: all 0.3s ease;
}

.visitor-label {
    font-weight: 500;
    color: #6c757d;
}

/* Animation Classes */
.visitor-count.updated {
    animation: pulse 0.6s ease-in-out;
}

.visitor-count.loading {
    opacity: 0.6;
    position: relative;
}

.visitor-count.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #007bff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Error Message */
.visitor-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    padding: 8px 12px;
    margin-top: 8px;
    font-size: 12px;
    animation: slideIn 0.3s ease-out;
}

/* Pulse Animation */
@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Spin Animation */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Slide In Animation */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .current-visitors {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .visitor-count {
        font-size: 16px;
        min-width: 20px;
    }
    
    .visitor-label {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .current-visitors {
        flex-direction: column;
        gap: 4px;
        text-align: center;
        padding: 8px;
    }
    
    .visitor-count {
        font-size: 20px;
    }
    
    .visitor-label {
        font-size: 11px;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .current-visitors {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .current-visitors:hover {
        background: #4a5568;
        border-color: #718096;
    }
    
    .visitor-count {
        color: #63b3ed;
    }
    
    .visitor-label {
        color: #a0aec0;
    }
    
    .visitor-error {
        background: #742a2a;
        color: #feb2b2;
        border-color: #c53030;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .current-visitors {
        border-width: 2px;
        background: #ffffff;
        color: #000000;
    }
    
    .visitor-count {
        color: #0000ff;
    }
    
    .visitor-label {
        color: #000000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .current-visitors,
    .visitor-count,
    .visitor-count.loading::after {
        transition: none;
        animation: none;
    }
    
    .visitor-count.updated {
        animation: none;
    }
    
    .visitor-error {
        animation: none;
    }
}

/* Print Styles */
@media print {
    .current-visitors {
        background: transparent !important;
        border: 1px solid #000 !important;
        color: #000 !important;
        box-shadow: none !important;
    }
    
    .visitor-count {
        color: #000 !important;
    }
    
    .visitor-label {
        color: #000 !important;
    }
}

/* Focus Styles for Accessibility */
.current-visitors:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.current-visitors:focus:not(:focus-visible) {
    outline: none;
}

/* Custom Themes */
.current-visitors.theme-minimal {
    background: transparent;
    border: none;
    padding: 4px 8px;
}

.current-visitors.theme-minimal .visitor-count {
    color: #333;
}

.current-visitors.theme-minimal .visitor-label {
    color: #666;
}

.current-visitors.theme-bold {
    background: #007bff;
    border-color: #0056b3;
    color: #ffffff;
}

.current-visitors.theme-bold .visitor-count {
    color: #ffffff;
}

.current-visitors.theme-bold .visitor-label {
    color: #e6f3ff;
}

.current-visitors.theme-rounded {
    border-radius: 20px;
    padding: 8px 16px;
}

.current-visitors.theme-outlined {
    background: transparent;
    border: 2px solid #007bff;
    color: #007bff;
}

.current-visitors.theme-outlined .visitor-count {
    color: #007bff;
}

.current-visitors.theme-outlined .visitor-label {
    color: #007bff;
}
