/* Wonder Hub–aligned tokens (Brand Guidelines Aug 2024) */
:root {
    --wp-twilight-blue: #0E0F52;
    --wp-sapphire-blue: #0038FF;
    --wp-pure-white: #FFFFFF;
    --wp-linen-white: #FFFDF8;
    --wp-gold-mid: #D1A43F;
    --bg: #060621;
    --fg: var(--wp-linen-white);
    --fg-muted: rgba(255, 253, 248, 0.72);
    --fg-subtle: rgba(255, 253, 248, 0.5);
    --border: rgba(255, 253, 248, 0.14);
    --border-strong: rgba(255, 253, 248, 0.28);
    --font-body: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --hub-topbar-h: 64px;
}

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

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    background-image: url('/hub-bg-gradient.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--fg);
    line-height: 1.55;
    display: flex;
    flex-direction: column;
}

.hidden {
    display: none !important;
}

/* ======================== Login (Wonder Hub) ======================== */
.login {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
    background-color: var(--bg);
    background-image: url('/hub-bg-gradient.png');
    background-size: cover;
    background-position: center;
    z-index: 20;
}

.login-card {
    width: 100%;
    max-width: 420px;
    text-align: left;
}

.login .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px;
}

.login .mark {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--wp-linen-white);
    flex-shrink: 0;
}

.login .name {
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--fg-muted);
}

.login h1 {
    margin: 0 0 6px;
    font-weight: 500;
    font-size: 28px;
    letter-spacing: -0.015em;
    line-height: 1.15;
    color: var(--fg);
}

.login .lede {
    color: var(--fg-muted);
    font-size: 14.5px;
    margin: 0 0 24px;
    line-height: 1.55;
}

.login-error {
    margin: 0 0 14px;
    font-size: 13px;
    color: #ffb4b4;
    line-height: 1.45;
}

.login .sso {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
    padding: 12px 18px;
    border: none;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp-twilight-blue);
    background: #fffdf8;
    width: 100%;
    justify-content: center;
    cursor: pointer;
    font-family: var(--font-body);
    text-decoration: none;
    box-sizing: border-box;
    transition: filter 120ms ease, transform 60ms ease;
}

.login .sso:hover {
    filter: brightness(0.97);
}

.login .sso:active {
    transform: translateY(1px);
}

.login .foot {
    margin-top: 28px;
    font-size: 12px;
    color: var(--fg-subtle);
    line-height: 1.55;
}

button {
    background: var(--wp-sapphire-blue);
    color: var(--wp-linen-white);
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-body);
    cursor: pointer;
    transition: filter 120ms ease, transform 60ms ease;
}

button:hover {
    filter: brightness(1.08);
}

button:active {
    transform: translateY(1px);
}

/* Main container */
.main-container {
    min-height: 100vh;
    background: transparent;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* ======================== Top bar (Wonder Hub) ======================== */
.hub-topbar,
.hub-topbar--dark {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 18px;
    width: 100%;
    box-sizing: border-box;
    height: var(--hub-topbar-h);
    padding: 0 max(22px, env(safe-area-inset-right)) 0 max(22px, env(safe-area-inset-left));
    background: #060621;
    border-bottom: 1px solid rgba(255, 253, 248, 0.12);
    color: var(--wp-linen-white);
    font-family: var(--font-body);
}

.hub-topbar__logo-link {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    padding: 6px 0;
    line-height: 0;
}

.hub-topbar__logo {
    display: block;
    width: auto;
    height: 26px;
    max-height: 26px;
    max-width: min(160px, 36vw);
    object-fit: contain;
    object-position: left center;
}

.hub-topbar__nav {
    display: flex;
    gap: 4px;
    margin-left: 8px;
    flex-shrink: 0;
}

.hub-topbar__nav-link {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 253, 248, 0.72);
    border-radius: 3px;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}

.hub-topbar__nav-link.is-active {
    color: var(--wp-linen-white);
    border-bottom-color: var(--wp-gold-mid);
}

.hub-topbar__search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 560px;
    margin-left: 20px;
}

.hub-topbar__search input {
    flex: 1 1 220px;
    min-width: 140px;
    max-width: 280px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid rgba(255, 253, 248, 0.22);
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--font-body);
    font-weight: 400;
    background: rgba(255, 253, 248, 0.96);
    color: var(--wp-twilight-blue);
}

.hub-topbar__search input::placeholder {
    color: rgba(14, 15, 82, 0.45);
    font-size: 12px;
}

.hub-topbar__search input:focus {
    outline: none;
    border-color: var(--wp-sapphire-blue);
    box-shadow: 0 0 0 2px rgba(0, 56, 255, 0.22);
}

.hub-topbar__search button {
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-family: var(--font-body);
    white-space: nowrap;
    flex-shrink: 0;
}

.hub-topbar__search #search-btn {
    background: var(--wp-sapphire-blue);
    color: var(--wp-linen-white);
}

.hub-topbar__search .ghost-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 253, 248, 0.22);
    color: var(--wp-linen-white);
}

.hub-topbar__search .ghost-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    filter: none;
    transform: none;
    box-shadow: none;
}

.hub-topbar__search .browse-all-btn,
.hub-topbar__search #browse-all-btn {
    background: var(--wp-gold-mid) !important;
    color: var(--wp-twilight-blue) !important;
    border: none !important;
    padding: 0 12px !important;
    height: 36px !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    box-shadow: none !important;
    margin: 0 !important;
}

.hub-topbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    margin-left: auto;
}

.hub-topbar__avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 253, 248, 0.25);
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--wp-linen-white);
}

.hub-topbar__signout {
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--wp-twilight-blue);
    background: #fffdf8;
    border: none;
    border-radius: 8px;
    padding: 7px 12px;
    cursor: pointer;
    font-family: var(--font-body);
    font-weight: 700;
    transition: filter 120ms ease, transform 60ms ease;
}

.hub-topbar__signout:hover {
    filter: brightness(0.97);
    transform: none;
    box-shadow: none;
}

.hub-topbar__signout:active {
    transform: translateY(1px);
}

/* Main content */
.main-content {
    padding: 30px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    flex: 1;
}

/* Loading */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 253, 248, 0.2);
    border-top: 4px solid var(--wp-sapphire-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: var(--fg-muted);
    font-size: 16px;
}

/* Results info */
.results-info {
    margin-bottom: 30px;
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.results-info p {
    color: white;
    font-size: 16px;
    margin: 0;
}

/* Assets grid */
.assets-grid {
    display: flex;
    flex-direction: column;
    gap: 32px;
    margin-bottom: 24px;
    padding: 0 32px;
}

/* Title groups */
.title-group {
    background: #060621;
    background-image: radial-gradient(ellipse at 1957px -27px, #0C0E6B 0%, rgba(17, 17, 42, 0) 100%);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.group-title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.5);
    padding-bottom: 8px;
}

.group-title {
    color: white;
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.group-types {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.group-content-type,
.group-studio,
.group-ref-id,
.group-season {
    color: white;
    font-size: 14px;
    margin: 8px 0 0 0;
}

/* IMDB link button */
.imdb-link-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.imdb-label {
    font-style: italic;
    color: white;
    font-size: 14px;
}

.imdb-link-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5c518;
    color: #000;
    text-decoration: none;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
    white-space: nowrap;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
}

.imdb-link-btn:hover {
    background: #f7d047;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(245, 197, 24, 0.4);
}

.imdb-link-btn svg {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
}

.group-assets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
    position: relative;
}

.asset-card-with-url {
    display: flex;
    flex-direction: column;
}

.asset-url-wrapper {
    margin-top: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.asset-url-link {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #60a5fa;
    text-decoration: none;
    font-size: 11px;
    word-break: break-all;
    transition: color 0.2s;
}

.asset-url-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}

.asset-url-link svg {
    flex-shrink: 0;
    color: #60a5fa;
}

.asset-url-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.asset-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    transition: all 0.2s ease;
    cursor: pointer;
    border: 1px solid #e2e8f0;
    position: relative;
}

.asset-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #3b82f6;
}

.asset-image-container {
    position: relative;
    width: 100%;
    height: 120px;
    background: #f8f9fa;
}

.asset-image-container.logo-background {
    background-image: 
        linear-gradient(45deg, #b0b0b0 25%, transparent 25%),
        linear-gradient(-45deg, #b0b0b0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #b0b0b0 75%),
        linear-gradient(-45deg, transparent 75%, #b0b0b0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #ffffff;
}

.asset-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.asset-download-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease, background 0.2s ease;
    z-index: 10;
    padding: 0;
}

.asset-card:hover .asset-download-btn {
    opacity: 1;
}

.asset-download-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.asset-download-btn svg {
    width: 18px;
    height: 18px;
}

.asset-info {
    padding: 8px;
}

.asset-title {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-content-name {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asset-type {
    font-size: 13px;
    color: var(--wp-twilight-blue);
    font-weight: 600;
    margin-bottom: 2px;
    background: rgba(14, 15, 82, 0.08);
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
}

.image-type-tag {
    display: inline-block;
    padding: 2px 6px;
    margin-right: 4px;
    background: rgba(14, 15, 82, 0.08);
    border-radius: 3px;
    font-size: 13px;
    font-weight: 600;
    color: var(--wp-twilight-blue);
}

.asset-season-episode {
    font-size: 11px;
    color: #666;
    margin-bottom: 4px;
    font-weight: 500;
}

.asset-dimensions {
    font-size: 9px;
    color: #999;
}

/* Asset card wrapper for positioning button */
.asset-card-wrapper {
    display: contents;
}

/* Related images button - circular icon button */
.related-images-btn {
    background: var(--wp-sapphire-blue);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    align-self: center;
    justify-self: center;
    margin: 0;
    padding: 0;
}

.related-images-btn svg {
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.related-images-tooltip {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 1000;
}

.related-images-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.related-images-btn:hover:not(:disabled) .related-images-tooltip {
    opacity: 1;
}

.related-images-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 56, 255, 0.35);
}

.related-images-btn:hover:not(:disabled) svg {
    transform: translateX(2px);
}

.related-images-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    margin-top: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pagination-btn {
    background: var(--wp-sapphire-blue);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 56, 255, 0.3);
}

.pagination-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.page-info {
    font-size: 14px;
    color: white;
    font-weight: 500;
}

/* No results */
.no-results {
    text-align: center;
    padding: 80px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.no-results h3 {
    color: white;
    font-size: 24px;
    margin-bottom: 16px;
}

.no-results p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
}

.close:hover {
    background: rgba(0, 0, 0, 0.8);
}

#modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    background: #f8f9fa;
    position: relative;
}

/* Modal navigation buttons */
.modal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1002;
    transition: all 0.2s ease;
    color: white;
    padding: 0;
}

.modal-nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: white;
    transform: translateY(-50%) scale(1.1);
}

.modal-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.modal-nav-btn svg {
    width: 24px;
    height: 24px;
    stroke: white;
    stroke-width: 2.5;
}

.modal-nav-prev {
    left: 20px;
}

.modal-nav-next {
    right: 20px;
}

#modal-image.logo-background {
    background-image: 
        linear-gradient(45deg, #b0b0b0 25%, transparent 25%),
        linear-gradient(-45deg, #b0b0b0 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #b0b0b0 75%),
        linear-gradient(-45deg, transparent 75%, #b0b0b0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #ffffff;
}

.image-info {
    padding: 20px;
    background: white;
    border-top: 1px solid #e1e5e9;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}

.image-details {
    flex: 1;
}

.image-info h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 20px;
}

.image-info p {
    margin-bottom: 4px;
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}

#download-btn {
    background: #28a745;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

#download-btn:hover {
    background: #218838;
    box-shadow: 0 8px 20px rgba(40, 167, 69, 0.3);
    transform: translateY(-1px);
}

/* Responsive design */
@media (max-width: 960px) {
    .hub-topbar {
        flex-wrap: wrap;
        height: auto;
        min-height: var(--hub-topbar-h);
        padding-top: 10px;
        padding-bottom: 10px;
        row-gap: 10px;
    }

    .hub-topbar__search {
        order: 3;
        flex: 1 1 100%;
        max-width: none;
        margin-left: 0;
    }

    .hub-topbar__search input {
        max-width: none;
        flex: 1 1 auto;
    }

    .hub-topbar__actions {
        margin-left: auto;
    }
}

@media (max-width: 768px) {
    .assets-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }

    .main-content {
        padding: 20px;
    }

    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }

    .image-info {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }

    #download-btn {
        align-self: center;
        width: 100%;
        max-width: 200px;
    }

    .hub-topbar__search {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .assets-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
.footer {
    background: rgba(6, 6, 33, 0.85);
    border-top: 1px solid rgba(255, 253, 248, 0.12);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: auto;
}

.footer-left {
    flex: 1;
    min-width: 300px;
}

.footer-right {
    flex-shrink: 0;
}

.footer p {
    color: var(--fg-subtle);
    margin: 0;
    font-size: 12px;
    line-height: 1.4;
}

.footer-left p {
    font-style: normal;
    text-align: left;
}

.footer-right p {
    font-style: italic;
    text-align: right;
}

@media (max-width: 768px) {
    .footer {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .footer-left {
        min-width: auto;
    }
    
    .footer-left p,
    .footer-right p {
        text-align: center;
    }
}

/* Browse All - Haystack Styles */
.browse-all-btn,
#browse-all-btn {
    background: var(--wp-gold-mid) !important;
    color: var(--wp-twilight-blue) !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 700 !important;
    letter-spacing: 0.06em !important;
    text-transform: uppercase !important;
    transition: filter 120ms ease !important;
    box-shadow: none !important;
    white-space: nowrap !important;
}

.browse-all-sort {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
    margin-left: 12px;
    min-width: 220px;
}

.browse-all-sort:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.browse-all-sort option {
    background: #1a1a2e;
    color: white;
}

.image-type-filter {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    outline: none;
    margin-left: auto;
    min-width: 200px;
}

.image-type-filter:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.image-type-filter option {
    background: #1a1a2e;
    color: white;
}

.results-info .image-type-filter + .browse-all-sort {
    margin-left: 12px;
}

.browse-all-btn:hover,
#browse-all-btn:hover {
    transform: none !important;
    filter: brightness(1.06) !important;
    box-shadow: none !important;
    background: var(--wp-gold-mid) !important;
}

.browse-all-btn:active,
#browse-all-btn:active {
    transform: translateY(1px) !important;
    box-shadow: none !important;
}

/* Haystack grid layout */
.assets-grid.haystack-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding: 0 32px;
}

/* Haystack tile */
.haystack-tile {
    background: #060621;
    background-image: radial-gradient(ellipse at 1957px -27px, #0C0E6B 0%, rgba(17, 17, 42, 0) 100%);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.haystack-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Haystack card stack */
.haystack-card-stack {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 aspect ratio */
    background: #1a1a1a;
    overflow: visible; /* Allow stacked cards to be visible */
    margin-bottom: 16px;
    border-radius: 8px;
}

.haystack-card-stack-item {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 85%;
    height: 85%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background: #1a1a1a;
    transition: box-shadow 0.2s;
}

.haystack-card-stack-item:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.6);
}

.haystack-poster-container {
    position: relative;
    width: 100%;
    height: 100%;
    background: #1a1a1a;
    overflow: hidden;
}

.haystack-poster-image {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Don't scale/zoom - show full image */
    display: block;
}

.haystack-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10; /* Above stacked cards */
    border-radius: 8px;
    pointer-events: none; /* Allow clicks to pass through overlay to button */
}

.haystack-tile:hover .haystack-overlay {
    opacity: 1;
}

.haystack-overlay .haystack-expand-btn {
    pointer-events: auto; /* Enable clicks on button */
}

.haystack-expand-btn {
    background: rgba(0, 0, 0, 0.8); /* Darker background for better contrast */
    border: 2px solid rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 11; /* Above overlay */
    min-width: 50px;
    min-height: 50px;
}

.haystack-expand-btn:hover {
    background: rgba(0, 0, 0, 0.6);
    border-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.haystack-expand-btn .expand-icon {
    color: white;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    display: block;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.9));
}

.haystack-expand-btn .expand-icon.up {
    font-size: 20px;
}

/* Haystack info */
.haystack-info {
    padding: 16px;
    color: white;
}

.haystack-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: white;
}

.haystack-studio {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 4px;
}

.haystack-ref-id {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 4px;
    font-family: monospace;
}

.haystack-image-type {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 4px;
    font-style: italic;
}

.haystack-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 8px;
}

/* Expanded haystack group (replaces tile in grid) */
.expanded-haystack-group {
    width: 100%;
    grid-column: 1 / -1; /* Span all columns */
    margin-bottom: 24px;
    animation: expandFadeIn 0.3s ease-out;
}

@keyframes expandFadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.expanded-haystack-group .group-title-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

.haystack-close-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
    flex-shrink: 0;
    padding: 0;
    margin: 0;
}

.haystack-close-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    transform: scale(1.1);
}

.haystack-close-btn svg {
    width: 18px;
    height: 18px;
    stroke: white;
    stroke-width: 2.5;
}

.expanded-haystack-group .title-group {
    margin-bottom: 16px;
}

.expanded-haystack-group .group-assets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}
