/**
 * EBY Mailing Registration - Hauptstyles
 * 
 * Styles für das Newsletter-Widget
 * 
 * @package EBY_Mailing_Reg
 * @since 1.0.0
 */

/* ==========================================================================
   Widget-Container
   ========================================================================== */

.eby-mailing-reg-widget {
    max-width: 400px;
    margin: 20px auto;
    padding: 24px;
    background: #ffffff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    box-sizing: border-box;
}

.eby-mailing-reg-widget * {
    box-sizing: border-box;
}

/* ==========================================================================
   Header-Bereich
   ========================================================================== */

.eby-mailing-reg-header {
    margin-bottom: 20px;
    text-align: center;
}

.eby-mailing-reg-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    line-height: 1.3;
}

.eby-mailing-reg-description {
    margin: 0;
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

/* ==========================================================================
   Status-Bereich
   ========================================================================== */

.eby-mailing-reg-status {
    margin-bottom: 20px;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
}

.eby-mailing-reg-status.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.eby-mailing-reg-status.info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.eby-mailing-reg-status.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* ==========================================================================
   Loading-Indikator
   ========================================================================== */

.eby-mailing-reg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    text-align: center;
}

.eby-loading-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #4285f4;
    border-radius: 50%;
    animation: eby-spin 1s linear infinite;
}

.eby-loading-text {
    font-size: 14px;
    color: #666;
}

@keyframes eby-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==========================================================================
   Google-Login-Bereich
   ========================================================================== */

.eby-mailing-reg-login {
    margin-bottom: 20px;
    text-align: center;
}

.eby-google-signin-button {
    display: inline-block;
    min-height: 40px;
    transform: scale(0.8);
    transform-origin: center;
}

/* Google Identity Services Button Anpassungen */
.eby-google-signin-button iframe,
.eby-google-signin-button > div {
    margin: 0 auto;
}

/* ==========================================================================
   Aktions-Bereich
   ========================================================================== */

.eby-mailing-reg-actions {
    margin-bottom: 20px;
}

.eby-user-info {
    margin-bottom: 16px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-align: center;
}

.eby-user-email {
    font-size: 14px;
    font-weight: 500;
    color: #495057;
}

.eby-action-buttons {
    display: flex !important;
    gap: 12px !important;
    flex-direction: column !important;
}

@media (min-width: 480px) {
    .eby-action-buttons {
        flex-direction: row !important;
    }
}

/* ==========================================================================
   Buttons - MAXIMALE SICHTBARKEIT
   ========================================================================== */

.eby-btn,
button.eby-btn,
a.eby-btn,
.eby-mailing-reg-actions .eby-btn {
    display: inline-block !important;
    padding: 12px 24px !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    min-height: 44px !important;
    flex: 1 !important;
    opacity: 1 !important;
    visibility: visible !important;
    line-height: 1.5 !important;
}

.eby-btn:hover,
button.eby-btn:hover,
a.eby-btn:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.eby-btn:active,
button.eby-btn:active {
    transform: translateY(0) !important;
}

.eby-btn:disabled,
button.eby-btn:disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: none !important;
}

/* GRÜNER Subscribe-Button - IMMER SICHTBAR */
.eby-btn-subscribe,
button.eby-btn-subscribe,
a.eby-btn-subscribe,
#eby-btn-subscribe,
button#eby-btn-subscribe {
    background-color: #28a745 !important;
    background: #28a745 !important;
    color: #ffffff !important;
    border: 2px solid #28a745 !important;
    font-weight: 600 !important;
}

.eby-btn-subscribe:hover,
button.eby-btn-subscribe:hover,
a.eby-btn-subscribe:hover,
#eby-btn-subscribe:hover {
    background-color: #218838 !important;
    background: #218838 !important;
    border-color: #1e7e34 !important;
    color: #ffffff !important;
}

/* ROTER Unsubscribe-Button - IMMER SICHTBAR */
.eby-btn-unsubscribe,
button.eby-btn-unsubscribe,
a.eby-btn-unsubscribe,
#eby-btn-unsubscribe,
button#eby-btn-unsubscribe {
    background-color: #dc3545 !important;
    background: #dc3545 !important;
    color: #ffffff !important;
    border: 2px solid #dc3545 !important;
    font-weight: 600 !important;
}

.eby-btn-unsubscribe:hover,
button.eby-btn-unsubscribe:hover,
a.eby-btn-unsubscribe:hover,
#eby-btn-unsubscribe:hover {
    background-color: #c82333 !important;
    background: #c82333 !important;
    border-color: #bd2130 !important;
    color: #ffffff !important;
}

.eby-btn-retry {
    background-color: #6c757d;
    color: white;
    border: 1px solid #6c757d;
    margin-top: 12px;
}

.eby-btn-retry:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

/* ==========================================================================
   Privacy-Hinweis
   ========================================================================== */

.eby-mailing-reg-privacy {
    margin-bottom: 16px;
}

.eby-privacy-note {
    margin: 0;
    padding: 12px;
    font-size: 12px;
    color: #6c757d;
    background-color: #f8f9fa;
    border-radius: 6px;
    text-align: center;
    line-height: 1.4;
}

.eby-privacy-note a {
    color: #007bff;
    text-decoration: none;
}

.eby-privacy-note a:hover {
    text-decoration: underline;
}

/* ==========================================================================
   Error-Bereich
   ========================================================================== */

.eby-mailing-reg-error {
    margin-bottom: 20px;
    padding: 16px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
}

.eby-error-message {
    margin-bottom: 12px;
    font-size: 14px;
    font-weight: 500;
}

/* ==========================================================================
   Debug-Bereich
   ========================================================================== */

.eby-mailing-reg-debug {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px dashed #dee2e6;
    font-size: 12px;
}

.eby-mailing-reg-debug details {
    background-color: #f8f9fa;
    border-radius: 6px;
    padding: 8px;
}

.eby-mailing-reg-debug summary {
    cursor: pointer;
    font-weight: 500;
    margin-bottom: 8px;
    color: #6c757d;
}

.eby-debug-content {
    margin-top: 8px;
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    word-break: break-word;
}

.eby-debug-content p {
    margin: 4px 0;
}

#eby-debug-log {
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px;
    margin-top: 8px;
}

/* ==========================================================================
   Responsive Anpassungen
   ========================================================================== */

@media (max-width: 480px) {
    .eby-mailing-reg-widget {
        margin: 10px;
        padding: 16px;
        border-radius: 8px;
    }
    
    .eby-mailing-reg-title {
        font-size: 18px;
    }
    
    .eby-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* ==========================================================================
   Zugänglichkeit (Accessibility)
   ========================================================================== */

.eby-btn:focus,
.eby-google-signin-button:focus-within {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

.eby-mailing-reg-widget [aria-hidden="true"] {
    display: none;
}

/* Screen Reader Only */
.eby-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   Theme-Integration
   ========================================================================== */

/* Überschreibt Theme-Styles für bessere Kompatibilität */
.eby-mailing-reg-widget h3 {
    margin: 0 0 12px 0 !important;
    padding: 0 !important;
}

.eby-mailing-reg-widget p {
    margin: 0 !important;
}

.eby-mailing-reg-widget button {
    background: none !important;
    border: none !important;
    margin: 0 !important;
    padding: 12px 24px !important;
}

/* Dark Mode Support (respects user preference) */
@media (prefers-color-scheme: dark) {
    .eby-mailing-reg-widget {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .eby-mailing-reg-title {
        color: #f7fafc;
    }
    
    .eby-mailing-reg-description {
        color: #cbd5e0;
    }
    
    .eby-user-info {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .eby-privacy-note {
        background-color: #4a5568;
        color: #cbd5e0;
    }
    
    .eby-mailing-reg-debug details {
        background-color: #4a5568;
    }
}