/**
 * OpenAgent.Mom Gallery — Additional Styles
 * Extends the main site's /assets/style.css
 */

/* ─── Gallery Layout ─── */

.gallery-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gallery-page main {
    flex: 1;
}

/* ─── Gallery Navigation (extends landing-nav) ─── */

.gallery-page .landing-nav {
    padding: 20px 0;
    position: relative;
}

/* ─── Skills Sub-Navigation ─── */

.skills-subnav {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: sticky;
    top: 0;
    z-index: 90;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1rem;
}

.skills-subnav::-webkit-scrollbar {
    display: none;
}

.skills-subnav-pill {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.skills-subnav-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.skills-subnav-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* ─── Gradient Text ─── */

.gallery-gradient-text {
    background: linear-gradient(135deg, var(--accent) 0%, #a78bfa 50%, #f472b6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ─── Hero Section ─── */

.gallery-hero {
    padding: 4rem 0 3rem;
    text-align: center;
}

@media (min-width: 768px) {
    .gallery-hero {
        padding: 5rem 0 4rem;
    }
}

.gallery-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.gallery-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    background: var(--bg-card);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.gallery-hero-badge svg {
    width: 16px;
    height: 16px;
    color: var(--accent);
}

.gallery-hero h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.gallery-hero-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.gallery-hero-disclaimer {
    max-width: 620px;
    margin: 0 auto 2rem;
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.gallery-hero-disclaimer a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.gallery-hero-disclaimer a:hover {
    text-decoration: underline;
}

/* Stats */
.gallery-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 640px) {
    .gallery-stats {
        grid-template-columns: repeat(4, 1fr);
        max-width: none;
    }
}

.gallery-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-stat-value {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
}

@media (min-width: 768px) {
    .gallery-stat-value {
        font-size: 2.75rem;
    }
}

.gallery-stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 6px;
}

/* Hero Buttons */
.gallery-hero-btns {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

@media (min-width: 480px) {
    .gallery-hero-btns {
        flex-direction: row;
        justify-content: center;
    }
}

.gallery-hero-btns .btn svg {
    width: 16px;
    height: 16px;
}

/* ─── Section Styles ─── */

.gallery-section {
    padding: 3rem 0;
}

@media (min-width: 768px) {
    .gallery-section {
        padding: 4rem 0;
    }
}

.gallery-section-header {
    margin-bottom: 1.5rem;
}

.gallery-section-header.center {
    text-align: center;
}

.gallery-section-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

@media (min-width: 768px) {
    .gallery-section-title {
        font-size: 1.625rem;
    }
}

.gallery-section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9375rem;
}

/* ─── Tabs ─── */

.gallery-tabs {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.gallery-tab-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 0;
    font-family: inherit;
}

.gallery-tab-btn:hover {
    color: var(--text-secondary);
}

.gallery-tab-btn.active {
    color: var(--accent);
}

.gallery-tab-btn svg {
    width: 16px;
    height: 16px;
}

.gallery-tab-content {
    display: none;
}

.gallery-tab-content.active {
    display: block;
}

/* ─── Cards Grid ─── */

.gallery-grid {
    display: grid;
    gap: 1rem;
}

.gallery-grid-3 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .gallery-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.gallery-grid-4 {
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .gallery-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .gallery-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ─── Project Card ─── */

a.gallery-card,
a.gallery-ranked-item {
    text-decoration: none;
    color: inherit;
}

.gallery-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
}

.gallery-card:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
}

.gallery-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.625rem;
    gap: 8px;
}

.gallery-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
}

.gallery-card-badge {
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-input);
    padding: 3px 10px;
    border-radius: 9999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.gallery-card-desc {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
    flex-grow: 1;
    margin-bottom: 0.75rem;
}

.gallery-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
}

.gallery-card-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.gallery-card-stars svg {
    width: 14px;
    height: 14px;
    color: var(--yellow, #ffd93d);
}

.gallery-card-lang {
    font-size: 0.75rem;
    color: var(--text-muted);
    border: 1px solid var(--border-color);
    padding: 2px 8px;
    border-radius: 9999px;
}

/* ─── See All Button ─── */

.gallery-see-all {
    text-align: center;
    margin-top: 1.5rem;
}

.gallery-see-all .btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.gallery-see-all .btn svg {
    width: 16px;
    height: 16px;
}

/* ─── Capability Card ─── */

.gallery-capability {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: block;
    text-decoration: none;
    transition: border-color 0.2s, transform 0.2s;
    cursor: pointer;
}

.gallery-capability:hover {
    border-color: var(--border-light);
    transform: translateY(-3px);
    color: inherit;
}

.gallery-capability-icon {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.gallery-capability-icon svg {
    width: 1.25rem;
    height: 1.25rem;
}

.gallery-capability-icon.icon-purple { background: rgba(108, 92, 231, 0.15); color: var(--accent); }
.gallery-capability-icon.icon-green  { background: rgba(0, 214, 143, 0.15); color: var(--green); }
.gallery-capability-icon.icon-pink   { background: rgba(244, 114, 182, 0.15); color: #f472b6; }
.gallery-capability-icon.icon-blue   { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.gallery-capability-icon.icon-orange { background: rgba(249, 115, 22, 0.15); color: #f97316; }
.gallery-capability-icon.icon-teal   { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }

.gallery-capability h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.gallery-capability p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── Update Card ─── */

.gallery-update {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: background 0.15s;
}

.gallery-update:hover {
    background: var(--bg-card-hover);
}

.gallery-update-dot {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--green-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
}

.gallery-update-dot svg {
    width: 14px;
    height: 14px;
    color: var(--green);
}

.gallery-update-body {
    flex: 1;
    min-width: 0;
}

.gallery-update-title {
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.gallery-update-title span {
    color: var(--text-muted);
}

.gallery-update-title a {
    color: var(--accent);
    text-decoration: none;
}

.gallery-update-title a:hover {
    text-decoration: underline;
}

.gallery-update-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 3px;
    line-height: 1.5;
}

.gallery-update-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.gallery-updates-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.gallery-updates-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.gallery-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.gallery-view-all:hover {
    color: var(--text-primary);
}

.gallery-view-all svg {
    width: 14px;
    height: 14px;
}

/* ─── Audience Card ─── */

.gallery-audience {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s, transform 0.2s;
}

.gallery-audience:hover {
    border-color: var(--border-light);
    transform: translateY(-2px);
}

.gallery-audience h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.gallery-audience p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ─── CTA Section ─── */

.gallery-cta {
    text-align: center;
    padding: 3rem 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.gallery-cta-btns {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 1.25rem;
}

.gallery-cta-btns .btn svg {
    width: 16px;
    height: 16px;
}

/* ─── About Section ─── */

.gallery-about {
    max-width: 720px;
    margin: 0 auto;
}

.gallery-about-block {
    margin-bottom: 1.5rem;
}

.gallery-about-block:last-child {
    margin-bottom: 0;
}

.gallery-about-block h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.gallery-about-block p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ─── Type Filter Tabs (agents listing) ─── */

.gallery-type-tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.gallery-type-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.15s ease;
}

.gallery-type-tab:hover {
    border-color: var(--border-light);
    color: var(--text-primary);
}

.gallery-type-tab.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-type-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

.gallery-type-tab.active .gallery-type-count {
    opacity: 0.9;
}

/* ─── Empty State ─── */

.gallery-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-secondary);
    font-size: 1.0625rem;
}

/* ─── Result Count ─── */

.gallery-result-count {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8125rem;
    margin-top: 1.5rem;
}

/* ─── Ranked List (Trending) ─── */

.gallery-ranked-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.gallery-ranked-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.25rem;
    transition: border-color 0.2s;
}

.gallery-ranked-item:hover {
    border-color: var(--border-light);
}

.gallery-rank {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 2.5rem;
    text-align: center;
    flex-shrink: 0;
    padding-top: 2px;
}

.gallery-ranked-item:nth-child(1) .gallery-rank { color: #ffd93d; }
.gallery-ranked-item:nth-child(2) .gallery-rank { color: #c0c0c0; }
.gallery-ranked-item:nth-child(3) .gallery-rank { color: #cd7f32; }

.gallery-ranked-body {
    flex: 1;
    min-width: 0;
}

.gallery-ranked-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 0.5rem;
}

/* ─── Month Heading (Updates) ─── */

.gallery-month-heading {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 1rem 0 0.5rem;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0.25rem;
}

.gallery-month-heading:first-child {
    padding-top: 0;
}

/* ─── Animations ─── */

@keyframes galleryFadeIn {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-animate {
    opacity: 0;
}

.gallery-animate.visible {
    animation: galleryFadeIn 0.35s ease-out forwards;
}

/* Responsive helper */
@media (max-width: 639px) {
    .gallery-hide-mobile { display: none !important; }
    .gallery-show-mobile { display: block !important; }
}
@media (min-width: 640px) {
    .gallery-hide-mobile { display: inline-flex !important; }
    .gallery-show-mobile { display: none !important; }
}

/* ─── ClawHub: Search Bar ─── */

.gallery-search-bar {
    display: flex;
    max-width: 500px;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    overflow: hidden;
    background: var(--bg-card);
    transition: border-color 0.2s;
}

.gallery-search-bar:focus-within {
    border-color: var(--accent);
}

.gallery-search-bar input[type="text"] {
    flex: 1;
    padding: 10px 18px;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
}

.gallery-search-bar input[type="text"]::placeholder {
    color: var(--text-muted);
}

.gallery-search-bar button {
    padding: 10px 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.15s;
    display: flex;
    align-items: center;
}

.gallery-search-bar button:hover {
    color: var(--accent);
}

/* ─── ClawHub: Tag Chips ─── */

.gallery-tag-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-tag-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}

.gallery-tag-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.gallery-tag-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.gallery-tag-chip span {
    opacity: 0.6;
    font-size: 0.6875rem;
}

.gallery-tag-chip.active span {
    opacity: 0.85;
}

/* ─── ClawHub: Sort Bar ─── */

.gallery-sort-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    gap: 12px;
}

.gallery-sort-select {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.gallery-sort-select select {
    padding: 5px 8px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-family: inherit;
    cursor: pointer;
}

/* ─── ClawHub: Card Tags ─── */

.gallery-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 0.75rem;
}

.skill-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    color: var(--text-muted);
    background: var(--bg-input);
    white-space: nowrap;
}

.skill-emoji {
    margin-right: 4px;
}

/* ─── ClawHub: Pagination ─── */

.gallery-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.gallery-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    text-decoration: none;
    transition: all 0.15s;
}

.gallery-page-btn:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.gallery-page-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    pointer-events: none;
}

.gallery-page-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 36px;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ─── Public APIs: Auth Badges ─── */

.api-auth-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 9999px;
    font-size: 0.6875rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.api-auth-free {
    background: rgba(0, 214, 143, 0.12);
    color: var(--green);
}

.api-auth-key {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
}

.api-auth-oauth {
    background: rgba(249, 115, 22, 0.12);
    color: #f97316;
}

.api-auth-other {
    background: rgba(167, 139, 250, 0.12);
    color: #a78bfa;
}

/* ─── Component Detail Modal ─── */

.component-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 15, 0.85);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: componentFadeIn 0.2s ease-out;
}

@keyframes componentFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.component-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    max-width: 540px;
    width: 90%;
    padding: 32px;
    position: relative;
    animation: componentMessageIn 0.25s ease-out;
}

@keyframes componentMessageIn {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.component-modal-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.15s;
}

.component-modal-close:hover {
    color: var(--text-primary);
}

.component-modal .gallery-capability-icon {
    margin-bottom: 1rem;
}

.component-modal h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.component-modal-summary {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 12px;
}

.component-modal-detail {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.component-modal-cta {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.component-modal-cta .btn {
    text-align: center;
    justify-content: center;
}
