/* ==========================================================================
   ToolSphare Creative Library — Stylesheet
   Themes + Images + Collections + Color Browse
   ========================================================================== */

/* Sub-navigation bar */
.creative-subnav {
    background: rgba(11, 22, 34, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 68px;
    z-index: 40;
    transition: all 0.25s ease;
}

.creative-subnav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    overflow-x: auto;
    padding: 0.75rem 1rem;
    scrollbar-width: none;
}
.creative-subnav-inner::-webkit-scrollbar { display: none; }

.creative-nav-links {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
    white-space: nowrap;
}

.creative-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s ease;
}
.creative-nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.05);
}
.creative-nav-link.active {
    color: #fff;
    background: var(--brand-blue);
    box-shadow: 0 4px 14px rgba(0, 174, 239, 0.35);
}
.creative-nav-link--cta {
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
    color: #fff !important;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.25);
}
.creative-nav-link--cta:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* Creative Hero */
.creative-hero {
    padding: 3.5rem 0 2.5rem;
    background: radial-gradient(circle at 50% 20%, rgba(0, 174, 239, 0.12) 0%, rgba(6, 10, 18, 0) 70%);
    text-align: center;
    position: relative;
}
.creative-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.9rem;
    border-radius: 999px;
    background: rgba(0, 174, 239, 0.12);
    border: 1px solid rgba(0, 174, 239, 0.25);
    color: var(--primary-light);
    font-size: 0.825rem;
    font-weight: 700;
    margin-bottom: 1rem;
}
.creative-hero h1 {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 1rem;
    background: linear-gradient(180deg, #ffffff 40%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.creative-hero-sub {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 680px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* Creative Search & Filters Bar */
.creative-filter-panel {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
}
.creative-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    justify-content: space-between;
}
.creative-search-box {
    position: relative;
    flex: 1;
    min-width: 260px;
}
.creative-search-input {
    width: 100%;
    padding: 0.65rem 1rem 0.65rem 2.5rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}
.creative-search-input:focus {
    border-color: var(--brand-blue);
    box-shadow: 0 0 0 3px rgba(0, 174, 239, 0.2);
}
.creative-search-icon {
    position: absolute;
    left: 0.85rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.creative-filter-selects {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.creative-select {
    padding: 0.6rem 2rem 0.6rem 0.85rem;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' 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: right 0.75rem center;
}
.creative-select:focus {
    border-color: var(--brand-blue);
    outline: none;
}

/* Color Swatch Bar */
.color-swatches-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0.75rem 0 0.25rem;
    scrollbar-width: none;
}
.color-swatch-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s;
}
.color-swatch-chip:hover {
    border-color: var(--brand-blue);
    color: #fff;
    transform: translateY(-1px);
}
.color-swatch-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Grid Layouts */
.creative-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

/* Theme Card */
.theme-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
    position: relative;
}
.theme-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 174, 239, 0.4);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(0, 174, 239, 0.15);
}
.theme-card-preview {
    height: 170px;
    position: relative;
    overflow: hidden;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}
.theme-preview-mockup {
    background: var(--card-bg, #0f172a);
    border-radius: 8px;
    padding: 0.75rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.1));
}
.theme-mock-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.theme-mock-dots {
    display: flex;
    gap: 4px;
}
.theme-mock-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
}
.theme-mock-badge {
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
    text-transform: uppercase;
}
.theme-mock-body {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.theme-mock-sidebar {
    width: 30%;
    height: 100%;
    border-radius: 4px;
    opacity: 0.35;
}
.theme-mock-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.theme-mock-line {
    height: 6px;
    border-radius: 3px;
    opacity: 0.6;
}
.theme-mock-btn {
    align-self: flex-start;
    height: 16px;
    padding: 0 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
}

.theme-card-body {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.theme-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.theme-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.theme-card-category {
    font-size: 0.75rem;
    color: var(--brand-blue);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

/* Palette Swatch Bar in Theme Card */
.theme-palette-bar {
    display: flex;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.theme-palette-bar span {
    flex: 1;
    height: 100%;
}

.theme-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 0.8rem;
    color: var(--text-muted);
}
.theme-card-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.theme-btn-action {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 0.35rem 0.65rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all 0.2s;
}
.theme-btn-action:hover {
    background: var(--brand-blue);
    color: #fff;
    border-color: var(--brand-blue);
}

/* Image Card */
.image-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.image-card:hover {
    transform: translateY(-4px);
    border-color: rgba(0, 174, 239, 0.4);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
}
.image-card-thumb-wrap {
    aspect-ratio: 16 / 9;
    position: relative;
    overflow: hidden;
    background: #0b1220;
}
.image-card-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.image-card:hover .image-card-thumb {
    transform: scale(1.05);
}
.image-badge-resolution {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.image-badge-4k {
    background: linear-gradient(135deg, #e11d48 0%, #f43f5e 100%);
    border-color: rgba(255, 255, 255, 0.4);
}
.image-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(6, 10, 18, 0.9) 100%);
    opacity: 0;
    transition: opacity 0.25s ease;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 1rem;
}
.image-card:hover .image-card-overlay {
    opacity: 1;
}
.image-overlay-actions {
    display: flex;
    gap: 0.4rem;
    width: 100%;
}
.image-overlay-btn {
    flex: 1;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}
.image-overlay-btn:hover {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
}
.image-overlay-btn--generate {
    background: linear-gradient(135deg, #0ea5e9 0%, #10b981 100%);
}

.image-card-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.image-card-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.image-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Collections Cards */
.collection-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease;
    text-decoration: none;
    color: inherit;
}
.collection-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-blue);
}
.collection-collage {
    height: 160px;
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 2px;
    background: #0b1220;
}
.collection-collage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.collection-collage-img:first-child {
    grid-row: span 2;
}
.collection-card-body {
    padding: 1.25rem;
}
.collection-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.35rem;
}
.collection-card-count {
    font-size: 0.8rem;
    color: var(--brand-blue);
    font-weight: 600;
}

/* Pagination */
.creative-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}
.creative-pagination a, .creative-pagination span {
    padding: 0.5rem 0.9rem;
    border-radius: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.creative-pagination a:hover {
    border-color: var(--brand-blue);
    background: rgba(0, 174, 239, 0.1);
}
.creative-pagination .active {
    background: var(--brand-blue);
    border-color: var(--brand-blue);
    color: #fff;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .creative-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .creative-hero {
        padding: 2.5rem 0 1.5rem;
    }
    .creative-filter-row {
        flex-direction: column;
        align-items: stretch;
    }
}
