/* Grundlegende Tag-Stile */
a.tag, .tag {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--text-color) !important;
    padding: 2px 8px;
    border-radius: 15px;
    font-size: 14px;
    text-decoration: none !important;
    transition: background-color 0.3s ease;
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
    margin: 2px;
}

a.tag:hover, .tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Layout der Tag-Seite */
.tag-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 20px;
}

.main-content {
    flex: 1;
}

/* Tag-Header */
.tag-header {
    background-color: var(--bg-color);
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 10px;
}

.tag-header h1 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
}

/* Tag-Suchformular */
.tag-search-container {
    padding: 5px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.tag-search-form {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    align-items: center;
}

.search-input-wrapper {
    flex: 2;
    min-width: 0;
}

.category-select-wrapper {
    flex: 1;
    min-width: 0;
}

.search-button-wrapper {
    flex: 0 0 auto;
}

.search-input,
.category-select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 10px;
    border: 1px solid #444;
    background-color: #1c1c24;
    color: white;
    font-size: 14px;
    box-sizing: border-box;
}

.category-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23ffffff' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    padding-right: 30px;
}

.search-button {
    padding: 10px 20px;
    background-color: #1D76CF;
    color: white;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.search-button:hover {
    background-color: #1a68b8;
}

.tags-container,
.related-tags,
.popular-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.related-tags {
    padding: 15px;
    border-radius: 10px;
}

.related-tags h3 {
    margin-top: 0;
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 10px;
}

/* Artikel-Container */
.articles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 300px;
    background-color: #13171F;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    padding: 30px;
    box-sizing: border-box;
}

.sidebar-tags h3 {
    color: #ffffff;
    font-size: 18px;
    margin-bottom: 15px;
}

.sidebar-tag {
    display: inline-block;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 5px;
    margin: 0 5px 5px 0;
    font-size: 12px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.sidebar-tag:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.tag-count {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    padding: 2px 6px;
    margin-left: 5px;
    font-size: 10px;
}

/* Entfernen der Klammern bei allen Tag-Zahlen */
.tag .tag-count::before,
.tag .tag-count::after,
a.tag .tag-count::before,
a.tag .tag-count::after {
    content: none;
}

.tag .tag-count,
a.tag .tag-count,
.tag-title .tag .tag-count {
    margin-left: 5px;
}

/* Hilfsmeldungen */
.no-articles,
.no-tags {
    color: #a3a3b5;
    font-style: italic;
    text-align: center;
    padding: 20px;
    background-color: #2c2c38;
    border-radius: 10px;
}

/* Styles für die Suchergebnisse */
.tag-result {
    margin-bottom: 30px;
}

.tag-title {
    font-size: 20px;
    margin-bottom: 15px;
}

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .tag-page {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        margin-top: 20px;
    }

    .tag-search-form {
        flex-direction: column;
    }

    .search-input-wrapper,
    .category-select-wrapper,
    .search-button-wrapper {
        width: 100%;
    }

    .articles-container {
        grid-template-columns: 1fr;
    }
}