/* Custom Taxonomy Filter - Frontend Styles */
.ctf-filter-widget {
    background: #f8f9fa;
    padding: 25px;
    margin-bottom: 30px;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

/* Default Layout Styles */
.ctf-filter-widget.ctf-layout-default .ctf-filter-header h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 1.3em;
    border-bottom: 2px solid #007cba;
    padding-bottom: 10px;
    font-weight: 600;
}

.ctf-filter-widget.ctf-layout-default .ctf-filter-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 25px;
}

.ctf-filter-widget.ctf-layout-default .ctf-filter-group {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ctf-filter-widget.ctf-layout-default .ctf-filter-group:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #007cba;
}

.ctf-filter-widget.ctf-layout-default .ctf-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

/* Compact Layout Styles */
.ctf-filter-widget.ctf-layout-compact {
    padding: 15px 20px;
}

.ctf-filter-widget.ctf-layout-compact .ctf-filter-header {
    display: none;
}

.ctf-filter-widget.ctf-layout-compact .ctf-filter-fields {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 0;
    flex-wrap: nowrap;
}

.ctf-filter-widget.ctf-layout-compact .ctf-filter-group {
    background: transparent;
    padding: 0;
    border: none;
    margin-bottom: 0;
    flex: 0 1 auto;
    min-width: 180px;
}

.ctf-filter-widget.ctf-layout-compact .ctf-filter-group label {
    display: none;
}

.ctf-filter-widget.ctf-layout-compact .ctf-filter-actions {
    padding-top: 0;
    border-top: none;
    flex: 0 0 auto;
    margin-left: auto;
}

/* Super Compact Layout Styles */
.ctf-filter-widget.ctf-layout-super-compact {
    padding: 12px 15px;
}

.ctf-filter-widget.ctf-layout-super-compact .ctf-filter-fields {
    gap: 10px;
}

.ctf-filter-widget.ctf-layout-super-compact .ctf-filter-group {
    min-width: 150px;
}

.ctf-filter-widget.ctf-layout-super-compact .ctf-filter-select {
    padding: 6px 10px;
    font-size: 12px;
    height: 34px;
}

.ctf-filter-widget.ctf-layout-super-compact .ctf-submit-button,
.ctf-filter-widget.ctf-layout-super-compact .ctf-reset-button {
    padding: 6px 12px;
    font-size: 12px;
    height: 34px;
}

/* Common Elements - Apply to all layouts */
.ctf-filter-select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    transition: all 0.3s ease;
    color: #495057;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 12px;
}

.ctf-filter-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ctf-filter-select option {
    padding: 8px;
    color: #495057;
}

.ctf-filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
}

.ctf-submit-button {
    background: #007cba;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
}

.ctf-reset-button {
    background: #6c757d;
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    transition: all 0.3s ease;
    min-height: 44px;
}

.ctf-submit-button:hover,
.ctf-reset-button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.ctf-submit-button:active,
.ctf-reset-button:active {
    transform: translateY(0);
}

/* Checkbox Style */
.ctf-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    background: white;
}

.ctf-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: normal;
    cursor: pointer;
    padding: 4px 0;
    color: #495057;
}

.ctf-checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.ctf-term-count {
    font-size: 0.85em;
    color: #6c757d;
    margin-left: auto;
}

/* Button Style */
.ctf-button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ctf-filter-button {
    padding: 8px 16px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    color: #495057;
}

.ctf-filter-button:hover,
.ctf-filter-button.active,
.ctf-filter-button[data-active="true"] {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

.ctf-filter-button.ctf-all-button {
    font-weight: 600;
    background: #f8f9fa;
}

/* Empty States & Notices */
.ctf-no-taxonomies-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 6px;
    padding: 20px;
    text-align: center;
    color: #856404;
}

.ctf-no-taxonomies-notice p {
    margin: 0;
    font-weight: 500;
}

.ctf-no-terms {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-top: 8px;
}

/* Loading States */
.ctf-ajax-loader {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #e7f3ff;
    border-radius: 4px;
    margin-top: 10px;
}

.ctf-ajax-loader .spinner {
    float: none;
    margin: 0;
}

/* Results Styling */
.ctf-ajax-results {
    margin-top: 20px;
}

.ctf-results-count {
    background: #e7f3ff;
    padding: 12px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #007cba;
    border-left: 4px solid #007cba;
}

.ctf-posts-grid {
    display: grid;
    gap: 20px;
}

.ctf-post-item {
    background: white;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.ctf-post-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ctf-post-title {
    margin: 0 0 10px 0;
    font-size: 1.2em;
}

.ctf-post-title a {
    color: #333;
    text-decoration: none;
}

.ctf-post-title a:hover {
    color: #007cba;
}

.ctf-post-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
    font-size: 0.9em;
    color: #6c757d;
}

.ctf-post-categories {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.ctf-category-tag {
    background: #f8f9fa;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 0.8em;
    border: 1px solid #e9ecef;
}

.ctf-category-tag a {
    color: #495057;
    text-decoration: none;
}

.ctf-category-tag a:hover {
    color: #007cba;
}

.ctf-post-excerpt {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

.ctf-post-taxonomies {
    margin-bottom: 15px;
}

.ctf-taxonomy-terms {
    font-size: 0.9em;
    margin-bottom: 5px;
    color: #6c757d;
}

.ctf-term-link {
    color: #007cba;
    text-decoration: none;
}

.ctf-term-link:hover {
    text-decoration: underline;
}

.ctf-read-more {
    color: #007cba;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9em;
}

.ctf-read-more:hover {
    text-decoration: underline;
}

/* No Results Styling */
.ctf-no-results {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.ctf-no-results-icon {
    font-size: 3em;
    color: #6c757d;
    margin-bottom: 15px;
}

.ctf-no-results h3 {
    color: #495057;
    margin-bottom: 10px;
}

.ctf-active-filters {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin: 20px 0;
    text-align: left;
}

.ctf-active-filters h4 {
    margin: 0 0 10px 0;
    color: #495057;
}

.ctf-active-filters ul {
    margin: 0;
    padding-left: 20px;
}

.ctf-active-filters li {
    margin-bottom: 5px;
    color: #6c757d;
}

.ctf-reset-all {
    display: inline-block;
    background: #007cba;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 15px;
}

.ctf-reset-all:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Pagination */
.ctf-ajax-pagination {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.ctf-pagination-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.ctf-pagination-prev,
.ctf-pagination-next,
.ctf-pagination-go {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

.ctf-pagination-prev:disabled,
.ctf-pagination-next:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.ctf-pagination-info {
    color: #6c757d;
    font-size: 0.9em;
}

.ctf-pagination-jump {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.9em;
}

.ctf-pagination-jump label {
    margin: 0;
    color: #495057;
}

#ctf-page-input {
    width: 60px;
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .ctf-filter-widget.ctf-layout-compact .ctf-filter-fields,
    .ctf-filter-widget.ctf-layout-super-compact .ctf-filter-fields {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .ctf-filter-widget.ctf-layout-compact .ctf-filter-group,
    .ctf-filter-widget.ctf-layout-super-compact .ctf-filter-group {
        flex: 1 1 calc(50% - 10px);
        min-width: 140px;
    }
    
    .ctf-filter-widget.ctf-layout-compact .ctf-filter-actions,
    .ctf-filter-widget.ctf-layout-super-compact .ctf-filter-actions {
        flex: 1 1 100%;
        justify-content: center;
        margin-left: 0;
        margin-top: 10px;
    }
    
    .ctf-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .ctf-filter-widget {
        padding: 20px;
    }
    
    .ctf-filter-widget.ctf-layout-default .ctf-filter-fields {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .ctf-filter-widget.ctf-layout-compact .ctf-filter-group,
    .ctf-filter-widget.ctf-layout-super-compact .ctf-filter-group {
        flex: 1 1 100%;
    }
    
    .ctf-filter-actions {
        flex-direction: column;
    }
    
    .ctf-submit-button,
    .ctf-reset-button {
        width: 100%;
        text-align: center;
    }
    
    .ctf-pagination-inner {
        flex-direction: column;
        gap: 10px;
    }
    
    .ctf-pagination-jump {
        flex-direction: column;
        gap: 5px;
    }
    
    .ctf-post-meta {
        flex-direction: column;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .ctf-filter-widget {
        padding: 15px;
    }
    
    .ctf-filter-widget.ctf-layout-super-compact {
        padding: 10px;
    }
    
    .ctf-button-group {
        flex-direction: column;
    }
    
    .ctf-filter-button {
        width: 100%;
        text-align: center;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    .ctf-filter-widget {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .ctf-filter-widget.ctf-layout-default .ctf-filter-group {
        background: #4a5568;
        border-color: #718096;
    }
    
    .ctf-filter-widget.ctf-layout-default .ctf-filter-group label {
        color: #e2e8f0;
    }
    
    .ctf-filter-select {
        background-color: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .ctf-filter-select option {
        background-color: #4a5568;
        color: #e2e8f0;
    }
    
    .ctf-post-item {
        background: #4a5568;
        border-color: #718096;
        color: #e2e8f0;
    }
    
    .ctf-post-title a {
        color: #e2e8f0;
    }
    
    .ctf-category-tag {
        background: #2d3748;
        border-color: #718096;
    }
    
    .ctf-category-tag a {
        color: #e2e8f0;
    }
}

/* Print Styles */
@media print {
    .ctf-filter-widget {
        display: none;
    }
}