/**
 * Google Tag Manager Plugin Styles
 * @author HS Digital Solutions
 * @version 1.0.0
 */

/* GTM Debug Console (nur im Debug-Modus sichtbar) */
.gtm-debug-console {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 15px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    max-width: 400px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: translateX(420px);
    transition: transform 0.3s ease-in-out;
}

.gtm-debug-console.show {
    transform: translateX(0);
}

.gtm-debug-console .gtm-debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.gtm-debug-console .gtm-debug-title {
    font-weight: bold;
    color: #4CAF50;
}

.gtm-debug-console .gtm-debug-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gtm-debug-console .gtm-debug-close:hover {
    color: #ff6b6b;
}

.gtm-debug-console .gtm-debug-content {
    line-height: 1.4;
}

.gtm-debug-console .gtm-event {
    margin-bottom: 8px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border-left: 3px solid #4CAF50;
}

.gtm-debug-console .gtm-event.error {
    border-left-color: #ff6b6b;
}

.gtm-debug-console .gtm-event.warning {
    border-left-color: #ffa726;
}

.gtm-debug-console .gtm-event-time {
    color: #888;
    font-size: 10px;
}

.gtm-debug-console .gtm-event-name {
    color: #4CAF50;
    font-weight: bold;
}

.gtm-debug-console .gtm-event-data {
    color: #ccc;
    margin-top: 3px;
    font-size: 11px;
}

/* GTM Status Indicator */
.gtm-status-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 9998;
    transition: all 0.3s ease;
}

.gtm-status-indicator.active {
    background-color: #4CAF50;
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.gtm-status-indicator.inactive {
    background-color: #f44336;
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.gtm-status-indicator.consent-pending {
    background-color: #ff9800;
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* GTM Debug Toggle Button (nur im Debug-Modus) */
.gtm-debug-toggle {
    position: fixed;
    bottom: 20px;
    right: 440px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    z-index: 9999;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.gtm-debug-toggle:hover {
    background: #45a049;
    transform: scale(1.1);
}

.gtm-debug-toggle.console-open {
    right: 20px;
    margin-right: 420px;
}

/* Consent Banner Enhancements */
.gtm-consent-enhancement {
    padding: 3px 8px;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 4px;
    color: #2e7d32;
    font-size: 11px;
    margin-left: 8px;
    display: inline-block;
}

/* GTM Loading Indicator */
.gtm-loading {
    display: inline-block;
    position: relative;
    margin-left: 10px;
}

.gtm-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Enhanced Event Tracking Visual Feedback */
.gtm-event-feedback {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.95);
    color: white;
    padding: 15px 25px;
    border-radius: 8px;
    font-weight: bold;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gtm-event-feedback.show {
    opacity: 1;
}

.gtm-event-feedback.error {
    background: rgba(244, 67, 54, 0.95);
}

.gtm-event-feedback.warning {
    background: rgba(255, 152, 0, 0.95);
}

/* Responsive Design */
@media (max-width: 768px) {
    .gtm-debug-console {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(350px);
    }
    
    .gtm-debug-console.show {
        transform: translateY(0);
    }
    
    .gtm-debug-toggle {
        bottom: 10px;
        right: 10px;
    }
    
    .gtm-debug-toggle.console-open {
        right: 10px;
        margin-right: 0;
        bottom: 320px;
    }
    
    .gtm-status-indicator {
        top: 10px;
        right: 10px;
    }
}

/* Print Styles */
@media print {
    .gtm-debug-console,
    .gtm-debug-toggle,
    .gtm-status-indicator,
    .gtm-event-feedback {
        display: none !important;
    }
}

/* Accessibility Enhancements */
.gtm-debug-console:focus-within {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

.gtm-debug-toggle:focus {
    outline: 2px solid #4CAF50;
    outline-offset: 2px;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .gtm-debug-console {
        background: rgba(33, 33, 33, 0.95);
        border: 1px solid #444;
    }
    
    .gtm-debug-console .gtm-debug-header {
        border-bottom-color: #444;
    }
    
    .gtm-debug-console .gtm-event {
        background: rgba(255, 255, 255, 0.05);
    }
}

/* Animation Classes */
.gtm-fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.gtm-slide-in {
    animation: slideIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* Custom Scrollbar for Debug Console */
.gtm-debug-console::-webkit-scrollbar {
    width: 6px;
}

.gtm-debug-console::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.gtm-debug-console::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.gtm-debug-console::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}