/**
 * ===================================================
 * Email Protection Styles - Modulares System
 * ===================================================
 * 
 * CSS-Styles für das neue modulare Email-Protection System
 * Koordiniert mit page_animations.js und email_protection.js
 * 
 * @copyright (c) 2025 Potential-Matcher
 * @license   Proprietär - Alle Rechte vorbehalten
 * 
 * Diese Software ist urheberrechtlich geschützt.
 * Die Nutzung ist nur mit ausdrücklicher schriftlicher
 * Erlaubnis des Autors gestattet.
 * ===================================================
 */

/* Honeypot für Bot-Erkennung - ABSOLUT UNSICHTBAR */
.honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    border: none !important;
    background: transparent !important;
    color: transparent !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    z-index: -9999 !important;
}

/* E-Mail-Button Grundstyle - Initial deaktiviert */
.email-protected {
    opacity: 0.6;
    pointer-events: none;
    cursor: not-allowed;
    transition: all 0.3s ease;
    position: relative;
}

/* E-Mail-Button mit data-protected Attribut */
.email-protected[data-protected="true"] {
    pointer-events: none !important;
    opacity: 0.6 !important;
    cursor: wait !important;
    transition: all 0.5s ease !important;
    filter: grayscale(50%);
}

.email-protected[data-protected="true"]:hover {
    opacity: 0.7 !important;
}

/* Email-Button aktiv - Unterstützt beide Klassennamen */
.email-protected.email-active,
.email-protected.activated {
    pointer-events: auto !important;
    opacity: 1 !important;
    cursor: pointer !important;
    filter: none !important;
    transition: all 0.3s ease !important;
}

/* Loading-Animation für Email-Buttons */
.email-protected .bi-hourglass-split {
    animation: emailSpin 1s linear infinite;
}

/* Generische Loading-Animation für alle Email-Buttons */
.email-protected[data-protected="true"]::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 10px;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: emailSpin 1.5s linear infinite;
    opacity: 0.7;
}

.email-protected.activated::after,
.email-protected.email-active::after {
    display: none;
}

@keyframes emailSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Email-Button Hover-Effekt wenn aktiv */
.email-protected.email-active:hover,
.email-protected.activated:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Anti-FOUC für Email-Buttons */
.email-protected[data-encrypted] {
    visibility: visible;
}

/* Debug-Modus Indikator */
.email-debug::after {
    content: " 🔍";
    opacity: 0.5;
    font-size: 0.8em;
}

/* Animation für Statuswechsel */
.email-protected.transitioning {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Accessibility Verbesserungen */
.email-protected:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.email-protected[aria-busy="true"] {
    cursor: wait;
}

/* NoScript Fallback */
noscript .email-protected {
    pointer-events: auto !important;
    opacity: 1 !important;
    filter: none !important;
}

/* Print-Styles - E-Mails in gedruckter Version verschleiern */
@media print {
    .email-protected::after {
        content: " [E-Mail auf Website verfügbar]" !important;
        font-style: italic;
        color: #666;
        animation: none !important;
    }
    
    .honeypot {
        display: none !important;
    }
}

/* Responsive Email-Buttons */
@media (max-width: 768px) {
    .email-protected {
        font-size: 0.9rem;
        padding: 0.5rem 1rem;
        min-height: 44px; /* Touch-Target-Größe */
        min-width: 44px;
        position: relative; /* Für Loading-Animation */
    }
    
    .email-protected .bi {
        margin-right: 0.25rem !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .email-protected {
        border-color: rgba(255, 255, 255, 0.2);
    }
    
    .email-protected:focus {
        outline-color: #4dabf7;
    }
}

/* TIMING-KOORDINATION: Verhindere Konflikte mit Page-Animationen */
.email-protected {
    /* Höhere Priorität als andere Animationen */
    z-index: 10;
    position: relative;
}

/* Sicherheitsmaßnahme: Verstecke alle Inputs mit verdächtigen Namen */
input[name*="email_address"],
input[name*="contact_email"], 
input[name*="user_email"],
input[name*="mail"],
input[name*="website"],
input[name*="url"],
input[name*="homepage"] {
    position: absolute !important;
    left: -9999px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}
