/* Serein OS - Lain Color Palette */

@font-face {
    font-family: 'Coolvetica';
    src: url('/fonts/Coolvetica Rg.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Coolvetica';
    src: url('/fonts/Coolvetica Rg It.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

@font-face {
    font-family: 'Coolvetica';
    src: url('/fonts/Coolvetica Hv Comp.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'Coolvetica Condensed';
    src: url('/fonts/Coolvetica Rg Cond.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Coolvetica Compressed';
    src: url('/fonts/Coolvetica Rg Cram.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    /* Primary Palette */
    --primary-violet: #6A5FAE;
    --deep-violet: #3E3566;
    --muted-lilac: #8A84C2;
    --pale-crt-blue: #A4B6D9;
    --off-black-crt: #0C0C12;
    --warm-gray: #C8C8D0;
    --signal-blue: #6377B5;
    --soft-static-white: #F1F1F7;
    
    /* Secondary / Atmospheric */
    --ghost-pink: #D9C4E3;
    --neon-less-blue: #4D5D8C;
    --pale-beige: #E9E4DA;
    --dead-orange: #C39B6A;
    --dither-gray: #7A7A7A;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Coolvetica', 'Courier New', 'Courier', monospace;
    background-color: var(--off-black-crt);
    background-image: 
        linear-gradient(0deg, transparent 24%, rgba(255, 255, 255, .02) 25%, rgba(255, 255, 255, .02) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .02) 75%, rgba(255, 255, 255, .02) 76%, transparent 77%, transparent),
        linear-gradient(90deg, transparent 24%, rgba(255, 255, 255, .02) 25%, rgba(255, 255, 255, .02) 26%, transparent 27%, transparent 74%, rgba(255, 255, 255, .02) 75%, rgba(255, 255, 255, .02) 76%, transparent 77%, transparent);
    background-size: 50px 50px;
    color: var(--soft-static-white);
    line-height: 1.6;
    min-height: 100vh;
}

/* CRT Scanlines */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 9999;
}

/* Navigation */
nav {
    background: var(--deep-violet);
    border-bottom: 2px solid var(--muted-lilac);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--soft-static-white);
    text-decoration: none;
    letter-spacing: 2px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--warm-gray);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--soft-static-white);
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Hero Section */
.hero-section {
    background-image: url('/static/serein main background.gif'), linear-gradient(135deg, rgba(62, 53, 102, 0.85) 0%, rgba(106, 95, 174, 0.85) 100%);
    background-repeat: repeat;
    background-position: center;
    background-size: auto;
    background-blend-mode: overlay;
    padding: 4rem 2rem;
    text-align: center;
    position: relative;
}

.status-bars {
    max-width: 1200px;
    margin: 0 auto 3rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.status-bar {
    background: rgba(12, 12, 18, 0.7);
    border: 2px solid var(--muted-lilac);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.status-label {
    font-size: 0.8rem;
    font-weight: bold;
    white-space: nowrap;
}

.status-progress {
    flex: 1;
    height: 20px;
    background: var(--off-black-crt);
    border: 1px solid var(--warm-gray);
    position: relative;
    overflow: hidden;
}

.status-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--muted-lilac), var(--ghost-pink));
    transition: width 0.3s;
}

.status-value {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--ghost-pink);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero-ascii {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.hero-title {
    font-size: 4rem;
    font-weight: bold;
    color: var(--soft-static-white);
    letter-spacing: 0.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 0 0 20px rgba(138, 132, 194, 0.5);
}

.hero-subtitle {
    font-size: 1.3rem;
    color: var(--pale-crt-blue);
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.hero-description {
    font-size: 1rem;
    color: var(--warm-gray);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary {
    padding: 1rem 2rem;
    font-family: 'Coolvetica', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    text-decoration: none;
    border: 2px solid;
    cursor: pointer;
    transition: all 0.3s;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    border-color: var(--muted-lilac);
}

.btn-primary:hover {
    background: var(--ghost-pink);
    border-color: var(--ghost-pink);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(138, 132, 194, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--soft-static-white);
    border-color: var(--soft-static-white);
}

.btn-secondary:hover {
    background: var(--soft-static-white);
    color: var(--deep-violet);
}

/* Section Headers */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3rem 0 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--muted-lilac);
}

.section-header h2 {
    font-size: 1.5rem;
    color: var(--soft-static-white);
    letter-spacing: 2px;
}

.view-all {
    color: var(--muted-lilac);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
}

.view-all:hover {
    color: var(--ghost-pink);
}

/* Market Preview Grid */
.market-preview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.market-preview-card {
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    color: var(--soft-static-white);
    display: block;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.market-preview-card:hover {
    background: var(--primary-violet);
    border-color: var(--ghost-pink);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(138, 132, 194, 0.3);
}

.preview-question {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.preview-volume {
    font-size: 0.8rem;
    color: var(--pale-crt-blue);
    margin-bottom: 0.75rem;
}

.preview-odds {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
}

.preview-odds div {
    flex: 1;
    padding: 0.5rem;
    background: rgba(12, 12, 18, 0.5);
    text-align: center;
    border: 1px solid var(--warm-gray);
}

.preview-ai {
    background: rgba(12, 12, 18, 0.3);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.8rem;
    line-height: 1.5;
}

.ai-label {
    color: var(--ghost-pink);
    font-weight: bold;
    display: block;
    margin-bottom: 0.25rem;
}

.ai-text {
    color: var(--warm-gray);
}

.preview-confidence {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
}

.confidence-label {
    color: var(--pale-crt-blue);
}

.confidence-value {
    color: var(--ghost-pink);
    font-weight: bold;
}

/* Directives Grid */
.directives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.directive-card {
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    padding: 2rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.directive-card:hover {
    border-color: var(--ghost-pink);
    transform: translateY(-3px);
}

.directive-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--muted-lilac);
    margin-bottom: 0.5rem;
}

.directive-title {
    font-size: 1.1rem;
    color: var(--soft-static-white);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.directive-text {
    font-size: 0.85rem;
    color: var(--warm-gray);
    line-height: 1.6;
}

/* System Status */
.system-status {
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    padding: 2rem;
    margin: 3rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.system-status h2 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(12, 12, 18, 0.5);
    border: 1px solid var(--warm-gray);
}

.status-module {
    font-weight: bold;
    font-size: 0.9rem;
}

.status-online {
    color: var(--ghost-pink);
    font-weight: bold;
}

.system-info {
    padding-top: 1rem;
    border-top: 1px solid var(--warm-gray);
    font-size: 0.85rem;
    color: var(--pale-crt-blue);
}

.system-info p {
    margin: 0.25rem 0;
}

/* Footer */
.footer {
    background: var(--deep-violet);
    padding: 2rem;
    text-align: center;
    margin-top: 4rem;
    border-top: 2px solid var(--muted-lilac);
}

.footer p {
    color: var(--warm-gray);
    font-size: 0.85rem;
    margin: 0.5rem 0;
    line-height: 1.6;
}

/* Page Header */
.page-header {
    text-align: center;
    margin: 2rem 0 3rem;
}

.page-title {
    font-size: 2.5rem;
    color: var(--soft-static-white);
    letter-spacing: 3px;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    font-size: 1rem;
    color: var(--pale-crt-blue);
    letter-spacing: 1px;
}

/* Enhanced Market Grid */
.market-grid-enhanced {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 2rem;
}

.market-card-enhanced {
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.market-card-enhanced:hover {
    border-color: var(--ghost-pink);
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(138, 132, 194, 0.4);
}

.market-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.market-question-full {
    flex: 1;
    font-weight: bold;
    font-size: 1.1rem;
    line-height: 1.4;
    color: var(--soft-static-white);
}

.market-volume-badge {
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: bold;
    white-space: nowrap;
}

.market-outcomes-bar {
    display: flex;
    height: 50px;
    margin-bottom: 1rem;
    border: 1px solid var(--warm-gray);
    overflow: hidden;
}

.outcome-yes,
.outcome-no {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.outcome-yes {
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    border-right: 1px solid var(--warm-gray);
}

.outcome-no {
    background: var(--pale-crt-blue);
    color: var(--off-black-crt);
}

.ai-prediction-section {
    background: rgba(12, 12, 18, 0.5);
    padding: 1rem;
    margin-bottom: 1rem;
    border-left: 3px solid var(--muted-lilac);
}

.ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ai-badge {
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    font-size: 0.75rem;
    border: 1px solid;
}

.signal-bullish {
    background: #4ade80;
    color: var(--off-black-crt);
    border-color: #22c55e;
}

.signal-bearish {
    background: #f87171;
    color: var(--off-black-crt);
    border-color: #ef4444;
}

.signal-neutral {
    background: #fbbf24;
    color: var(--off-black-crt);
    border-color: #f59e0b;
}

.ai-confidence {
    font-size: 0.8rem;
    font-weight: bold;
}

.ai-prediction-text {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--warm-gray);
}

.market-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--warm-gray);
    flex-wrap: wrap;
    gap: 1rem;
}

.market-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.stat-label {
    font-size: 0.7rem;
    color: var(--pale-crt-blue);
    font-weight: bold;
}

.stat-value {
    font-size: 0.85rem;
    color: var(--soft-static-white);
    font-weight: bold;
}

.click-hint {
    font-size: 0.7rem;
    color: var(--muted-lilac);
    font-weight: bold;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(12, 12, 18, 0.9);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.modal-content {
    background: var(--deep-violet);
    border: 3px solid var(--muted-lilac);
    padding: 2rem;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    color: var(--soft-static-white);
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--ghost-pink);
}

.modal-title {
    font-size: 1.5rem;
    color: var(--soft-static-white);
    margin-bottom: 1.5rem;
    padding-right: 2rem;
    line-height: 1.4;
}

.modal-section {
    margin-bottom: 2rem;
}

.modal-section-title {
    font-size: 1rem;
    color: var(--muted-lilac);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.modal-description {
    color: var(--warm-gray);
    line-height: 1.6;
    font-size: 0.9rem;
}

.modal-outcomes {
    display: grid;
    gap: 0.75rem;
}

.modal-outcome {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(12, 12, 18, 0.5);
    border: 1px solid var(--warm-gray);
}

.outcome-name {
    font-weight: bold;
}

.outcome-price {
    color: var(--ghost-pink);
    font-weight: bold;
}

.modal-ai-section {
    background: rgba(12, 12, 18, 0.5);
    padding: 1rem;
    border-left: 3px solid var(--ghost-pink);
}

.modal-ai-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.modal-signal {
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    font-size: 0.75rem;
    border: 1px solid;
}

.modal-confidence {
    font-size: 0.85rem;
    font-weight: bold;
    color: var(--ghost-pink);
}

.modal-ai-prediction {
    color: var(--warm-gray);
    line-height: 1.6;
    font-size: 0.9rem;
}

.modal-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.modal-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: rgba(12, 12, 18, 0.5);
    border: 1px solid var(--warm-gray);
}

/* Whale Table */
.whale-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--deep-violet);
}

.whale-table th {
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    padding: 0.75rem;
    text-align: left;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    border: 1px solid var(--warm-gray);
}

.whale-table td {
    padding: 0.75rem;
    border: 1px solid var(--warm-gray);
    color: var(--soft-static-white);
    font-size: 0.85rem;
}

.whale-table tr:nth-child(even) {
    background: rgba(12, 12, 18, 0.3);
}

.whale-type {
    padding: 0.25rem 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    display: inline-block;
}

.whale-type.buy {
    background: #4ade80;
    color: var(--off-black-crt);
}

.whale-type.sell {
    background: #f87171;
    color: var(--off-black-crt);
}

.whale-type.swap {
    background: #fbbf24;
    color: var(--off-black-crt);
}

/* Chat */
.chat-container {
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
}

.chat-header {
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    padding: 1rem;
    border-bottom: 2px solid var(--warm-gray);
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(12, 12, 18, 0.3);
}

.chat-message {
    background: rgba(138, 132, 194, 0.2);
    border: 1px solid var(--muted-lilac);
    padding: 0.75rem;
    margin-bottom: 0.75rem;
}

.chat-user {
    color: var(--ghost-pink);
    font-weight: bold;
}

.chat-time {
    color: var(--dither-gray);
    font-size: 0.75rem;
}

.chat-input-container {
    padding: 1rem;
    border-top: 2px solid var(--warm-gray);
    background: var(--deep-violet);
    display: flex;
    gap: 1rem;
}

.chat-input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--warm-gray);
    background: rgba(12, 12, 18, 0.5);
    color: var(--soft-static-white);
    font-family: 'Coolvetica', sans-serif;
    font-size: 0.9rem;
}

/* Button */
.btn {
    padding: 0.75rem 1.5rem;
    background: var(--muted-lilac);
    color: var(--off-black-crt);
    border: 2px solid var(--muted-lilac);
    font-family: 'Coolvetica', sans-serif;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--ghost-pink);
    border-color: var(--ghost-pink);
}

/* Loading */
.loading {
    text-align: center;
    padding: 3rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--warm-gray);
    border-top: 4px solid var(--muted-lilac);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.loading-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
}

.loading-spinner-small {
    width: 30px;
    height: 30px;
    border: 3px solid var(--warm-gray);
    border-top: 3px solid var(--muted-lilac);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Connection Status */
.connection-status {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background: var(--deep-violet);
    border: 2px solid var(--muted-lilac);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    z-index: 1000;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

.status-dot.online {
    background: var(--ghost-pink);
}

.status-dot.offline {
    background: var(--dither-gray);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: var(--off-black-crt);
}

::-webkit-scrollbar-thumb {
    background: var(--muted-lilac);
    border: 2px solid var(--off-black-crt);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ghost-pink);
}

/* Responsive */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }
    
    .market-preview-grid,
    .market-grid-enhanced {
        grid-template-columns: 1fr;
    }
    
    .nav-links {
        gap: 1rem;
        font-size: 0.75rem;
    }

    .directives-grid {
        grid-template-columns: 1fr;
    }

    .status-bars {
        grid-template-columns: 1fr;
    }

    .hero-buttons {
        flex-direction: column;
    }

    .btn-primary, .btn-secondary {
        width: 100%;
    }
}
