/* PQC Binary Format v1.0 - Spectacular CSS */
/* No inline styles - all external */

:root {
    --primary-color: #6200ea;
    --primary-dark: #3700b3;
    --primary-light: #bb86fc;
    --accent-color: #03dac6;
    --accent-dark: #018786;
    --bg-dark: #0a0a0a;
    --bg-card: #1a1a1a;
    --bg-card-hover: #222222;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #333333;
    --success-color: #00c853;
    --warning-color: #ff6f00;
    --error-color: #d32f2f;
    --code-bg: #1e1e1e;
    --code-border: #444444;
    --shadow-glow: 0 0 20px rgba(98, 0, 234, 0.3);
    --shadow-card: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a0a2e 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Custom Scrollbar Styling - Binary Format Theme */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a0a2e 100%);
    border-radius: 7px;
    border: 1px solid rgba(98, 0, 234, 0.2);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 7px;
    border: 2px solid rgba(0, 0, 0, 0.3);
    box-shadow:
        0 0 10px rgba(3, 218, 198, 0.5),
        inset 0 0 6px rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--accent-color) 0%, var(--primary-light) 100%);
    box-shadow:
        0 0 20px rgba(3, 218, 198, 0.8),
        0 0 30px rgba(98, 0, 234, 0.5),
        inset 0 0 8px rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, var(--primary-light) 0%, var(--accent-color) 100%);
}

/* Firefox scrollbar */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--primary-color) #1a1a1a;
}

/* Scrollbar corner */
::-webkit-scrollbar-corner {
    background: #0a0a0a;
}

/* Header Styles */
.pqc-header {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    padding: 2rem 1rem;
    box-shadow: 0 4px 20px rgba(98, 0, 234, 0.5);
    border-bottom: 3px solid var(--accent-color);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-image {
    width: 120px;
    height: 120px;
    border-radius: 20px;
    box-shadow: 0 0 30px rgba(3, 218, 198, 0.6), 0 0 60px rgba(3, 218, 198, 0.4);
    transition: all 0.3s ease;
}

.logo-image:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(3, 218, 198, 0.8), 0 0 80px rgba(3, 218, 198, 0.6);
}

.title-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: none;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    font-weight: 300;
    margin: 0;
}

/* Tab Navigation */
.tab-nav {
    background: var(--bg-card);
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.tab-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.tab-btn.active {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    background: var(--bg-card-hover);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
}

/* Content Container */
.content-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.5s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Overview Grid */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    width: 100%;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-card);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--primary-light);
}

.info-card.full-width {
    grid-column: 1 / -1;
}

.info-card.half-width {
    grid-column: span 1;
}

.info-card a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.info-card a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.5);
}

/* First 2 cards in a row (Document Status + Security Properties) */
.info-card:nth-child(1),
.info-card:nth-child(2) {
    grid-column: span 1;
}

/* Abstract card full width */
.info-card:nth-child(3) {
    grid-column: 1 / -1;
}

/* Last 2 cards in a row (Binary Format + Algorithms) */
.info-card:nth-child(4),
.info-card:nth-child(5) {
    grid-column: span 1;
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

/* Info Lists */
.info-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.5rem 1rem;
    font-size: 1rem;
}

.info-list dt {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-list dd {
    color: var(--text-primary);
}

.status-proposed {
    color: var(--warning-color);
    font-weight: 700;
}

/* Feature Lists */
.feature-list {
    list-style: none;
    padding: 0;
}

.feature-list li {
    padding: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.icon-check {
    font-size: 1.2rem;
    color: var(--success-color);
}

/* Verification Badge */
.verification-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(0, 200, 83, 0.1), rgba(3, 218, 198, 0.1));
    border: 2px solid var(--success-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.badge-icon {
    font-size: 3rem;
    color: var(--success-color);
}

.badge-text {
    flex: 1;
}

.badge-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--success-color);
    margin-bottom: 0.25rem;
}

.badge-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.verification-summary {
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Abstract Text */
.abstract-text {
    margin-bottom: 1rem;
    line-height: 1.8;
    color: var(--text-secondary);
    font-size: 1.05rem;
}

.abstract-text a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.abstract-text a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.5);
}

/* Code Blocks */
.code-block {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.8;
    color: #00ff88;
    margin: 1rem 0;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
}

.code-block code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    white-space: pre;
    display: block;
    color: #00ff88;
    text-shadow: 0 0 5px rgba(0, 255, 136, 0.3);
    letter-spacing: 0.5px;
}

.code-block code::selection {
    background: var(--primary-color);
    color: #fff;
}

.inline-code {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 4px;
    padding: 0.2rem 0.4rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: var(--accent-color);
}

/* Resource Links */
.resource-links a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.resource-links a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.5);
}

/* Table of Contents Links */
.toc-link {
    color: var(--primary-light);
    text-decoration: none;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.toc-link:hover {
    color: var(--accent-color);
    border-bottom-color: var(--accent-color);
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.4);
}

/* Algorithm Lists */
.algorithm-list {
    list-style: none;
    padding: 0;
}

.algorithm-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.algorithm-list li:last-child {
    border-bottom: none;
}

/* Format Table */
.format-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.95rem;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(138, 43, 226, 0.2);
}

.format-table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.format-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: #fff;
    border-bottom: 2px solid var(--primary-light);
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}

.format-table td {
    padding: 0.875rem 1rem;
    color: #00ff88;
    border-bottom: 1px solid rgba(138, 43, 226, 0.2);
}

.format-table tbody tr:hover {
    background: rgba(138, 43, 226, 0.1);
}

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

/* Algorithm Columns */
.algorithm-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.algorithm-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.algorithm-category {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.5rem 0;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid var(--border-color);
}

.algorithm-list-compact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.algorithm-list-compact li {
    padding: 0.375rem 0;
    padding-left: 1.25rem;
    position: relative;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.algorithm-list-compact li:before {
    content: "▸";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: 700;
}

/* RFC and Verification Document Styles */
.markdown-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    line-height: 1.8;
}

.markdown-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
    transition: all 0.3s ease;
    font-weight: 600;
}

.markdown-content a:hover {
    color: var(--primary-light);
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-shadow: 0 0 8px rgba(3, 218, 198, 0.5);
}

.rfc-h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color);
}

.rfc-h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
    margin: 2rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
}

.rfc-h3 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 1.5rem 0 0.75rem;
}

.rfc-h4 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1rem 0 0.5rem;
}

.rfc-divider {
    border: none;
    border-top: 2px solid var(--border-color);
    margin: 2rem 0;
}

/* Algorithm Table */
.algorithms-reference {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.1rem;
}

.algorithm-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

.algorithm-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-dark);
    border-radius: 8px;
    overflow: hidden;
}

.algorithm-table thead {
    background: var(--primary-color);
}

.algorithm-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 2px solid var(--accent-color);
}

.algorithm-table tbody tr {
    transition: background 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.algorithm-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.algorithm-table td {
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
}

.algorithm-table .mono {
    font-family: 'Courier New', Courier, monospace;
    color: var(--accent-color);
    font-weight: 600;
}

.status-active {
    color: var(--success-color);
    font-weight: 700;
}

.status-reserved {
    color: var(--warning-color);
    font-weight: 700;
}

.table-divider {
    background: var(--primary-dark);
    font-weight: 700;
    text-align: center;
}

.table-divider td {
    color: var(--accent-color);
    padding: 0.5rem;
}

/* Registry Notes */
.registry-notes {
    background: var(--bg-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.registry-notes h3 {
    color: var(--accent-color);
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.registry-notes ul {
    list-style: none;
    padding: 0;
}

.registry-notes li {
    padding: 0.5rem 0;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.registry-notes li:last-child {
    border-bottom: none;
}

/* Footer */
.pqc-footer {
    background: var(--bg-card);
    border-top: 3px solid var(--accent-color);
    padding: 2rem 1rem;
    margin-top: 4rem;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    text-align: center;
}

.copyright {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.copyright strong {
    color: var(--accent-color);
}

.copyright-notice {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-style: italic;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
}

.footer-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.footer-separator {
    color: var(--border-color);
}

.document-info {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

.document-info strong {
    color: var(--text-primary);
}

/* Error Message */
.error {
    color: var(--error-color);
    background: rgba(211, 47, 47, 0.1);
    border: 1px solid var(--error-color);
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    .logo-image {
        width: 80px;
        height: 80px;
    }

    .title-container {
        align-items: center;
        text-align: center;
    }

    .page-title {
        font-size: 2rem;
    }

    .page-subtitle {
        font-size: 1rem;
    }

    .tab-nav {
        flex-wrap: wrap;
    }

    .tab-btn {
        flex: 1 1 auto;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

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

    .info-card {
        grid-column: 1 / -1 !important;
    }

    .info-card.full-width,
    .info-card.half-width {
        grid-column: 1 / -1 !important;
    }

    .info-card:nth-child(1),
    .info-card:nth-child(2),
    .info-card:nth-child(3),
    .info-card:nth-child(4),
    .info-card:nth-child(5) {
        grid-column: 1 / -1 !important;
    }

    .algorithm-table {
        font-size: 0.85rem;
    }

    .algorithm-table th,
    .algorithm-table td {
        padding: 0.5rem;
    }

    .code-block {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    .algorithm-columns {
        grid-template-columns: 1fr;
    }

    .format-table {
        font-size: 0.85rem;
    }

    .format-table th,
    .format-table td {
        padding: 0.625rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .header-content {
        gap: 0.75rem;
    }

    .logo-image {
        width: 60px;
        height: 60px;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-subtitle {
        font-size: 0.9rem;
    }

    .tab-btn {
        font-size: 0.8rem;
        padding: 0.5rem 0.75rem;
    }
}

/* Copy Code Button Styles */
.code-block {
    position: relative;
}

.copy-code-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.code-block:hover .copy-code-btn {
    opacity: 1;
}

.copy-code-btn.copied {
    background: var(--success-color);
}

.copy-code-btn.error {
    background: var(--error-color);
}

/* Table of Contents List */
.toc-list {
    list-style: none;
    padding-left: 0;
}

/* Centered Content */
.text-center {
    text-align: center;
}

.mt-2 {
    margin-top: 2rem;
}

.text-secondary-color {
    color: var(--text-secondary);
}

/* Status Badge */
.status-complete {
    color: var(--success-color);
    font-weight: 700;
}
