/**
 * Bizzet Lite Filter - Frontend Styles
 * 
 * Styling for the filter interface including modules, buttons, and dynamic link display.
 */

/* ===========================
   Filter Container
   =========================== */
.bizzet-filter-container {
    background: #ffffff;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 30px;
}

.bizzet-automatic-filters .bizzet-filter-container {
    background: #f9f9f9;
}

/* ===========================
   Filter Modules
   =========================== */
.bizzet-filter-module {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.bizzet-filter-module:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Module Title */
.bizzet-module-title {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #333333;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===========================
   Category Module
   =========================== */
/* Category-specific styles can be added here */

/* Checkbox Styling */
.bizzet-category-checkbox {
    margin-right: 8px;
    cursor: pointer;
}

.bizzet-filter-module label {
    display: block;
    margin-bottom: 8px;
    cursor: pointer;
    color: #555555;
    font-size: 14px;
    transition: color 0.2s ease;
}

.bizzet-filter-module label:hover {
    color: #0073aa;
}

.bizzet-filter-module label input[type="checkbox"] {
    margin-right: 8px;
}

/* ===========================
   Filter Actions (Buttons & Link)
   =========================== */
.bizzet-filter-actions {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

/* Filter Button */
.bizzet-filter-btn {
    background-color: #0073aa;
    color: #ffffff;
    border: none;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    width: 100%;
    max-width: 250px;
    display: inline-block;
    text-align: center;
    text-decoration: none;
}

.bizzet-filter-btn:hover {
    background-color: #005a87;
    transform: translateY(-1px);
    text-decoration: none;
}

.bizzet-filter-btn:active {
    transform: translateY(0);
}

.bizzet-filter-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.bizzet-filter-btn:disabled,
.bizzet-filter-btn.bizzet-loading {
    background-color: #999999;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Disabled button state (FIX 2.6) */
.bizzet-filter-btn.bizzet-btn-disabled,
.bizzet-filter-btn:disabled:not(.bizzet-loading) {
    background-color: #cccccc;
    color: #888888;
    cursor: not-allowed;
    opacity: 0.5;
    box-shadow: none;
    transform: none;
}

.bizzet-filter-btn.bizzet-btn-disabled:hover {
    background-color: #cccccc;
    transform: none;
}

/* Spinner animation for loading state (FIX 2.1) */
.bizzet-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: bizzet-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes bizzet-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Reset Button (link styled as button) */
.bizzet-reset-btn {
    background-color: #6c757d;
    margin-left: 10px;
}

.bizzet-reset-btn:hover {
    background-color: #5a6268;
}

.bizzet-reset-btn:focus {
    outline: 2px solid #6c757d;
    outline-offset: 2px;
}

/* ===========================
   Dynamic Filter Link
   =========================== */
.bizzet-filter-link {
    margin-top: 15px;
    padding: 12px 15px;
    background: #f0f8ff;
    border: 1px solid #b8daff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    display: none; /* Hidden until populated by JavaScript */
}

/* Link Element */
.bizzet-filter-link-url {
    display: block;
    color: #0073aa;
    text-decoration: none;
    word-break: break-all;
    transition: color 0.2s ease;
}

.bizzet-filter-link-url:hover {
    color: #005a87;
    text-decoration: underline;
}

.bizzet-filter-link-url:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Link Label */
.bizzet-link-label {
    font-weight: 600;
    display: block;
    margin-bottom: 6px;
    color: #333333;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Link Value (URL) */
.bizzet-link-value {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    color: #0073aa;
    background: #ffffff;
    padding: 8px 10px;
    display: inline-block;
    border-radius: 3px;
    border: 1px solid #d1e7f8;
    max-width: 100%;
    overflow-wrap: break-word;
}

/* Icon for external link (optional) */
.bizzet-filter-link-url::after {
    content: " ↗";
    font-size: 11px;
    vertical-align: super;
    opacity: 0.7;
}

/* ===========================
   Responsive Design
   =========================== */
@media (max-width: 768px) {
    .bizzet-filter-container {
        padding: 15px;
    }
    
    .bizzet-filter-btn {
        max-width: 100%;
        padding: 10px 20px;
    }
    
    .bizzet-filter-link {
        padding: 10px 12px;
    }
    
    .bizzet-link-value {
        font-size: 12px;
        padding: 6px 8px;
    }
}

/* ===========================
   Loading State
   =========================== */
.bizzet-filter-btn.bizzet-loading::before {
    content: "";
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    margin-right: 8px;
    animation: bizzet-spin 0.6s linear infinite;
    vertical-align: middle;
}

@keyframes bizzet-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===========================
   Animation for Link Appearance
   =========================== */
.bizzet-filter-link {
    animation: bizzet-slide-down 0.3s ease-out;
}

@keyframes bizzet-slide-down {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   Print Styles
   =========================== */
@media print {
    .bizzet-filter-btn {
        display: none;
    }
    
    .bizzet-filter-link {
        border: 1px solid #000000;
        background: #ffffff;
    }
    
    .bizzet-filter-link-url::after {
        content: none;
    }
}

/* ===========================
   Accessibility Enhancements
   =========================== */
.bizzet-filter-module label:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.bizzet-filter-btn:focus {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .bizzet-filter-container {
        border: 2px solid #000000;
    }
    
    .bizzet-filter-link {
        border: 2px solid #0073aa;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .bizzet-filter-btn,
    .bizzet-filter-link,
    .bizzet-filter-link-url {
        transition: none;
        animation: none;
    }
}
