/**
 * Tudástár Category Filter Styles
 */

/* Search Bar */
.tudastar-search-wrapper {
    position: relative;
    max-width: 100%;
    margin: 0 auto 40px auto;
    display: inline-flex;
    justify-content: start;
    align-items: center;
    min-width: 50%;
}

.tudastar-search-input {
    width: 100%;
    max-width: 800px;
    padding: 16px 55px 16px 24px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 16px;
    line-height: 1.5;
    background: #fff;
    color: #333;
    transition: all 0.2s ease;
    outline: none;
    box-shadow: none;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 50px !important;
}

.tudastar-search-input:hover {
    border-color: #d0d0d0;
}

.tudastar-search-input:focus {
    border-color: #d0d0d0;
    box-shadow: none;
    outline: none;
}

.tudastar-search-input::placeholder {
    color: #aaa;
    opacity: 1;
}

.tudastar-search-input::-webkit-search-decoration,
.tudastar-search-input::-webkit-search-cancel-button,
.tudastar-search-input::-webkit-search-results-button,
.tudastar-search-input::-webkit-search-results-decoration {
    -webkit-appearance: none;
    appearance: none;
}

.tudastar-search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    color: #999;
    pointer-events: none;
    z-index: 1;
    transition: color 0.2s ease;
}

.tudastar-search-wrapper:focus-within .tudastar-search-icon {
    color: #666;
}

/* Category Filters */
.tudastar-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tudastar-category-label {
    display: inline-block;
    cursor: pointer;
    user-select: none;
    padding: 8px 16px;
    border-radius: 6px;
    background-color: white; /* Olive green/khaki color */
    color: #1d1d1d;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.3s ease;
    border: none;
    border: 1px solid rgb(209, 213, 219);
}

.tudastar-category-text {
    color: rgb(55, 65, 81);
    font-weight: 500;
    font-size: 14px;
}

.tudastar-category-label:hover {
    background-color: rgb(30, 79, 82);
    color: white;
    opacity: 0.9;
}

.tudastar-category-label:hover .tudastar-category-text {
    color: white;
}

.tudastar-category-label.active {
    background-color: #A68A1C; /* Orange when active */
    font-weight: 600;
}

.tudastar-category-label.active .tudastar-category-text {
    color: #fff;
}

.tudastar-category-label.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.tudastar-category-checkbox {
    display: none !important;
}

/* Loading Indicator */
.tudastar-loading {
    text-align: center;
    padding: 20px;
    color: #666;
}

/* Posts Container */
.tudastar-posts-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

@media (min-width: 1200px) {
    .tudastar-posts-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1600px) {
    .tudastar-posts-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Post Card */
.tudastar-post-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tudastar-post-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.tudastar-post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: #f5f5f5;
    position: relative;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.tudastar-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.tudastar-post-card:hover .tudastar-post-image img {
    transform: scale(1.05);
}

.tudastar-post-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.tudastar-post-content {
    padding: 20px;
}

.tudastar-post-category {
    position: absolute;
    bottom: 12px;
    left: 12px;
    display: inline-block;
    background-color: #A68A1C; /* Orange background */
    color: #fff; /* White text */
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 4px;
    z-index: 2;
    margin: 0;
}

.tudastar-post-date {
    color: #666; /* Dark gray */
    font-size: 13px;
    margin-bottom: 12px;
    text-align: right;
}

.tudastar-post-title {
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none !important;
}

.tudastar-post-title a {
    color: #333; /* Dark text */
    text-decoration: none;
    transition: color 0.3s ease;
    text-decoration: none !important;
}

.tudastar-post-title a:hover {
    color: #A68A1C; /* Orange on hover */
}

.tudastar-post-excerpt {
    color: #666; /* Dark gray */
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.tudastar-post-read-more {
    display: inline-block;
    color: #A68A1C; /* Orange color */
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
    text-decoration: none !important;
}

.tudastar-post-read-more:hover {
    color: #1e4f52;
    text-decoration: underline !important;
}

/* No Posts Message */
.tudastar-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
    grid-column: 1 / -1;
}

/* Error Message */
.tudastar-error {
    text-align: center;
    padding: 20px;
    color: #A68A1C;
    background: #ffebee;
    border-radius: 4px;
    grid-column: 1 / -1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tudastar-search-wrapper {
        max-width: 100%;
        margin-bottom: 20px;
        min-width: 100%;
    }
    
    .tudastar-search-input {
        padding: 14px 50px 14px 20px;
        font-size: 15px;
        max-width: 100%;
        border-radius: 50px;
    }
    
    .tudastar-search-icon {
        right: 18px;
        width: 18px;
        height: 18px;
    }
    
    .tudastar-posts-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tudastar-category-filters {
        gap: 8px;
    }
    
    .tudastar-category-label {
        padding: 6px 12px;
    }
    
    .tudastar-post-title {
        font-size: 18px;
    }
}
