/* supremacy.market - Techno-Auction Minimalism */

:root {
    --bg-deep: #0a0a0a;
    --bg-mid: #151515;
    --grid-color: #2a2a2a;
    --gold: #e6d989;
    --platinum: #e8e8e8;
    --red: #8b2323;
    --cyan: #2dd4bf;
}

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

html {
    scroll-behavior: smooth;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background-color: var(--bg-deep);
    color: var(--platinum);
    overflow-x: hidden;
    line-height: 1.6;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--bg-mid);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--gold) 0%, var(--bg-deep) 100%);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #f0d899 0%, var(--bg-mid) 100%);
}

/* Section Base Styles */
.market-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(90deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-deep) 100%);
    overflow: hidden;
}

.market-section .content {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 2rem;
}

/* Market Open Section */
.market-open {
    background-color: var(--bg-deep);
    animation: openFade 1s ease-out 0.6s backwards;
}

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

.domain-frame {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
}

.vertical-frame {
    width: 40px;
    height: 200px;
    opacity: 0;
    animation: frameAppear 0.8s ease-out 0.8s forwards;
}

@keyframes frameAppear {
    from {
        opacity: 0;
        height: 0;
    }
    to {
        opacity: 1;
        height: 200px;
    }
}

.domain-title {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    font-size: clamp(2.2rem, 9vw, 7.5rem);
    letter-spacing: -0.01em;
    color: var(--platinum);
    opacity: 0;
    animation: titleTypewrite 3.5s ease-out 0.8s forwards;
}

@keyframes titleTypewrite {
    0% {
        opacity: 0;
        letter-spacing: 0.1em;
    }
    100% {
        opacity: 1;
        letter-spacing: -0.01em;
    }
}

.market-ticker {
    font-family: 'IBM Plex Mono', monospace;
    font-size: clamp(1rem, 2vw, 1.2rem);
    letter-spacing: 0.08em;
    color: var(--platinum);
    opacity: 0;
    animation: tickerPulse 2s ease-in-out 2.3s forwards infinite;
}

@keyframes tickerPulse {
    0%, 100% {
        opacity: 0.3;
        color: var(--gold);
    }
    50% {
        opacity: 1;
        color: #c9a961;
    }
}

/* Compartment Sections */
.compartment-section {
    background: linear-gradient(90deg, var(--bg-deep) 0%, var(--bg-mid) 50%, var(--bg-deep) 100%);
    height: 85vh;
    scroll-margin-top: 0;
}

.market-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.grid-lines {
    width: 100%;
    height: 100%;
    display: block;
}

.section-content {
    position: relative;
    z-index: 20;
    max-width: 800px;
    background: rgba(10, 10, 10, 0.85);
    backdrop-filter: blur(10px);
    padding: 3rem;
    border: 1px solid var(--grid-color);
    border-radius: 0;
}

.section-title {
    font-family: 'Roboto Mono', monospace;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.section-text {
    font-size: clamp(0.9rem, 1vw, 1rem);
    line-height: 1.8;
    color: var(--platinum);
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.ticker-data {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--grid-color);
}

.ticker-item {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.85rem;
    padding: 0.5rem 0.8rem;
    border-radius: 0;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.ticker-item.buy {
    color: var(--gold);
    background: rgba(230, 217, 137, 0.1);
    border-left: 2px solid var(--gold);
}

.ticker-item.sell {
    color: var(--red);
    background: rgba(139, 35, 35, 0.1);
    border-left: 2px solid var(--red);
}

.ticker-item.neutral {
    color: var(--cyan);
    background: rgba(45, 212, 191, 0.1);
    border-left: 2px solid var(--cyan);
}

/* Market Close Section */
.market-close {
    height: 100vh;
    background: radial-gradient(circle at center, var(--bg-mid) 0%, var(--bg-deep) 100%);
    position: relative;
}

.trading-post {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 15;
}

.trading-post-core {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, var(--gold) 0%, #c9a961 50%, var(--bg-mid) 100%);
    box-shadow: 0 0 40px 8px var(--gold), 0 0 80px 15px rgba(230, 217, 137, 0.3);
    animation: tradingPostGlow 3s ease-in-out infinite;
}

@keyframes tradingPostGlow {
    0%, 100% {
        box-shadow: 0 0 40px 8px var(--gold), 0 0 80px 15px rgba(230, 217, 137, 0.3);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 60px 12px var(--gold), 0 0 120px 20px rgba(230, 217, 137, 0.4);
        transform: scale(1.15);
    }
}

.final-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    border: 1px solid var(--grid-color);
    background: rgba(21, 21, 21, 0.6);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--platinum);
    opacity: 0.7;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.stat-value {
    font-family: 'Roboto Mono', monospace;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--gold);
}

/* Pulsing Activity Nodes */
.activity-node {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--cyan);
    opacity: 0.6;
    animation: nodePulse 1.5s ease-in-out infinite;
}

.activity-node.fast {
    animation: nodePulse 0.8s ease-in-out infinite;
}

.activity-node.slow {
    animation: nodePulse 2.5s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        opacity: 0.4;
    }
    50% {
        transform: scale(1.5);
        opacity: 0.8;
    }
}

/* Order Flow Lines */
.order-flow {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--cyan), transparent);
    opacity: 0.4;
    width: 60%;
    left: 0;
}

.order-flow.buy {
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.order-flow.sell {
    background: linear-gradient(90deg, transparent, var(--red), transparent);
}

.order-flow.animate-right {
    animation: flowRight 4s linear infinite;
}

@keyframes flowRight {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(100vw);
    }
}

/* Price Chart Lines (subtle background) */
.price-line {
    position: absolute;
    stroke-width: 1px;
    opacity: 0.08;
    pointer-events: none;
}

.price-line.bull {
    stroke: var(--gold);
}

.price-line.bear {
    stroke: var(--red);
}

/* Responsive Design */
@media (max-width: 768px) {
    .market-section {
        height: auto;
        min-height: 100vh;
    }

    .compartment-section {
        height: 65vh;
    }

    .domain-frame {
        gap: 1rem;
    }

    .vertical-frame {
        width: 20px;
        height: 120px;
    }

    .section-content {
        max-width: 100%;
        padding: 1.5rem;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .section-text {
        font-size: 0.9rem;
    }

    .ticker-data {
        gap: 1rem;
        flex-direction: column;
    }

    .ticker-item {
        display: block;
    }

    .final-stats {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Print Styles */
@media print {
    .market-grid,
    .activity-node,
    .order-flow,
    .price-line {
        display: none;
    }
}

/* Accessibility & High Contrast */
@media (prefers-contrast: more) {
    :root {
        --platinum: #ffffff;
        --gold: #ffff00;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
