/* Tags page specific styles */
.tags-hero {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 3rem;
    margin-bottom: 3rem;
    margin-top: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.tags-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2, #f093fb, #f5576c, #4facfe, #00f2fe);
    background-size: 300% 100%;
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

.tags-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
}

.tags-hero h1::after {
    content: '🏷️';
    position: absolute;
    right: -60px;
    top: 0;
    font-size: 2rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    20%,
    50%,
    80%,
    100% {
        transform: translateY(0);
    }

    40% {
        transform: translateY(-10px);
    }

    60% {
        transform: translateY(-5px);
    }
}

.tags-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin: 2rem 0;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border-radius: 15px;
    min-width: 120px;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #667eea;
    display: block;
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    position: relative;
}

.tags-container::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #667eea, #764ba2, #f093fb, #f5576c);
    border-radius: 22px;
    z-index: -1;
    opacity: 0.3;
}

.tag-item {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    min-width: 120px;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Dynamic sizing based on count */
.tag-size-1 {
    font-size: 0.85rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.8), rgba(118, 75, 162, 0.8));
}

.tag-size-2 {
    font-size: 0.95rem;
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.8), rgba(245, 87, 108, 0.8));
}

.tag-size-3 {
    font-size: 1.05rem;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.8), rgba(0, 242, 254, 0.8));
}

.tag-size-4 {
    font-size: 1.15rem;
    background: linear-gradient(135deg, rgba(255, 154, 158, 0.8), rgba(250, 208, 196, 0.8));
}

.tag-size-5 {
    font-size: 1.25rem;
    background: linear-gradient(135deg, rgba(168, 237, 234, 0.8), rgba(254, 214, 227, 0.8));
}

.tag-item:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.tag-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.tag-item:hover::before {
    left: 100%;
}

.tag-name {
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    margin-right: 0.5rem;
}

.tag-count {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    padding: 0.2rem 0.6rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    min-width: 25px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.search-box {
    position: relative;
    max-width: 400px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.2rem;
}

.no-results {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Popular tags section */
.popular-tags {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.popular-tags h2 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.5rem;
}

.popular-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    justify-content: center;
}

.popular-tag {
    padding: 0.5rem 1rem;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.popular-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Responsive design */
@media (max-width: 768px) {
    .tags-hero h1 {
        font-size: 2.2rem;
    }

    .tags-hero h1::after {
        right: -40px;
        font-size: 1.5rem;
    }

    .tags-stats {
        gap: 1.5rem;
    }

    .tag-item {
        min-width: 100px;
        padding: 0.6rem 1rem;
    }

    .tags-container {
        padding: 1.5rem;
        gap: 0.8rem;
    }
}

@media (max-width: 480px) {
    .tags-hero {
        padding: 2rem 1.5rem;
    }

    .tags-hero h1 {
        font-size: 1.8rem;
    }

    .tags-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        min-width: auto;
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }
}

/* Animation for tags appearing */
@keyframes tagAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.tag-item {
    animation: tagAppear 0.6s ease forwards;
}

/* Stagger animation delays */
.tag-item:nth-child(1) {
    animation-delay: 0.1s;
}

.tag-item:nth-child(2) {
    animation-delay: 0.15s;
}

.tag-item:nth-child(3) {
    animation-delay: 0.2s;
}

.tag-item:nth-child(4) {
    animation-delay: 0.25s;
}

.tag-item:nth-child(5) {
    animation-delay: 0.3s;
}

.tag-item:nth-child(6) {
    animation-delay: 0.35s;
}

.tag-item:nth-child(7) {
    animation-delay: 0.4s;
}

.tag-item:nth-child(8) {
    animation-delay: 0.45s;
}

.tag-item:nth-child(9) {
    animation-delay: 0.5s;
}

.tag-item:nth-child(10) {
    animation-delay: 0.55s;
}

/* Continue pattern for more tags */
.tag-item:nth-child(n+11) {
    animation-delay: calc(0.6s + (var(--index, 0) * 0.05s));
}

/* Floating animation for some visual flair */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }
}

.tag-item:nth-child(3n) {
    animation: tagAppear 0.6s ease forwards, float 3s ease-in-out infinite;
}

.tag-item:nth-child(5n) {
    animation: tagAppear 0.6s ease forwards, float 4s ease-in-out infinite;
}

/* Pulse effect for popular tags */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0);
    }
}

.popular-tag:hover {
    animation: pulse 1.5s infinite;
}