/**
 * Bricks Honeypot Extended - Frontend Styles
 * 
 * @package BricksHoneypotExtended
 * @since 1.0.0
 */

:root {
    /* Color Variables */
    --bhe-primary-color: #0073aa;
    --bhe-primary-hover: #005a87;
    --bhe-secondary-color: #f1f1f1;
    --bhe-success-color: #46b450;
    --bhe-warning-color: #ffb900;
    --bhe-error-color: #dc3232;
    --bhe-text-primary: #23282d;
    --bhe-text-secondary: #666;
    --bhe-text-light: #999;
    --bhe-border-color: #ddd;
    --bhe-border-light: #e5e5e5;
    
    /* Typography Variables */
    --bhe-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --bhe-font-size-small: 12px;
    --bhe-font-size-normal: 14px;
    --bhe-font-size-medium: 16px;
    --bhe-font-size-large: 18px;
    --bhe-line-height: 1.5;
    
    /* Spacing Variables */
    --bhe-spacing-xs: 5px;
    --bhe-spacing-sm: 10px;
    --bhe-spacing-md: 15px;
    --bhe-spacing-lg: 20px;
    --bhe-spacing-xl: 30px;
    --bhe-spacing-xxl: 40px;
    
    /* Border Variables */
    --bhe-border-radius: 4px;
    --bhe-border-radius-large: 8px;
    --bhe-border-width: 1px;
    
    /* Shadow Variables */
    --bhe-box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --bhe-box-shadow-light: 0 1px 2px rgba(0, 0, 0, 0.05);
    --bhe-box-shadow-hover: 0 4px 8px rgba(0, 0, 0, 0.15);
    
    /* Transition Variables */
    --bhe-transition-fast: 0.2s ease;
    --bhe-transition-normal: 0.3s ease;
    --bhe-transition-slow: 0.5s ease;
    
    /* Z-index Variables */
    --bhe-z-index-modal: 1000;
    --bhe-z-index-overlay: 999;
    --bhe-z-index-tooltip: 1001;
}

/* Honeypot Field - Hidden by default */
.bhe-honeypot-field {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Test Mode - Make honeypot visible for testing */
.bhe-test-mode .bhe-honeypot-field {
    position: relative !important;
    left: auto !important;
    top: auto !important;
    width: auto !important;
    height: auto !important;
    opacity: 1 !important;
    overflow: visible !important;
    clip: auto !important;
    border: var(--bhe-border-width) solid var(--bhe-warning-color) !important;
    margin: var(--bhe-spacing-sm) 0 !important;
    padding: var(--bhe-spacing-sm) !important;
    background-color: #fff3cd !important;
    border-radius: var(--bhe-border-radius) !important;
    font-family: var(--bhe-font-family) !important;
    font-size: var(--bhe-font-size-normal) !important;
}

/* Test Mode Label */
.bhe-test-mode .bhe-honeypot-field::before {
    content: "⚠️ TEST MODE: Honeypot field (leave empty)";
    display: block;
    color: var(--bhe-warning-color);
    font-size: var(--bhe-font-size-small);
    font-weight: bold;
    margin-bottom: var(--bhe-spacing-xs);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Honeypot Test Panel */
.bhe-test-panel {
    background: var(--bhe-secondary-color);
    border: var(--bhe-border-width) solid var(--bhe-border-color);
    border-radius: var(--bhe-border-radius-large);
    padding: var(--bhe-spacing-lg);
    margin: var(--bhe-spacing-lg) 0;
    font-family: var(--bhe-font-family);
    box-shadow: var(--bhe-box-shadow-light);
}

.bhe-test-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--bhe-spacing-md);
    padding-bottom: var(--bhe-spacing-md);
    border-bottom: var(--bhe-border-width) solid var(--bhe-border-light);
}

.bhe-test-panel__title {
    font-size: var(--bhe-font-size-medium);
    font-weight: 600;
    color: var(--bhe-text-primary);
    margin: 0;
}

.bhe-test-panel__toggle {
    background: var(--bhe-primary-color);
    color: white;
    border: none;
    padding: var(--bhe-spacing-xs) var(--bhe-spacing-md);
    border-radius: var(--bhe-border-radius);
    font-size: var(--bhe-font-size-small);
    cursor: pointer;
    transition: background-color var(--bhe-transition-fast);
}

.bhe-test-panel__toggle:hover {
    background: var(--bhe-primary-hover);
}

.bhe-test-panel__toggle.active {
    background: var(--bhe-success-color);
}

.bhe-test-panel__content {
    display: none;
}

.bhe-test-panel__content.active {
    display: block;
}

.bhe-test-panel__description {
    color: var(--bhe-text-secondary);
    font-size: var(--bhe-font-size-normal);
    line-height: var(--bhe-line-height);
    margin-bottom: var(--bhe-spacing-md);
}

.bhe-test-panel__controls {
    display: flex;
    gap: var(--bhe-spacing-sm);
    align-items: center;
    margin-bottom: var(--bhe-spacing-md);
}

.bhe-test-panel__button {
    background: var(--bhe-primary-color);
    color: white;
    border: none;
    padding: var(--bhe-spacing-sm) var(--bhe-spacing-md);
    border-radius: var(--bhe-border-radius);
    font-size: var(--bhe-font-size-normal);
    cursor: pointer;
    transition: all var(--bhe-transition-fast);
    text-decoration: none;
    display: inline-block;
}

.bhe-test-panel__button:hover {
    background: var(--bhe-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--bhe-box-shadow-hover);
}

.bhe-test-panel__button--secondary {
    background: var(--bhe-secondary-color);
    color: var(--bhe-text-primary);
    border: var(--bhe-border-width) solid var(--bhe-border-color);
}

.bhe-test-panel__button--secondary:hover {
    background: #e6e6e6;
}

.bhe-test-panel__status {
    padding: var(--bhe-spacing-sm) var(--bhe-spacing-md);
    border-radius: var(--bhe-border-radius);
    font-size: var(--bhe-font-size-normal);
    font-weight: 500;
    margin-top: var(--bhe-spacing-md);
    display: none;
}

.bhe-test-panel__status.success {
    background: #d4edda;
    color: #155724;
    border: var(--bhe-border-width) solid #c3e6cb;
    display: block;
}

.bhe-test-panel__status.warning {
    background: #fff3cd;
    color: #856404;
    border: var(--bhe-border-width) solid #ffeaa7;
    display: block;
}

.bhe-test-panel__status.error {
    background: #f8d7da;
    color: #721c24;
    border: var(--bhe-border-width) solid #f5c6cb;
    display: block;
}

/* Loading States */
.bhe-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.bhe-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--bhe-border-light);
    border-top: 2px solid var(--bhe-primary-color);
    border-radius: 50%;
    animation: bhe-spin 1s linear infinite;
}

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

/* Form Integration */
.bricks-form .bhe-honeypot-field {
    /* Ensure honeypot field inherits form styling when in test mode */
}

.bricks-form.bhe-test-mode .bhe-honeypot-field {
    background: #fff3cd !important;
    border-color: var(--bhe-warning-color) !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .bhe-test-panel {
        padding: var(--bhe-spacing-md);
        margin: var(--bhe-spacing-md) 0;
    }
    
    .bhe-test-panel__controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bhe-test-panel__button {
        width: 100%;
        text-align: center;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    :root {
        --bhe-border-color: #000;
        --bhe-border-light: #333;
        --bhe-text-secondary: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bhe-test-panel__button,
    .bhe-loading::after {
        transition: none;
        animation: none;
    }
}

/* Print Styles */
@media print {
    .bhe-test-panel,
    .bhe-test-mode .bhe-honeypot-field {
        display: none !important;
    }
} 