/* ===================================
   SHARTCART -- Dark Forge x Pitviper
   AI Tools & Research Marketplace
   =================================== */

:root {
    /* Forge palette */
    --forge-amber: #a67c1a;
    --forge-amber-bright: #d4a830;
    --forge-ember: #8b4a10;
    --dark-bg: #050507;
    --dark-bg-alt: #0a0a0f;
    --dark-card: #0a0a10;
    --dark-card-hover: #0e0e18;
    --dark-border: #252530;

    /* Pitviper neon accents */
    --neon-cyan: #00f0ff;
    --neon-cyan-dim: #007a82;
    --neon-magenta: #ff0066;
    --neon-green: #39ff14;

    /* Text */
    --text-primary: #d0d0d0;
    --text-secondary: #a0a0a0;
    --text-dim: #707070;

    /* Fonts */
    --font-display: 'Cinzel', Georgia, 'Times New Roman', serif;
    --font-mono: 'Courier New', monospace;

}

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

::selection {
    background: rgba(0, 240, 255, 0.2);
    color: var(--text-primary);
}

:focus-visible {
    outline: 1px solid var(--neon-cyan);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--dark-card);
    color: var(--neon-cyan);
    padding: 0.8rem 1.5rem;
    border: 1px solid rgba(0, 240, 255, 0.4);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 2px;
    text-decoration: none;
    text-transform: uppercase;
    z-index: 10000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 10px;
}

body {
    font-family: var(--font-mono);
    background-color: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body.loading header,
body.loading .system-message,
body.loading .filter-section,
body.loading .marketplace-section {
    opacity: 0;
    transition: opacity 0.6s ease-out;
}

body.loaded header,
body.loaded .system-message,
body.loaded .filter-section,
body.loaded .marketplace-section {
    opacity: 1;
}

/* Noise overlay */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.5;
}

/* Vignette */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 50%, rgba(0,0,0,0.35) 80%, rgba(0,0,0,0.6) 100%);
    pointer-events: none;
    z-index: 9998;
}

/* ===================================
   THREE.JS CANVAS
   =================================== */

#three-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

#three-canvas canvas {
    display: block;
    width: 100%;
    height: 100%;
}

/* CSS grid fallback */
.grid-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(0, 240, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 240, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
}

.webgl-active .grid-background {
    display: none;
}

/* Scan line */
.scan-line {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.12), transparent);
    z-index: 9997;
    pointer-events: none;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% { top: -2px; }
    100% { top: 100vh; }
}

/* ===================================
   LAYOUT
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ===================================
   HEADER
   =================================== */

header {
    text-align: center;
    padding: 3rem 0 1.5rem;
    position: relative;
    z-index: 10;
}

.logo {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--forge-amber);
    letter-spacing: 0.15em;
    text-shadow:
        0 0 20px rgba(166, 124, 26, 0.4),
        0 0 60px rgba(166, 124, 26, 0.15),
        0 0 120px rgba(0, 240, 255, 0.05);
    margin-bottom: 0.3rem;
    line-height: 1;
}

.logo a {
    color: inherit;
    text-decoration: none;
}

.tagline {
    font-family: var(--font-mono);
    font-size: clamp(0.6rem, 1.2vw, 0.75rem);
    color: var(--text-dim);
    letter-spacing: 0.3em;
    text-transform: uppercase;
}

/* ===================================
   SYSTEM MESSAGE BAR
   =================================== */

.system-message {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.7rem;
    color: var(--neon-cyan);
    letter-spacing: 0.2em;
    border-top: 1px solid rgba(0, 240, 255, 0.12);
    border-bottom: 1px solid rgba(0, 240, 255, 0.12);
    position: relative;
    z-index: 10;
}

.blinking-cursor {
    animation: blink 1s step-end infinite;
    color: var(--neon-cyan);
}

@keyframes blink {
    50% { opacity: 0; }
}

/* ===================================
   SEARCH & FILTERS
   =================================== */

.filter-section {
    padding: 1.5rem 0;
    position: relative;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    max-width: 500px;
    margin: 0 auto 1rem;
    border: 1px solid var(--dark-border);
    background: var(--dark-card);
    padding: 0.5rem 1rem;
    transition: border-color 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--neon-cyan);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.08);
}

.search-icon {
    color: var(--text-dim);
    margin-right: 0.6rem;
    font-size: 0.8rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    outline: none;
}

.search-input::placeholder {
    color: var(--text-dim);
    letter-spacing: 0.15em;
}

/* ===================================
   SECTION HEADERS
   =================================== */

.marketplace-section {
    position: relative;
    z-index: 10;
    padding-bottom: 2rem;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.8rem;
    padding: 1.5rem 0 0.5rem;
}

.section-header-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--dark-border), transparent);
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    letter-spacing: 0.2em;
    text-align: center;
    white-space: nowrap;
}

.neon-title {
    color: var(--neon-cyan);
    text-shadow:
        0 0 10px rgba(0, 240, 255, 0.3),
        0 0 40px rgba(0, 240, 255, 0.08);
}

.forge-title {
    color: var(--forge-amber);
    text-shadow:
        0 0 10px rgba(166, 124, 26, 0.3),
        0 0 40px rgba(166, 124, 26, 0.08);
}

.section-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-align: center;
    max-width: 650px;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}

/* ===================================
   AI TOOL CARDS (Featured / Premium)
   =================================== */

.ai-tools-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.ai-tool-card {
    background: var(--dark-card);
    border: 1px solid rgba(0, 240, 255, 0.15);
    padding: 2rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ai-tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-cyan), var(--neon-magenta), var(--neon-green));
    opacity: 0.8;
}

.ai-tool-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.02) 0%, transparent 50%, rgba(255, 0, 102, 0.01) 100%);
    pointer-events: none;
}

.ai-tool-card:hover {
    border-color: rgba(0, 240, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 30px rgba(0, 240, 255, 0.06);
}

.ai-tool-card.featured {
    border-color: rgba(0, 240, 255, 0.25);
}

.tool-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.tool-name {
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    font-weight: 700;
    color: var(--neon-cyan);
    letter-spacing: 0.1em;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.2);
}

.tool-badges {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}

.tool-badge {
    font-size: 0.55rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    padding: 0.25rem 0.6rem;
    border: 1px solid;
    white-space: nowrap;
}

.badge-featured {
    color: var(--neon-magenta);
    border-color: rgba(255, 0, 102, 0.4);
    background: rgba(255, 0, 102, 0.06);
}

.badge-free {
    color: var(--neon-green);
    border-color: rgba(57, 255, 20, 0.4);
    background: rgba(57, 255, 20, 0.06);
}

.badge-category {
    color: var(--neon-cyan-dim);
    border-color: rgba(0, 240, 255, 0.2);
}

.tool-description {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.tool-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1.2rem;
    position: relative;
    z-index: 1;
}

.tool-feature {
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.5rem 0.8rem;
    border-left: 2px solid rgba(0, 240, 255, 0.3);
    background: rgba(0, 240, 255, 0.02);
}

.tool-feature-label {
    color: var(--neon-cyan);
    font-size: 0.6rem;
    letter-spacing: 0.15em;
    display: block;
    margin-bottom: 0.2rem;
}

.tool-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.tool-meta-tag {
    font-size: 0.6rem;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    padding: 0.2rem 0.5rem;
    border: 1px solid rgba(37, 37, 48, 0.8);
    background: rgba(5, 5, 7, 0.5);
}

.tool-meta-tag .meta-label {
    color: var(--neon-cyan-dim);
    margin-right: 0.3rem;
}

.tool-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.tool-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border: 1px solid;
    transition: all 0.2s ease;
}

.tool-cta-primary {
    color: var(--neon-cyan);
    border-color: rgba(0, 240, 255, 0.4);
    background: rgba(0, 240, 255, 0.06);
}

.tool-cta-primary:hover {
    background: rgba(0, 240, 255, 0.12);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.1);
}

.tool-cta-secondary {
    color: var(--text-secondary);
    border-color: var(--dark-border);
    background: transparent;
}

.tool-cta-secondary:hover {
    color: var(--text-primary);
    border-color: var(--text-dim);
}

.tool-cta .cta-arrow {
    transition: transform 0.2s ease;
}

.tool-cta:hover .cta-arrow {
    transform: translateX(3px);
}

/* Compact AI tool cards (non-featured) */
.ai-tool-card-compact {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    padding: 1.2rem 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
}

.ai-tool-card-compact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.ai-tool-card-compact:hover {
    border-color: rgba(0, 240, 255, 0.25);
    transform: translateY(-1px);
}

.ai-tool-card-compact:hover::before {
    opacity: 1;
}

.compact-tool-name {
    font-family: var(--font-display);
    font-size: 0.95rem;
    color: var(--neon-cyan);
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
}

.compact-tool-desc {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.6rem;
}

/* ===================================
   NO RESULTS
   =================================== */

.no-results {
    text-align: center;
    padding: 3rem 0;
    position: relative;
    z-index: 10;
}

.no-results h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* ===================================
   INFO SECTION
   =================================== */

.info-section {
    padding: 2rem 0;
    position: relative;
    z-index: 10;
}

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

.info-card {
    background: var(--dark-card);
    border: 1px solid var(--dark-border);
    padding: 1.2rem;
}

.info-card h3 {
    font-family: var(--font-display);
    font-size: 0.8rem;
    color: var(--forge-amber);
    letter-spacing: 0.15em;
    margin-bottom: 0.5rem;
}

.info-card p {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===================================
   FOOTER
   =================================== */

footer {
    text-align: center;
    padding: 2rem 0;
    border-top: 1px solid var(--dark-border);
    position: relative;
    z-index: 10;
}

footer p {
    font-family: var(--font-display);
    font-size: 0.7rem;
    color: var(--text-dim);
    letter-spacing: 0.15em;
}

.footer-note {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: var(--text-dim);
    margin-top: 0.8rem;
    line-height: 1.6;
}

.footer-links {
    margin-top: 0.8rem;
}

.footer-links a {
    font-family: var(--font-mono);
    font-size: 0.65rem;
    color: var(--neon-cyan);
    text-decoration: none;
    letter-spacing: 0.1em;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.3);
}

/* ===================================
   RESPONSIVE
   =================================== */

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

    .tool-features {
        grid-template-columns: 1fr;
    }

    header {
        padding: 2rem 0 1rem;
    }

    .ai-tool-card {
        padding: 1.2rem;
    }

    .tool-card-top {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .logo {
        font-size: 2rem;
    }

    .tagline {
        font-size: 0.5rem;
    }

    .section-header {
        gap: 0.5rem;
    }

    .section-title {
        font-size: 0.9rem;
        letter-spacing: 0.1em;
    }
}
