/* LiFi Cryptography - Complete Styles */

/* CSS Variables */
:root {
    --primary: #10b981;
    --primary-hover: #059669;
    --secondary: #64748b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-light: #334155;
    --text: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #475569;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    --radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

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

html {
    scroll-behavior: smooth;
}

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

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

/* Header */
.header {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 2rem;
}

.logo-text h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.logo-text .highlight {
    color: var(--primary);
}

.tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 50px;
    color: var(--primary);
    font-size: 0.875rem;
}

/* Hero */
.hero {
    text-align: center;
    padding: 2rem 0;
}

.hero h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.hero p {
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Navigation */
.main-nav {
    margin-bottom: 1.5rem;
}

.nav-tabs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0.5rem;
    background: var(--surface);
    padding: 0.5rem;
    border-radius: var(--radius);
}

.nav-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.nav-tab:hover {
    background: var(--surface-light);
    color: var(--text);
}

.nav-tab.active {
    background: var(--primary);
    color: white;
}

.tab-icon {
    font-size: 1.25rem;
}

.tab-text {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Cards */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.card-header {
    padding: 1.25rem;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 1.25rem;
    margin-bottom: 0.25rem;
}

.card-header p {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.card-body {
    padding: 1.25rem;
}

/* Tab Content */
.tab-content {
    display: none;
}

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

/* Sub Tabs */
.sub-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.sub-tab {
    padding: 0.5rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.sub-tab:hover {
    border-color: var(--primary);
    color: var(--text);
}

.sub-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

.subtab-content {
    display: none;
}

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

/* Form Elements */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text);
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.label-row label {
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="text"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.875rem;
    transition: border-color 0.2s;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
}

.mono {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.8rem;
}

/* Checkboxes */
.checkboxes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface-light);
    border-radius: var(--radius);
    cursor: pointer;
}

.checkbox input {
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--surface-light);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

.btn-warning {
    background: var(--warning);
    color: white;
}

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

.btn-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.full-width {
    width: 100%;
}

/* Algorithm Badges */
.algo-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.algo-badge.aes {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.algo-badge.des {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

.algo-badge.rsa {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.algo-badge.base64 {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.algo-badge.hex {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.algo-badge.url {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.algo-desc {
    color: var(--text-muted);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* Hash Badges */
.hash-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.hash-badge.sha256 {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.hash-badge.sha384 {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

.hash-badge.sha512 {
    background: rgba(139, 92, 246, 0.2);
    color: #8b5cf6;
}

.hash-badge.md5 {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Strength Meter */
.strength-meter {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.strength-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-light);
    border-radius: 3px;
    overflow: hidden;
}

.strength-text {
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 80px;
    text-align: right;
}

/* Hash Results */
.hash-results-grid {
    display: grid;
    gap: 1rem;
}

.hash-result {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1rem;
}

.hash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.hash-result code {
    display: block;
    word-break: break-all;
    color: var(--text);
    font-size: 0.8rem;
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 4px;
}

.hash-length {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Keys List */
.keys-list {
    max-height: 300px;
    overflow-y: auto;
}

.key-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.key-item code {
    flex: 1;
    word-break: break-all;
    font-size: 0.8rem;
    color: var(--primary);
}

/* Encode Switch */
.encode-switch {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.switch-btn {
    padding: 0.75rem 2rem;
    background: var(--surface-light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.switch-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

/* Info Boxes */
.info-box {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.info-box h4 {
    margin-bottom: 0.75rem;
}

.algo-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
}

.success-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--success);
    font-size: 0.875rem;
}

/* Key Generation Box */
.key-gen-box {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1rem;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-upload-content {
    background: var(--surface-light);
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s;
}

.file-upload:hover .file-upload-content {
    border-color: var(--primary);
}

.file-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

/* Image Preview */
.image-preview {
    background: var(--surface-light);
    border-radius: var(--radius);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 4px;
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Input with Button */
.input-with-btn {
    display: flex;
    gap: 0.5rem;
}

.input-with-btn input {
    flex: 1;
}

/* Learn Section */
.learn-section {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.learn-section h4 {
    margin-bottom: 0.75rem;
    color: var(--text);
}

.learn-section p {
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

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

.learn-section ul li {
    padding: 0.25rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.learn-section ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--primary);
}

.code-example {
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.code-example code {
    color: var(--primary);
}

/* Did You Know */
.did-you-know {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.did-you-know h4 {
    color: var(--primary);
    margin-bottom: 0.75rem;
}

/* Pros & Cons */
.pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
}

.pros, .cons {
    padding: 1rem;
    border-radius: var(--radius);
}

.pros {
    background: rgba(16, 185, 129, 0.1);
}

.pros h5 {
    color: var(--success);
}

.cons {
    background: rgba(239, 68, 68, 0.1);
}

.cons h5 {
    color: var(--error);
}

/* Status Badge */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.status-badge.recommended {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.status-badge.legacy {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

/* Key Diagram */
.key-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.key-box {
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    text-align: center;
}

.key-box.public {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.key-box.private {
    background: rgba(139, 92, 246, 0.2);
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.key-box strong {
    display: block;
    margin-bottom: 0.25rem;
}

.key-box p {
    font-size: 0.75rem;
    margin: 0;
}

.arrow {
    font-size: 1.5rem;
    color: var(--text-muted);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-top: 1rem;
}

.stat {
    background: var(--surface);
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
}

.stat strong {
    display: block;
    font-size: 1.5rem;
    color: var(--primary);
}

.stat span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Use Cases Grid */
.use-cases-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.use-cases-grid div {
    background: var(--surface);
    padding: 0.75rem;
    border-radius: var(--radius);
}

.use-cases-grid p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
}

/* Hash Algorithms Grid */
.hash-algos {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-top: 1rem;
}

.hash-algo {
    background: var(--surface);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
}

/* Info Items */
.info-item {
    background: var(--surface-light);
    padding: 1rem;
    border-radius: var(--radius);
}

.info-item h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.info-item p {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin: 0;
}

/* Quick Examples */
.quick-examples {
    margin-top: 1rem;
}

.example-btns {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Extracted Message */
.extracted-message {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    color: var(--text);
    white-space: pre-wrap;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow);
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.success {
    border-color: var(--success);
}

.toast.error {
    border-color: var(--error);
}

/* Footer */
.footer {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 1.5rem 0;
    margin-top: auto;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-left {
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-right {
    display: flex;
    gap: 1.5rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
    .nav-tabs {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .grid-2,
    .form-row,
    .pros-cons,
    .use-cases-grid {
        grid-template-columns: 1fr;
    }
    
    .grid-3 {
        grid-template-columns: 1fr;
    }
    
    .hero h2 {
        font-size: 1.5rem;
    }
    
    .key-diagram {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .nav-tabs {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .checkboxes {
        grid-template-columns: 1fr;
    }
    
    .algo-info-grid,
    .hash-algos {
        grid-template-columns: 1fr;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==================== Quantum & Post-Quantum Styles ==================== */

/* Navigation for 8 tabs */
.nav-tabs {
    grid-template-columns: repeat(8, 1fr) !important;
}

/* Quantum Warning Box */
.quantum-warning {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.quantum-icon {
    font-size: 1.5rem;
}

/* PQC Info Box */
.pq-info-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.pq-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

.pq-badge.pq-safe {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.pq-badge.pq-level {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Algorithm Badges for PQC */
.algo-badge.kyber {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    color: #10b981;
}

.algo-badge.dilithium {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(236, 72, 153, 0.2));
    color: #a78bfa;
}

.algo-badge.lattice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(251, 191, 36, 0.2));
    color: #f59e0b;
}

.algo-badge.bb84 {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(59, 130, 246, 0.2));
    color: #10b981;
}

.algo-badge.qrng {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(139, 92, 246, 0.2));
    color: #ec4899;
}

.algo-badge.entanglement {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(16, 185, 129, 0.2));
    color: #3b82f6;
}

/* Key Size Info */
.key-size-info {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Divider */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 1.5rem 0;
}

/* Lattice Demo */
.lattice-demo {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

.lattice-demo canvas {
    border-radius: 4px;
}

.demo-label {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Code Block */
code.block {
    display: block;
    background: var(--surface);
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 0.25rem;
    word-break: break-all;
    font-size: 0.8rem;
}

code.small-text {
    font-size: 0.65rem;
    line-height: 1.4;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
    margin-top: 1rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), #8b5cf6);
}

.timeline-item {
    position: relative;
    margin-bottom: 1rem;
    padding-left: 1rem;
}

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

.timeline-item .year {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

.timeline-item.future::before {
    background: #8b5cf6;
}

.timeline-item.future .year {
    color: #8b5cf6;
}

/* Crypto Table */
.crypto-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.crypto-table th,
.crypto-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.crypto-table th {
    background: var(--surface);
    color: var(--text-muted);
    font-weight: 600;
}

.crypto-table tr.legacy {
    background: rgba(239, 68, 68, 0.05);
}

.crypto-table tr.safe {
    background: rgba(16, 185, 129, 0.05);
}

/* Problem Cards */
.problem-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.problem-card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
}

.problem-card h5 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.problem-card p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.problem-card .used-in {
    font-size: 0.75rem;
    color: #8b5cf6;
}

/* Quantum Intro */
.quantum-intro {
    text-align: center;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.quantum-icon-large {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* BB84 Demo */
.bb84-demo {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.bb84-flow {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    gap: 1rem;
    align-items: center;
    margin: 1.5rem 0;
}

.bb84-party {
    text-align: center;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--radius);
}

.bb84-party h5 {
    margin-bottom: 0.5rem;
}

.party-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.bit-display {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--primary);
    min-height: 1.5rem;
}

.bb84-channel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quantum-channel,
.classical-channel {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--surface);
    border-radius: var(--radius);
    justify-content: center;
}

.photon {
    animation: photon-move 1s infinite;
}

@keyframes photon-move {
    0%, 100% { transform: translateX(-5px); }
    50% { transform: translateX(5px); }
}

.channel-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* BB84 Results */
.bb84-result-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 1rem;
}

.result-card {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1rem;
    border: 1px solid var(--border);
}

.result-card h5 {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.result-card.matched {
    border-color: var(--primary);
}

.result-card.key {
    grid-column: span 3;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(139, 92, 246, 0.1));
    border-color: var(--primary);
}

.key-efficiency {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

.basis-legend {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* QRNG Styles */
.qrng-info {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 1.5rem;
    align-items: start;
    margin-bottom: 1.5rem;
}

.quantum-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 2rem;
}

.quantum-particle {
    position: relative;
    width: 80px;
    height: 80px;
}

.particle-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    border-radius: 50%;
    animation: core-pulse 1.5s infinite;
}

@keyframes core-pulse {
    0%, 100% { transform: translate(-50%, -50%) scale(1); box-shadow: 0 0 10px #8b5cf6; }
    50% { transform: translate(-50%, -50%) scale(1.2); box-shadow: 0 0 20px #8b5cf6; }
}

.particle-orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    border: 2px dashed rgba(139, 92, 246, 0.5);
    border-radius: 50%;
    animation: orbit-spin 3s linear infinite;
}

@keyframes orbit-spin {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.visual-label {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.qrng-stats {
    display: flex;
    gap: 2rem;
    margin-top: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Test Results */
.test-result {
    padding: 0.5rem;
    margin-top: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.test-result .pass {
    color: var(--success);
}

.test-result .fail {
    color: var(--error);
}

/* Entanglement Demo */
.entanglement-demo {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.entangled-particles {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.particle {
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: var(--radius);
    border: 2px solid rgba(139, 92, 246, 0.3);
}

.particle .spin {
    font-size: 2rem;
    display: block;
}

.particle .label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.entangle-symbol {
    font-size: 1.5rem;
    color: #8b5cf6;
}

.demo-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* Bell State Result */
.bell-state-result {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
    margin: 1rem 0;
}

.bell-state-result h5 {
    margin-bottom: 0.5rem;
}

.bell-state-result code.large {
    font-size: 1rem;
    color: #8b5cf6;
}

/* Measurement Grid */
.measurement-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1rem 0;
}

.measurement-box {
    background: var(--surface-light);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}

.measurement-box h5 {
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}

.measurement-animation {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 50px;
}

.quantum-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(139, 92, 246, 0.3);
    border-top-color: #8b5cf6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.measurement-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.spin-result {
    font-size: 2rem;
}

.state-label {
    font-family: monospace;
    color: var(--primary);
}

.correlation-box {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
}

.correlation-box p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* Numbered List */
ol.numbered-list {
    counter-reset: item;
    list-style: none;
    padding-left: 2rem;
}

ol.numbered-list li {
    counter-increment: item;
    margin-bottom: 0.75rem;
    position: relative;
}

ol.numbered-list li::before {
    content: counter(item);
    position: absolute;
    left: -2rem;
    width: 1.5rem;
    height: 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Qubit States */
.qubit-states {
    display: flex;
    gap: 2rem;
    align-items: center;
    margin: 1.5rem 0;
}

.bloch-sphere {
    width: 100px;
    height: 100px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle at 30% 30%, var(--surface-light), var(--surface));
}

.state-arrow {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 2px;
    background: var(--primary);
    transform-origin: left center;
    animation: arrow-move 2s infinite;
}

@keyframes arrow-move {
    0%, 100% { transform: rotate(-45deg); }
    50% { transform: rotate(45deg); }
}

.state-info code {
    font-size: 1rem;
}

/* Attack Comparison */
.attack-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.attack-method {
    padding: 1rem;
    border-radius: var(--radius);
}

.attack-method.classical {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.attack-method.quantum {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.attack-method h5 {
    margin-bottom: 0.5rem;
}

.attack-method .time {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.attack-method .status {
    font-weight: 600;
}

/* Preparation Steps */
.preparation-steps {
    margin-top: 1rem;
}

.prep-step {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--surface-light);
    border-radius: var(--radius);
}

.step-num {
    width: 30px;
    height: 30px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Error Box */
.error-box {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius);
    padding: 1rem;
    margin-top: 1rem;
    color: #ef4444;
}

/* Help Text */
.help-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Responsive for Quantum */
@media (max-width: 768px) {
    .nav-tabs {
        grid-template-columns: repeat(4, 1fr) !important;
    }
    
    .bb84-flow {
        grid-template-columns: 1fr;
    }
    
    .bb84-result-grid {
        grid-template-columns: 1fr;
    }
    
    .result-card.key {
        grid-column: span 1;
    }
    
    .qrng-info {
        grid-template-columns: 1fr;
    }
    
    .problem-cards {
        grid-template-columns: 1fr;
    }
    
    .attack-comparison {
        grid-template-columns: 1fr;
    }
    
    .measurement-grid {
        grid-template-columns: 1fr;
    }
    
    .qubit-states {
        flex-direction: column;
    }
}
