* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #151a27;
    --bg-card: rgba(21, 26, 39, .6);
    --cyan: #00d9ff;
    --cyan-glow: rgba(0, 217, 255, .15);
    --text-primary: #fff;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --border-subtle: rgba(255, 255, 255, .08);
    --border-hover: rgba(0, 217, 255, .3)
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    position: relative;
    overflow-x: hidden
}

body::before {
    content: '';
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--cyan-glow) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    z-index: 1
}

.site-header {
    padding: 1rem 0;
    position: relative;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem
}

.header-left h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 700;
    margin: 0 0 .5rem;
    display: flex;
    align-items: center;
    gap: .5rem
}

.header-left p {
    color: var(--text-secondary);
    font-size: 1rem
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-end
}

.lang-toggle {
    display: flex;
    gap: .25rem;
    padding: .25rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    border: 1px solid var(--border-subtle)
}

.lang-btn {
    padding: .5rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: 8px;
    font-size: .875rem;
    font-weight: 500;
    transition: all .3s;
    white-space: nowrap
}

.lang-btn.active {
    background: var(--cyan);
    color: var(--bg-primary);
    font-weight: 600
}

.ad-banner {
    max-width: 728px;
    border-radius: 12px;
    overflow: hidden;
    display: none
}

.ad-banner.show {
    display: block
}

.ad-banner img {
    width: 100%;
    height: auto;
    display: block
}

.filters {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    padding: 1rem;
    margin: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 999;
    transition: all 0.3s ease;
}

.filters.scrolled {
    background: rgba(11, 15, 25, 0.9);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-wrapper {
    margin-bottom: 0.75rem
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 2px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all .3s
}

.search-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 4px rgba(0, 217, 255, .1)
}

.search-input::placeholder {
    color: var(--text-muted)
}

.tags-section {
    margin-bottom: 0.75rem
}

.tag-expand-btn {
    background: transparent;
    border: 1px dashed var(--border-subtle);
    color: var(--text-secondary);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: .875rem;
    transition: all .3s;
    margin-bottom: .5rem
}

.tag-expand-btn:hover {
    border-color: var(--cyan);
    color: var(--cyan)
}

.tags-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.tag-clear-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.8rem;
    background: transparent;
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.tag-clear-btn:hover {
    background: rgba(255, 99, 71, 0.1);
    border-color: rgba(255, 99, 71, 0.3);
    color: #ff6347;
}

.tag-clear-btn svg {
    flex-shrink: 0;
}

.tag-sort-select {
    padding: 0.4rem 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.2s;
}

.tag-sort-select:hover {
    border-color: var(--cyan);
}

.tag-sort-select:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(0, 217, 255, 0.1);
}

.tags-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.tags-container.expanded {
    max-height: 500px
}

.tag {
    padding: 0.4rem 0.8rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tag:hover,
.tag.active {
    background: var(--cyan);
    color: var(--bg-primary);
    border-color: var(--cyan);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 217, 255, 0.3);
}

.results-count {
    color: var(--text-muted);
    font-size: .875rem
}

.results-count span {
    color: var(--text-primary);
    font-weight: 600
}

.prompts-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.5rem;
    margin: 2rem 0
}

.prompt-card {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-subtle);
    transition: all .3s;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    display: block
}

.prompt-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 12px 40px rgba(0, 217, 255, .15);
    border-color: var(--cyan)
}

.prompt-card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block
}

.prompt-card-content {
    padding: 1rem
}

.prompt-card-title {
    font-size: .9rem;
    font-weight: 600;
    margin-bottom: .5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.prompt-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem
}

.prompt-card-tag {
    font-size: .7rem;
    padding: .25rem .5rem;
    background: var(--bg-secondary);
    border-radius: 4px;
    color: var(--text-muted)
}

.ad-banner-grid {
    grid-column: 1/-1;
    margin: 1rem 0;
    text-align: center;
    display: none
}

.ad-banner-grid.show {
    display: block
}

.ad-banner-grid img {
    max-width: 728px;
    width: 100%;
    height: auto;
    border-radius: 12px
}

.prompt-page {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: 16px;
    padding: 2rem;
    border: 1px solid var(--border-subtle)
}

.prompt-page h1 {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--text-primary)
}

.prompt-image {
    margin-bottom: 2rem;
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-secondary)
}

.prompt-image img {
    width: 100%;
    height: auto;
    display: block
}

.prompt-meta {
    display: flex;
    gap: 2rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: .875rem;
    flex-wrap: wrap
}

.prompt-section {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-subtle)
}

.prompt-section h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary)
}

.prompt-text {
    background: var(--bg-primary);
    padding: 1.5rem;
    padding-right: 1rem;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: .875rem;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
    border: 1px solid var(--border-subtle);
    color: var(--text-primary);
    max-height: 400px;
    overflow-y: auto
}

.copy-btn {
    background: var(--cyan);
    color: var(--bg-primary);
    border: none;
    padding: .875rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all .3s;
    margin-top: 1rem;
    white-space: nowrap
}

.copy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 217, 255, .3)
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 2rem 0
}

.tag-link {
    background: var(--bg-secondary);
    padding: .5rem 1rem;
    border-radius: 8px;
    font-size: .875rem;
    color: var(--text-secondary);
    text-decoration: none;
    border: 1px solid var(--border-subtle);
    transition: all .3s;
    display: inline-block
}

.tag-link:hover {
    border-color: var(--cyan);
    color: var(--cyan)
}

.related-prompts h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem
}

.related-card {
    display: block;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-primary);
    transition: all .3s;
    border: 1px solid var(--border-subtle)
}

.related-card:hover {
    transform: translateY(-4px);
    border-color: var(--cyan)
}

.related-card img {
    width: 100%;
    height: 120px;
    object-fit: cover
}

.related-card span {
    display: block;
    padding: .75rem;
    font-size: .875rem
}

.category-links {
    display: flex;
    gap: .75rem;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* When expanded, show as grid */
.category-links.expanded {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    overflow: visible;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    transition: all .3s;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: 200px;
}

.category-link:hover {
    transform: translateY(-2px);
    border-color: var(--cyan);
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.3);
}

.category-name {
    font-weight: 600
}

.category-count {
    color: var(--text-muted);
    font-size: .875rem;
    margin-left: 0.5rem;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin: 3rem 0
}

.page-link {
    padding: .75rem 1.25rem;
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    transition: all .3s
}

.page-link:hover {
    border-color: var(--cyan)
}

.page-link.active {
    background: var(--cyan);
    border-color: var(--cyan);
    color: var(--bg-primary);
    font-weight: 600
}

nav {
    margin: 0 auto 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 1rem;
    transition: all 0.3s ease;
    background: transparent;
}

nav.scrolled {
    background: rgba(11, 15, 25, 0.85);
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    padding: .5rem 1rem;
    border-radius: 8px;
    transition: all .3s;
    border: 1px solid var(--border-subtle)
}

nav a:hover {
    background: var(--bg-card);
    border-color: var(--cyan);
    color: var(--text-primary)
}

/* ===== MODERN BUTTON STYLES ===== */
#toggle-categories-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

#toggle-categories-btn svg {
    flex-shrink: 0;
}

/* ===== SCROLL BEHAVIOR ===== */
html {
    scroll-behavior: smooth;
}

@media(max-width:1200px) {
    .prompts-grid {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(max-width:900px) {
    .prompts-grid {
        grid-template-columns: repeat(3, 1fr)
    }
}

@media(max-width:768px) {
    .header-content {
        flex-direction: column;
        align-items: stretch
    }

    .header-right {
        align-items: stretch
    }

    .lang-toggle {
        align-self: flex-end;
        width: auto
    }

    .ad-banner {
        max-width: 100%
    }

    .prompts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem
    }

    .prompt-page {
        padding: 1rem
    }

    .tags-container {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch
    }

    .tag {
        flex-shrink: 0
    }

    /* Fix copy/share buttons on mobile */
    .copy-btn {
        padding: .65rem 1.25rem;
        font-size: .85rem;
        flex: 1;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis
    }
}

@media(max-width:500px) {
    .prompts-grid {
        grid-template-columns: 1fr
    }
}

/* ===== BACK TO TOP BUTTON ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--cyan);
    color: var(--bg-primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 217, 255, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.6);
}

.back-to-top:active {
    transform: scale(0.95);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 45px;
        height: 45px;
    }
}

/* ===== ADVERTISEMENT BANNER ===== */
.ad-banner-section {
    margin: 1.5rem 0;
    text-align: center;
    position: relative;
}

.ad-banner-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    opacity: 0.6;
}

.ad-banner-link {
    display: inline-block;
    text-decoration: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
}

.ad-banner-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 217, 255, 0.15);
    border-color: rgba(0, 217, 255, 0.3);
}

.ad-banner-img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 970px;
}

/* Responsive ad sizes */
@media (max-width: 768px) {
    .ad-banner-img {
        max-width: 320px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .ad-banner-img {
        max-width: 728px;
    }
}