/* =====================================================
   YYAI RESEARCH PORTAL - Professional Stylesheet
   ===================================================== */

/* CSS Variables */
:root {
    --navy: #1B365D;
    --navy-light: #2D4A7C;
    --navy-dark: #0F1F33;
    --blue-accent: #3B82F6;
    --light-blue: #E8F4FC;
    --medium-blue: #B8D4E8;
    
    --green: #059669;
    --green-light: #D1FAE5;
    --red: #DC2626;
    --red-light: #FEE2E2;
    --orange: #D97706;
    --orange-light: #FEF3C7;
    --purple: #7C3AED;
    --purple-light: #EDE9FE;
    
    --gray-50: #F9FAFB;
    --gray-100: #F3F4F6;
    --gray-200: #E5E7EB;
    --gray-300: #D1D5DB;
    --gray-400: #9CA3AF;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;
    
    --font-serif: 'Georgia', 'Times New Roman', serif;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', 'Monaco', 'Consolas', monospace;
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    
    --max-width: 1200px;
    --content-width: 900px;
}

/* Live Ticker Bar */
.live-ticker-bar {
    background: #ffffff;
    border-bottom: 1px solid var(--gray-200);
    padding: 8px 0;
    position: sticky;
    top: 0;
    z-index: 1001;
}

.live-ticker-bar .tradingview-widget-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1rem;
}

.live-ticker-bar .tradingview-widget-container__widget {
    min-height: 46px;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.7;
    color: var(--gray-800);
    background-color: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 600;
    line-height: 1.3;
    color: var(--gray-900);
    margin-bottom: 1rem;
}

h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--navy);
}

h2 {
    font-size: 1.75rem;
    color: var(--navy);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
    margin-top: 2.5rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.35rem;
    color: var(--navy-light);
    margin-top: 2rem;
}

h4 {
    font-size: 1.125rem;
    color: var(--gray-700);
    margin-top: 1.5rem;
}

p {
    margin-bottom: 1.25rem;
    color: var(--gray-700);
}

a {
    color: var(--blue-accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--navy);
    text-decoration: underline;
}

strong {
    font-weight: 600;
    color: var(--gray-900);
}

/* Layout */
.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.content-container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header */
.site-header {
    background: var(--navy);
    color: white;
    padding: 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow-md);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.site-logo:hover {
    color: var(--light-blue);
    text-decoration: none;
}

.site-logo span {
    color: var(--medium-blue);
    font-weight: 400;
}

.header-meta {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.7);
}

/* Navigation */
.main-nav {
    padding: 0.5rem 0;
}

.nav-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.nav-list a {
    display: block;
    padding: 0.5rem 0.875rem;
    color: rgba(255,255,255,0.85);
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    transition: all 0.2s;
}

.nav-list a:hover {
    background: rgba(255,255,255,0.1);
    color: white;
    text-decoration: none;
}

.nav-list a.active {
    background: rgba(255,255,255,0.15);
    color: white;
}

/* Mobile Nav Toggle */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }
    
    .nav-list {
        display: none;
        flex-direction: column;
        padding: 1rem 0;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-list a {
        padding: 0.75rem 1rem;
    }
}

/* Page Header */
.page-header {
    background: linear-gradient(135deg, var(--gray-50) 0%, var(--light-blue) 100%);
    padding: 3rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.page-header h1 {
    margin-bottom: 0.5rem;
}

.page-header .subtitle {
    font-size: 1.125rem;
    color: var(--gray-600);
    margin-bottom: 0;
}

.page-header .meta {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 1rem;
}

/* Main Content */
main {
    padding: 3rem 0;
    min-height: calc(100vh - 400px);
}

/* Key Stats Banner */
.key-stats-banner {
    background: var(--navy);
    color: white;
    padding: 1.5rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
}

.stat-item .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255,255,255,0.7);
}

/* Highlight Boxes */
.highlight-box {
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.highlight-box.blue {
    background: var(--light-blue);
    border-left: 4px solid var(--navy);
}

.highlight-box.green {
    background: var(--green-light);
    border-left: 4px solid var(--green);
}

.highlight-box.red {
    background: var(--red-light);
    border-left: 4px solid var(--red);
}

.highlight-box.orange {
    background: var(--orange-light);
    border-left: 4px solid var(--orange);
}

.highlight-box.purple {
    background: var(--purple-light);
    border-left: 4px solid var(--purple);
}

.highlight-box.gray {
    background: var(--gray-100);
    border-left: 4px solid var(--gray-500);
}

.highlight-box .box-title {
    font-weight: 700;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.highlight-box.blue .box-title { color: var(--navy); }
.highlight-box.green .box-title { color: var(--green); }
.highlight-box.red .box-title { color: var(--red); }
.highlight-box.orange .box-title { color: var(--orange); }
.highlight-box.purple .box-title { color: var(--purple); }
.highlight-box.gray .box-title { color: var(--gray-600); }

.highlight-box p:last-child {
    margin-bottom: 0;
}

/* SEC Quote Boxes */
.sec-quote {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--gray-700);
}

.sec-quote .source {
    font-family: var(--font-sans);
    font-style: normal;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
}

/* Tables */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9375rem;
    box-shadow: var(--shadow);
    border-radius: 8px;
    overflow: hidden;
}

.data-table thead {
    background: var(--navy);
    color: white;
}

.data-table th {
    padding: 0.875rem 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:nth-child(even) {
    background: var(--gray-50);
}

.data-table tbody tr:hover {
    background: var(--light-blue);
}

.data-table .number {
    text-align: right;
    font-family: var(--font-mono);
}

.data-table .highlight {
    font-weight: 600;
    color: var(--navy);
}

.data-table .positive {
    color: var(--green);
}

.data-table .negative {
    color: var(--red);
}

/* Compact Tables */
.data-table.compact th,
.data-table.compact td {
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
}

/* Entity Cards */
.entity-card {
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 2px solid;
}

.entity-card.yyai {
    background: var(--light-blue);
    border-color: var(--navy);
}

.entity-card.stablecoinx {
    background: var(--purple-light);
    border-color: var(--purple);
}

.entity-card.chai {
    background: var(--orange-light);
    border-color: var(--orange);
}

.entity-card .card-header {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.entity-card.yyai .card-header { color: var(--navy); }
.entity-card.stablecoinx .card-header { color: var(--purple); }
.entity-card.chai .card-header { color: var(--orange); }

.entity-card .card-row {
    display: flex;
    margin-bottom: 0.5rem;
}

.entity-card .card-label {
    font-weight: 600;
    min-width: 120px;
    color: var(--gray-700);
}

.entity-card .card-value {
    color: var(--gray-600);
}

/* Scenario Cards */
.scenario-card {
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1rem 0;
    border: 2px solid;
}

.scenario-card.high {
    background: var(--green-light);
    border-color: var(--green);
}

.scenario-card.medium {
    background: var(--orange-light);
    border-color: var(--orange);
}

.scenario-card.low {
    background: var(--purple-light);
    border-color: var(--purple);
}

.scenario-card h4 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.scenario-card.high h4 { color: var(--green); }
.scenario-card.medium h4 { color: var(--orange); }
.scenario-card.low h4 { color: var(--purple); }

/* Timeline */
.timeline {
    position: relative;
    padding-left: 2rem;
    margin: 2rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-300);
}

.timeline-item {
    position: relative;
    padding-bottom: 1.5rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--navy);
    border: 2px solid white;
    box-shadow: var(--shadow);
}

.timeline-item.highlight::before {
    background: var(--green);
    width: 16px;
    height: 16px;
    left: calc(-2rem - 2px);
}

.timeline-date {
    font-weight: 600;
    color: var(--navy);
    font-size: 0.9375rem;
    margin-bottom: 0.25rem;
}

.timeline-event {
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.25rem;
}

.timeline-desc {
    color: var(--gray-600);
    font-size: 0.9375rem;
}

/* Calculation Boxes */
.calc-box {
    background: var(--gray-100);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    line-height: 1.8;
    overflow-x: auto;
}

.calc-box .calc-title {
    font-family: var(--font-sans);
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.calc-box .calc-line {
    margin-bottom: 0.25rem;
}

.calc-box .calc-result {
    font-weight: 600;
    color: var(--navy);
    border-top: 1px solid var(--gray-300);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}

/* Lists */
ul, ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

ul.check-list {
    list-style: none;
    padding-left: 0;
}

ul.check-list li {
    position: relative;
    padding-left: 1.75rem;
}

ul.check-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 700;
}

/* Downloads Section */
.download-card {
    display: flex;
    align-items: center;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.25rem;
    margin: 1rem 0;
    transition: all 0.2s;
}

.download-card:hover {
    background: var(--light-blue);
    border-color: var(--navy);
    box-shadow: var(--shadow-md);
}

.download-icon {
    font-size: 2rem;
    margin-right: 1rem;
    color: var(--navy);
}

.download-info {
    flex: 1;
}

.download-title {
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.25rem;
}

.download-desc {
    font-size: 0.875rem;
    color: var(--gray-500);
    margin: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--navy);
    color: white;
    padding: 0.625rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    text-decoration: none;
    transition: all 0.2s;
}

.download-btn:hover {
    background: var(--navy-dark);
    color: white;
    text-decoration: none;
}

/* Footer */
.site-footer {
    background: var(--gray-900);
    color: var(--gray-400);
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
}

@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

.footer-section h4 {
    color: white;
    font-size: 0.9375rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-section p {
    color: var(--gray-400);
    font-size: 0.875rem;
    line-height: 1.6;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid var(--gray-700);
    margin-top: 2rem;
    padding-top: 2rem;
    text-align: center;
}

.footer-disclaimer {
    font-size: 0.75rem;
    color: var(--gray-500);
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.7;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-navy { color: var(--navy); }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.text-gray { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.text-large { font-size: 1.125rem; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Download Grid */
.download-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.download-card {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.2s;
}

.download-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.download-icon {
    font-size: 3rem;
    flex-shrink: 0;
}

.download-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: var(--navy);
}

.download-desc {
    color: var(--gray-600);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
}

.download-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.file-type {
    background: var(--gray-100);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1rem;
}

/* Glossary */
.glossary {
    display: grid;
    gap: 1.5rem;
}

.glossary-item {
    padding: 1.25rem 1.5rem;
    background: var(--gray-50);
    border-left: 4px solid var(--navy);
    border-radius: 0 8px 8px 0;
}

.glossary-item dt {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.5rem;
    font-size: 1.0625rem;
}

.glossary-item dd {
    color: var(--gray-700);
    margin: 0;
    line-height: 1.6;
}

/* Calculation Boxes */
.calculation-box {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.calc-formula {
    background: white;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    font-family: var(--font-mono);
    font-size: 0.9375rem;
    margin-bottom: 1rem;
    transition: background-color 0.3s;
}

.calculation-box .data-table {
    margin: 0;
    box-shadow: none;
}

/* TOC Preview */
.toc-preview {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem 2rem;
    margin: 1.5rem 0;
}

.toc-list {
    list-style: decimal;
    padding-left: 1.5rem;
}

.toc-list li {
    margin-bottom: 0.75rem;
}

.toc-title {
    font-weight: 600;
    color: var(--navy);
}

.toc-list ul {
    list-style: disc;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.toc-list ul li {
    margin-bottom: 0.25rem;
    color: var(--gray-600);
    font-size: 0.9375rem;
}

/* Link Grid */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.link-card {
    display: block;
    padding: 1.25rem;
    background: var(--light-blue);
    border: 1px solid var(--medium-blue);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.link-card:hover {
    background: var(--medium-blue);
    transform: translateY(-2px);
    text-decoration: none;
}

.link-title {
    font-weight: 600;
    color: var(--navy);
    margin-bottom: 0.25rem;
}

.link-desc {
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* Two Column Layout */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 1.5rem 0;
}

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

/* Page Navigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--gray-200);
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--gray-100);
    border-radius: 6px;
    color: var(--navy);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--light-blue);
    text-decoration: none;
}

.nav-link.prev {
    margin-right: auto;
}

.nav-link.next {
    margin-left: auto;
}

/* Animation on Scroll */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Header Scroll Effect */
.site-header.scrolled {
    box-shadow: var(--shadow-md);
}

/* Print Styles */
@media print {
    .site-header,
    .main-nav,
    .site-footer,
    .page-nav {
        display: none;
    }
    
    main {
        padding: 0;
    }
    
    .highlight-box,
    .data-table,
    .entity-card,
    .download-card,
    .calculation-box {
        break-inside: avoid;
    }
    
    .animate-on-scroll {
        opacity: 1;
        transform: none;
    }
}
