.tag-posts-container {
    padding: 2rem 1rem;
}

.tag-search-form {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.tag-search-form .form-control {
    border: 2px solid #e9ecef;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
    height: 42px;
    border-radius: 0.8rem;
    transition: all 0.3s ease;
}

.tag-search-form .btn {
    padding: 0.6rem;
    font-size: 1rem;
    height: 42px;
    width: 42px;
    background: #0d6efd;
    border: none;
    border-radius: 0.8rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tag-search-form .btn:hover {
    background: #0b5ed7;
    transform: translateY(-1px);
}

.tag-search-form .btn i {
    font-size: 1.1rem;
}

.tag-cloud-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
    width: 100%;
}

.tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    margin: 0.3rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #495057;
    border: 2px solid #e9ecef;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.tag-badge:hover {
    transform: translateY(-2px);
    background: #e9ecef;
    color: #212529;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tag-badge.active {
    background: #000;
    color: #fff;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.2);
}

.tag-badge.active:hover {
    background: #0b5ed7;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(13, 110, 253, 0.3);
}

.tag-badge.active .badge {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.tag-badge .badge {
    margin-left: 0.5rem;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 600;
    background: #e9ecef;
    color: #495057;
    transition: all 0.3s ease;
}

.tag-badge:hover .badge {
    background: #dee2e6;
    color: #212529;
}

.more-tags-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1.2rem;
    margin: 0.3rem;
    border-radius: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    cursor: pointer;
    transition: all 0.3s ease;
}

.more-tags-btn:hover {
    background: #e9ecef;
    color: #212529;
    transform: translateY(-1px);
}

.more-tags-btn i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.more-tags-btn.active {
    background: #e9ecef;
    color: #212529;
}

.more-tags-btn.active i {
    transform: rotate(180deg);
}

.tag-group {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.hidden-tags {
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.hidden-tags.show {
    display: flex;
    flex-wrap: wrap;
    opacity: 1;
    transform: translateY(0);
}

.tag-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: #212529;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

.tag-title .tag-count {
    font-size: 1rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.sort-container {
    background: #fff;
    padding: 1.2rem;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.sort-container .btn-group {
    display: flex;
    gap: 0.5rem;
}

.sort-pill {
    display: flex;
    align-items: center;
    background: #fff;
    color: #000;
    ;
    border: none;
    border-radius: 999px;
    padding: 0.4rem 1.2rem 0.4rem 1.2rem;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    box-shadow: none;
    position: relative;
    gap: 0.5rem;
}

.sort-pill.active,
.sort-pill:active {
    background: #000;
    ;
    color: #fff;
}

.sort-pill .sort-badge {
    background: #111;
    color: #fff;
    border-radius: 999px;
    font-size: 0.95em;
    font-weight: 700;
    padding: 0.1em 0.8em;
    margin-left: 0.5em;
    display: inline-block;
}

.card {
    border-radius: 2rem;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.18);
    background: rgba(255, 255, 255, 0.7);
    overflow: hidden;
    border: none;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
    transition: box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 16px 40px 0 rgba(31, 38, 135, 0.22);
}

.card-img-top {
    width: 100%;
    height: 320px;
    object-fit: cover;
    border-radius: 2rem 2rem 0 0;
    background: #f8f9fa;
}

.card-body-glass {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 0 0 2rem 2rem;
    padding: 2rem 1.5rem 1.5rem 1.5rem;
    margin-top: -40px;
    box-shadow: 0 4px 24px 0 rgba(31, 38, 135, 0.08);
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-title {
    font-size: 1.3rem;
    font-weight: bold;
    color: #000;
    ;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card-desc {
    color: #444;
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.card-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.2rem;
}

.card-info-icons {
    display: flex;
    gap: 1.5rem;
    color: #000;
    ;
    font-size: 1rem;
    align-items: center;
}

.card-info-icons span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-follow-btn {
    background: #fff;
    border: none;
    border-radius: 2rem;
    padding: 0.5rem 1.3rem;
    font-weight: 600;
    font-size: 1rem;
    color: #000;
    ;
    box-shadow: 0 2px 8px 0 rgba(31, 38, 135, 0.08);
    transition: background 0.2s;
    cursor: pointer;
}

.card-follow-btn:hover {
    background: #f1f3f5;
}

.pagination-container {
    margin-top: 1.5rem;
}

.page-link {
    border-radius: 0.4rem;
    margin: 0 0.2rem;
    border: none;
    color: #495057;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

.page-item.active .page-link {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

@media (max-width: 768px) {
    .tag-posts-container {
        padding: 1rem;
    }

    .tag-search-form {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .tag-search-form .form-control {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .tag-search-form .btn {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
    }

    .tag-cloud-container {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .tag-badge {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
        margin: 0.2rem;
    }

    .tag-badge .badge {
        padding: 0.2rem 0.5rem;
        font-size: 0.75rem;
    }

    .more-tags-btn {
        padding: 0.4rem 1rem;
        font-size: 0.85rem;
        margin: 0.2rem;
    }

    .tag-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    .card {
        margin-bottom: 1rem;
    }

    .card-body-glass {
        padding: 1rem;
    }
}

.search-results-container {
    background: #fff;
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.search-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
}

.search-results-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.search-results-count {
    font-size: 0.9rem;
    color: #6c757d;
    margin-left: 0.5rem;
}

.clear-search-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

.clear-search-btn:hover {
    background: #e9ecef;
    color: #212529;
}

.clear-search-btn i {
    margin-right: 0.3rem;
}

.search-results-content {
    min-height: 200px;
}

.search-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.search-loading .spinner-border {
    width: 3rem;
    height: 3rem;
    color: #0d6efd;
}