/**
 * Simple Post Filter CSS
 * Styles for the client-side post filtering interface
 * Colors matched to GCU Bootstrap theme
 */

.spf-container {
    margin: 20px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Filter Form Styles */
.spf-filter-form {
    background: #F6F8F9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    border: 1px solid #B9C8D3;
}

.spf-filter-form select,
.spf-filter-form button,
.spf-filter-form input {
    padding: 8px 12px;
    border: 1px solid #B9C8D3;
    border-radius: 4px;
    font-size: 14px;
    background: white;
    color: #48525B;
    transition: all 0.2s ease;
    flex: 1 1 auto;
    min-width: 120px;
    max-width: 200px;
}

.spf-filter-form select {
    flex: 0 1 15%;
    min-width: 120px;
    max-width: 200px;
}

.spf-filter-form input[type="text"] {
    flex: 1 1 25%;
    min-width: 200px;
    max-width: 300px;
}

.spf-filter-form button {
    flex: 0 0 auto;
    min-width: auto;
    max-width: none;
}

.spf-filter-form select:focus,
.spf-filter-form button:focus,
.spf-filter-form input:focus {
    outline: none;
    border-color: #522398;
    box-shadow: 0 0 0 2px rgba(82, 35, 152, 0.2);
}

.spf-filter-form select:hover,
.spf-filter-form input:hover {
    border-color: #778692;
}

.spf-clear-filters {
    background-color: #522398;
    color: white;
    border: 1px solid #522398;
    cursor: pointer;
    font-weight: bold;
    border-radius: 50px;
}

.spf-clear-filters:hover {
    background-color: #3f1c75;
    border-color: #3f1c75;
    color: #ffffff;
}

/* Results Info */
.spf-results-info {
    margin-bottom: 15px;
    color: #5F6C78;
    font-size: 14px;
    font-weight: 500;
}

/* Post List Styles */
.spf-post-list {
    list-style: none !important;
    list-style-type: none !important;
    padding: 0 !important;
    margin: 0 !important;
    padding-left: 0 !important;
    margin-left: 0 !important;
    overflow: visible !important;
}

/* Override Bootstrap list styles completely */
.spf-post-list li,
.spf-post-item {
    background: white;
    border: 1px solid #B9C8D3;
    border-radius: 6px;
    margin-bottom: 12px;
    padding: 16px !important;
    transition: all 0.2s ease;
    opacity: 1;
    list-style: none !important;
    list-style-type: none !important;
    list-style-image: none !important;
    list-style-position: outside !important;
    padding-left: 16px !important;
    margin-left: 0 !important;
    text-indent: 0 !important;
    position: relative;
}

/* Remove any pseudo-elements that might create bullets or icons */
.spf-post-list li::before,
.spf-post-list li::after,
.spf-post-item::before,
.spf-post-item::after {
    content: none !important;
    display: none !important;
}

.spf-post-item:hover {
    border-color: #522398;
    box-shadow: 0 2px 8px rgba(82, 35, 152, 0.1);
    transform: translateY(-1px);
}

.spf-post-link {
    text-decoration: none;
    color: #522398;
    font-weight: 600;
    font-size: 16px;
    display: inline-block;
    margin-bottom: 4px;
}

.spf-post-link:hover {
    color: #3f1c75;
    text-decoration: underline;
}

/* Ensure all links inside post items use GCU purple */
.spf-post-item > a,
.spf-post-item a {
    color: #522398;
    text-decoration: none;
}

.spf-post-item > a:hover,
.spf-post-item a:hover {
    color: #3f1c75;
    text-decoration: underline;
}

.spf-post-title {
    line-height: 1.4;
}

.spf-post-date {
    color: #5F6C78;
    font-size: 13px;
    font-weight: normal;
}

.spf-post-categories {
    margin-top: 6px;
    font-size: 12px;
}

.spf-category {
    background-color: #F6F8F9;
    color: #48525B;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #B9C8D3;
    font-size: 11px;
    font-weight: 500;
}

.spf-post-tags {
    margin-top: 6px;
    font-size: 12px;
}

.spf-tag {
    background-color: #522398;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid #522398;
    font-size: 11px;
    font-weight: 500;
}

.spf-post-author {
    margin-top: 6px;
    font-size: 12px;
    color: #5F6C78;
    font-style: italic;
}

.spf-post-list .spf-post-item .spf-post-excerpt {
    display: block;
}

.spf-post-excerpt {
    margin-top: 8px;
    color: #48525B;
    font-size: 14px;
    line-height: 1.5;
    display: block;
}

/* No Results */
.spf-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #5F6C78;
    font-style: italic;
}

.spf-no-results p {
    margin: 0;
    font-size: 16px;
}

/* Pagination Styles */
.spf-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    gap: 10px;
}

.spf-pagination button {
    padding: 8px 16px;
    border: 1px solid #B9C8D3;
    border-radius: 50px;
    background: white;
    color: #48525B;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s ease;
}

.spf-pagination button:hover:not(:disabled) {
    background-color: #522398;
    color: white;
    border-color: #522398;
}

.spf-pagination button:disabled {
    background-color: #eee;
    color: #778692;
    cursor: not-allowed;
    opacity: 0.6;
}

.spf-pagination button:disabled:contains("Loading") {
    background-color: #522398;
    color: white;
    opacity: 0.8;
}

.spf-pagination-info {
    font-size: 14px;
    color: #5F6C78;
    margin: 0 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .spf-filter-form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .spf-filter-form select,
    .spf-filter-form button,
    .spf-filter-form input {
        width: 100%;
        flex: 1 1 100%;
        min-width: 100%;
        max-width: 100%;
    }
    
    .spf-post-item {
        padding: 12px;
    }
    
    .spf-post-link {
        font-size: 15px;
    }
    
    .spf-pagination {
        flex-direction: column;
        gap: 8px;
    }
    
    .spf-pagination button {
        width: 120px;
    }
}

/* Medium screens - start transitioning to block layout */
@media (max-width: 1024px) and (min-width: 769px) {
    .spf-filter-form select {
        flex: 0 1 20%;
        min-width: 140px;
    }
    
    .spf-filter-form input[type="text"] {
        flex: 1 1 30%;
        min-width: 180px;
    }
}

/* Loading Animation */
.spf-post-item {
    animation: fadeIn 0.2s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Filter Active State */
.spf-filter-form select:not([value=""]),
.spf-filter-form input:not([value=""]) {
    background-color: #FFFFFF;
    border-color: #522398;
}

/* Accessibility */
.spf-filter-form select:focus-visible,
.spf-filter-form button:focus-visible,
.spf-filter-form input:focus-visible {
    outline: 2px solid #522398;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .spf-filter-form {
        display: none;
    }
    
    .spf-results-info {
        display: none;
    }
    
    .spf-post-item {
        border: none;
        box-shadow: none;
        page-break-inside: avoid;
    }
}
