/**
 * CTA Statistics Frontend Styles
 */

/* Basic button styles */
.cta-stats-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #0073aa;
    color: #ffffff;
    text-decoration: none;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.cta-stats-button:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cta-stats-button:focus {
    outline: 2px solid #005ccc;
    outline-offset: 2px;
}

/* Loading state */
.cta-stats-button.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Debug mode for admin users */
body.logged-in.cta-stats-debug [data-cta-id] {
    position: relative;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.3) !important;
}

body.logged-in.cta-stats-debug [data-cta-id]:before {
    content: attr(data-cta-id);
    position: absolute;
    top: -20px;
    left: 0;
    background: rgba(0, 123, 255, 0.9);
    color: white;
    padding: 2px 6px;
    font-size: 10px;
    font-family: monospace;
    border-radius: 3px;
    z-index: 9999;
    white-space: nowrap;
    pointer-events: none;
}

/* Loading indicator for tracked elements */
[data-cta-id].cta-stats-loading {
    opacity: 0.7;
    pointer-events: none;
}

[data-cta-id].cta-stats-loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: cta-stats-spin 0.8s linear infinite;
}

@keyframes cta-stats-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification styles */
.cta-stats-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    font-size: 14px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.cta-stats-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cta-stats-notification.error {
    background: #dc3545;
}

.cta-stats-notification.warning {
    background: #ffc107;
    color: #212529;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .cta-stats-button {
        width: 100%;
        text-align: center;
    }
    
    .cta-stats-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        transform: translateY(-100%);
    }
    
    .cta-stats-notification.show {
        transform: translateY(0);
    }
    
    body.logged-in.cta-stats-debug [data-cta-id]:before {
        font-size: 8px;
        padding: 1px 4px;
    }
}

/* Print styles */
@media print {
    body.logged-in.cta-stats-debug [data-cta-id]:before,
    .cta-stats-notification {
        display: none !important;
    }
} 