/* ════════════════════════════════════════════════
   Jewel Pages — Shared Design System v3.0
   Unified styles for all browse/listing pages
   ════════════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
    --jp-dark: #020617;
    --jp-glass: rgba(15, 23, 42, 0.7);
    --jp-border: rgba(255, 255, 255, 0.08);
    --jp-text: #e2e8f0;
    --jp-text-muted: #94a3b8;
    --jp-text-dim: #64748b;
    --jp-gold: #fbbf24;
    --jp-radius-card: 28px;
    --jp-radius-sm: 12px;
    --jp-radius-pill: 100px;
    --jp-transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

/* ── Page Base ── */
[class*="jewel-"][class*="-page"],
.dark-theme {
    background: var(--jp-dark) !important;
    font-family: 'IBM Plex Sans Arabic', 'Cairo', sans-serif !important;
    overflow-x: hidden;
    color: var(--jp-text);
}

/* ── Neural Canvas ── */
#jewel-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    opacity: 0.35;
    pointer-events: none;
}

/* ── Hero Section ── */
.jewel-hero,
.opportunities-hero {
    padding: 8rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    width: 100%;
}

.jewel-hero {
    background: radial-gradient(circle at 50% 120%, var(--hero-glow, rgba(16, 185, 129, 0.12)), transparent 75%);
}

.jewel-title,
.opportunities-hero h1 {
    font-size: clamp(2.8rem, 8vw, 5.5rem);
    font-weight: 700;
    text-align: center !important;
    letter-spacing: -1px;
    background: linear-gradient(135deg, #fff 40%, rgba(255, 255, 255, 0.5) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 auto 0.5rem;
    width: 100%;
    animation: heroFadeIn 0.8s ease-out;
}

.jewel-subtitle,
.opportunities-hero p {
    color: var(--jp-text-muted);
    font-size: 1.25rem;
    font-weight: 500;
    max-width: 800px;
    margin: 1.5rem auto 0;
    line-height: 1.7;
    text-align: center;
    animation: heroFadeIn 1s ease-out 0.2s both;
}

@keyframes heroFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Hero Badge ── */
.jewel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.8rem;
    background: linear-gradient(135deg, rgba(var(--badge-rgb, 16, 185, 129), 0.15), rgba(var(--badge-rgb, 16, 185, 129), 0.05));
    border: 1px solid rgba(var(--badge-rgb, 16, 185, 129), 0.4);
    border-radius: var(--jp-radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--badge-color, #10b981);
    margin: 0 auto 1.5rem;
    backdrop-filter: blur(10px);
    animation: badgeSlide 0.6s ease-out;
}

@keyframes badgeSlide {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Identity Line ── */
.jewel-identity-line {
    width: 100%;
    max-width: 400px;
    height: 1px;
    background: linear-gradient(to left, transparent, var(--accent-color, #10b981), transparent);
    margin: 2rem auto;
    position: relative;
    animation: lineReveal 1.2s ease-out 0.4s both;
}

.jewel-identity-line::after {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--jp-dark);
    padding: 0 1.5rem;
    font-size: 0.65rem;
    font-weight: 900;
    color: var(--accent-color, #10b981);
    letter-spacing: 4px;
}

@keyframes lineReveal {
    from {
        opacity: 0;
        width: 0;
    }

    to {
        opacity: 1;
        width: 100%;
        max-width: 400px;
    }
}

/* ── Hero Stats Cards ── */
.hero-stats {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2.5rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.hero-stat {
    text-align: center;
    padding: 1rem 2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--jp-border);
    border-radius: 16px;
    transition: var(--jp-transition);
    animation: statPop 0.6s ease-out both;
    min-width: 120px;
}

.hero-stat:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.hero-stat:nth-child(1) {
    animation-delay: 0.5s;
}

.hero-stat:nth-child(2) {
    animation-delay: 0.65s;
}

.hero-stat:nth-child(3) {
    animation-delay: 0.8s;
}

@keyframes statPop {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.hero-stat-value {
    font-size: 2rem;
    font-weight: 900;
    font-family: 'Inter', sans-serif;
    color: white;
}

.hero-stat-label {
    font-size: 0.85rem;
    color: var(--jp-text-dim);
    font-weight: 600;
    margin-top: 0.25rem;
}

/* ── Control Deck (Sticky Filters) ── */
.control-deck {
    position: sticky;
    top: 80px;
    z-index: 100;
    background: rgba(2, 6, 23, 0.88);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    border-bottom: 1px solid var(--jp-border);
    padding: 1rem 0;
    margin-bottom: 2rem;
    transition: box-shadow 0.3s;
}

.deck-container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    gap: 1.2rem;
    overflow-x: auto;
    padding: 0 2rem;
    scrollbar-width: none;
}

.deck-container::-webkit-scrollbar {
    display: none;
}

/* ── Filter Chips ── */
.deck-chip,
.category-chip {
    padding: 0.75rem 1.6rem;
    background: var(--jp-glass);
    border: 1px solid var(--jp-border);
    border-radius: var(--jp-radius-pill);
    color: var(--jp-text-dim);
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
    transition: var(--jp-transition);
    display: flex;
    align-items: center;
    gap: 0.6rem;
    cursor: pointer;
}

.deck-chip:hover,
.deck-chip.active,
.category-chip:hover,
.category-chip.active {
    background: rgba(var(--chip-rgb, 16, 185, 129), 0.12);
    border-color: var(--chip-color, var(--accent-color, #10b981));
    color: #fff;
    box-shadow: 0 0 20px rgba(var(--chip-rgb, 16, 185, 129), 0.2);
    transform: translateY(-2px);
}

/* ── Search Console ── */
.search-console {
    max-width: 900px;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.console-box {
    background: var(--jp-glass);
    border: 1px solid var(--jp-border);
    border-radius: 25px;
    padding: 0.6rem;
    display: flex;
    gap: 0.6rem;
    transition: border-color 0.3s;
}

.console-box:focus-within {
    border-color: var(--accent-color, #10b981);
    box-shadow: 0 0 25px rgba(var(--chip-rgb, 16, 185, 129), 0.12);
}

.console-box input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    padding: 0 1.5rem;
    font-size: 1rem;
}

.console-box input:focus {
    outline: none;
}

.console-box input::placeholder {
    color: var(--jp-text-dim);
}

.btn-trigger {
    background: var(--accent-color, #10b981);
    color: #fff;
    border: none;
    padding: 0 2.5rem;
    border-radius: 18px;
    font-weight: 900;
    cursor: pointer;
    transition: 0.3s;
}

.btn-trigger:hover {
    filter: brightness(1.15);
    transform: translateY(-2px);
}

/* ── Advanced Filters Bar ── */
.advanced-filters {
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 1.25rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--jp-border);
    border-radius: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filter-label {
    color: var(--jp-text-dim);
    font-size: 0.85rem;
    font-weight: 600;
}

.filter-input,
.filter-select {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--jp-radius-sm);
    color: white;
    font-size: 0.85rem;
    transition: border-color 0.3s;
}

.filter-input:focus,
.filter-select:focus {
    outline: none;
    border-color: var(--accent-color, #10b981);
}

.filter-select {
    cursor: pointer;
    background: #1e293b;
}

.filter-select option {
    background: #1e293b;
    color: white;
}

/* ── Cards Grid ── */
.vault-grid,
.jewel-grid,
.opportunities-grid {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    gap: 2rem;
    padding: 0 2rem 4rem;
}

.vault-grid {
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 3rem;
}

.jewel-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.opportunities-grid {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

/* ── Glass Card Base ── */
.jewel-card,
.project-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.01));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--jp-border);
    border-radius: var(--jp-radius-card);
    padding: 1.8rem;
    position: relative;
    transition: var(--jp-transition);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: cardReveal 0.5s ease-out both;
}

/* Stagger entrance for cards */
.jewel-card:nth-child(1),
.project-card:nth-child(1) {
    animation-delay: 0.1s;
}

.jewel-card:nth-child(2),
.project-card:nth-child(2) {
    animation-delay: 0.15s;
}

.jewel-card:nth-child(3),
.project-card:nth-child(3) {
    animation-delay: 0.2s;
}

.jewel-card:nth-child(4),
.project-card:nth-child(4) {
    animation-delay: 0.25s;
}

.jewel-card:nth-child(5),
.project-card:nth-child(5) {
    animation-delay: 0.3s;
}

.jewel-card:nth-child(6),
.project-card:nth-child(6) {
    animation-delay: 0.35s;
}

.jewel-card:nth-child(n+7),
.project-card:nth-child(n+7) {
    animation-delay: 0.4s;
}

@keyframes cardReveal {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.jewel-card:hover,
.project-card:hover {
    transform: translateY(-10px) scale(1.01);
    border-color: rgba(var(--card-hover-rgb, 16, 185, 129), 0.35);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.4),
        0 0 25px rgba(var(--card-hover-rgb, 16, 185, 129), 0.08);
}

/* Card top gradient reveal on hover */
.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color, #10b981), var(--accent-secondary, #3b82f6), var(--accent-color, #10b981));
    opacity: 0;
    transition: opacity 0.3s;
}

.project-card:hover::before {
    opacity: 1;
}

/* ── Card Action Buttons ── */
.card-action {
    margin-top: auto;
}

.btn-action,
.btn-view {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 1rem;
    border-radius: var(--jp-radius-sm);
    font-weight: 800;
    font-size: 0.95rem;
    text-decoration: none;
    transition: var(--jp-transition);
    cursor: pointer;
    border: none;
}

.btn-view {
    background: rgba(var(--card-hover-rgb, 16, 185, 129), 0.1);
    border: 1px solid rgba(var(--card-hover-rgb, 16, 185, 129), 0.25);
    color: var(--accent-color, #10b981);
}

.btn-view:hover {
    background: var(--accent-color, #10b981);
    color: white;
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(var(--card-hover-rgb, 16, 185, 129), 0.3);
}

.btn-view:hover i {
    transform: translateX(-5px);
}

.btn-view i {
    transition: transform 0.3s ease;
}

.btn-engage {
    background: #fff;
    color: #000;
}

.btn-inspect {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--jp-border);
}

/* ── Stats Bar ── */
.stats-bar,
.logic-horizon {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 0.6rem 1.2rem;
    margin-bottom: 1.2rem;
    position: relative;
    overflow: hidden;
}

.logic-horizon::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(var(--card-hover-rgb, 16, 185, 129), 0.05), transparent);
}

.stat-item,
.horizon-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--jp-text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
}

.stat-value,
.horizon-val {
    color: white;
    font-weight: 800;
    font-family: 'Inter', sans-serif;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--jp-text-dim);
    margin-top: 0.2rem;
}

.horizon-separator {
    width: 1px;
    height: 15px;
    background: rgba(255, 255, 255, 0.1);
}

/* ── Featured / Verified Badges ── */
.verify-icon {
    color: #3b82f6;
    font-size: 0.95rem;
}

.featured-badge,
.badge-featured {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #000;
    padding: 0.35rem 1rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.2);
}

.project-card.featured {
    border-color: rgba(251, 191, 36, 0.4);
    background: linear-gradient(145deg, rgba(251, 191, 36, 0.08), rgba(2, 6, 23, 0.8));
    animation: jewelPulse 4s infinite alternate;
}

.project-card.featured::before {
    background: linear-gradient(90deg, #fbbf24, #f59e0b, #ef4444);
    opacity: 1;
}

@keyframes jewelPulse {
    0% {
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 0 rgba(251, 191, 36, 0);
        border-color: rgba(251, 191, 36, 0.3);
    }

    100% {
        box-shadow: 0 15px 45px rgba(0, 0, 0, 0.5), 0 0 20px rgba(251, 191, 36, 0.12);
        border-color: rgba(251, 191, 36, 0.6);
    }
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 2rem 0 4rem;
}

.page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 45px;
    height: 45px;
    padding: 0 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--jp-text-muted);
    border-radius: var(--jp-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--jp-transition);
}

.page-link:hover {
    background: rgba(var(--card-hover-rgb, 16, 185, 129), 0.15);
    border-color: rgba(var(--card-hover-rgb, 16, 185, 129), 0.4);
    color: var(--accent-color, #10b981);
    transform: translateY(-2px);
}

.page-link.active {
    background: var(--accent-color, #10b981);
    border-color: transparent;
    color: white;
    box-shadow: 0 10px 20px rgba(var(--card-hover-rgb, 16, 185, 129), 0.3);
}

.page-link.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ── Empty State ── */
.empty-state {
    text-align: center;
    padding: 6rem 2rem;
    grid-column: 1 / -1;
    background: var(--jp-glass);
    border-radius: 50px;
    border: 1px dashed var(--jp-border);
}

.empty-state h2,
.empty-state h3 {
    color: white;
    font-weight: 900;
    margin-bottom: 0.75rem;
}

.empty-state p {
    color: var(--jp-text-dim);
    max-width: 400px;
    margin: 0 auto;
}

/* ── Galaxy Buttons ── */
.btn-galaxy {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--accent-color, #10b981), var(--accent-secondary, #059669));
    color: white !important;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--jp-transition);
    box-shadow: 0 10px 25px rgba(var(--card-hover-rgb, 16, 185, 129), 0.3);
}

.btn-galaxy:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(var(--card-hover-rgb, 16, 185, 129), 0.4);
}

.btn-galaxy-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2rem;
    background: rgba(var(--card-hover-rgb, 16, 185, 129), 0.1);
    border: 2px solid rgba(var(--card-hover-rgb, 16, 185, 129), 0.4);
    color: var(--accent-color, #10b981) !important;
    border-radius: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: var(--jp-transition);
}

.btn-galaxy-outline:hover {
    background: rgba(var(--card-hover-rgb, 16, 185, 129), 0.2);
    border-color: var(--accent-color, #10b981);
    transform: translateY(-3px);
}

/* ── Hero Actions ── */
.hero-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin: 1.5rem auto 0;
    width: 100%;
    animation: heroFadeIn 1s ease-out 0.6s both;
}

/* ── Alert ── */
.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
    padding: 1rem 1.5rem;
    border-radius: var(--jp-radius-sm);
    margin: 2rem auto;
    max-width: 800px;
    text-align: center;
}

/* ── Shimmer Loading Effect ── */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.05), transparent);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

/* ── Responsive ── */
@media (max-width: 768px) {

    .vault-grid,
    .jewel-grid,
    .opportunities-grid {
        grid-template-columns: 1fr;
        padding: 0 1rem 3rem;
    }

    .jewel-hero,
    .opportunities-hero {
        padding: 4rem 1rem 3rem;
    }

    .jewel-title,
    .opportunities-hero h1 {
        font-size: 2.5rem;
    }

    .hero-stats {
        gap: 1rem;
    }

    .hero-stat {
        padding: 0.75rem 1.25rem;
        min-width: 100px;
    }

    .control-deck {
        top: 60px;
    }

    .advanced-filters {
        flex-direction: column;
        padding: 1rem;
    }

    .search-form {
        flex-direction: column;
    }

    .search-input-wrapper,
    .filter-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .hero-stats {
        flex-direction: column;
        align-items: center;
    }

    .hero-stat {
        width: 100%;
        max-width: 250px;
    }
}

/* ── AOS Fix ── */
[data-aos] {
    pointer-events: none;
}

.aos-animate {
    pointer-events: auto;
}