/* Styles specific to the Quantum Cryptography lesson */

/* Qubit visualization */
.quantum-visualization {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.bit-comparison {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: center;
    margin-top: 1rem;
}

.classical-bit, .quantum-bit {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    min-width: 200px;
}

.bit-state {
    font-size: 2rem;
    font-weight: bold;
    margin: 1rem 0;
    font-family: monospace;
}

.qubit-sphere {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle at 50% 50%, #e0e0e0, #c0c0c0);
    border-radius: 50%;
    position: relative;
    margin: 1rem 0;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.2);
}

.qubit-point {
    width: 12px;
    height: 12px;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease-in-out;
}

.qubit-state {
    font-family: monospace;
    text-align: center;
    height: 2.5rem;
    margin-bottom: 1rem;
}

/* Shor's algorithm demo */
.shor-visual {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.shor-description, .simulation-controls {
    flex: 1;
    min-width: 300px;
}

.example-calculation {
    background-color: white;
    padding: 1rem;
    border-radius: 6px;
    margin: 1rem 0;
    font-family: monospace;
}

.calculation-result {
    color: var(--primary-color);
    font-weight: bold;
}

.time-comparison {
    margin: 1.5rem 0;
    background-color: white;
    padding: 1rem;
    border-radius: 6px;
}

.time-entry {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
}

.time-entry:last-child {
    border-bottom: none;
}

.time-label {
    font-weight: 500;
}

.classical-time {
    color: #dc3545;
}

.quantum-time {
    color: var(--primary-color);
}

.simulation-result {
    margin-top: 1rem;
    min-height: 2rem;
}

/* Post-quantum crypto comparison */
.pqc-types {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.pqc-type {
    background-color: white;
    border-left: 4px solid var(--primary-color);
    padding: 1rem;
    border-radius: 0 4px 4px 0;
}

.comparison-table-container {
    overflow-x: auto;
    margin: 1rem 0;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
}

.comparison-table th, 
.comparison-table td {
    padding: 0.8rem;
    text-align: center;
    border: 1px solid #ddd;
}

.comparison-table th {
    background-color: #f0f4f8;
    font-weight: 600;
}

.comparison-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.secure {
    color: #28a745;
    font-weight: bold;
}

.vulnerable {
    color: #dc3545;
    font-weight: bold;
}

.partially-secure {
    color: #fd7e14;
    font-weight: bold;
}

.comparison-note {
    font-style: italic;
    margin-top: 0.5rem;
    color: #666;
}

/* QKD Demo */
.qkd-simulation {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.qkd-alice, .qkd-bob {
    flex: 1;
    min-width: 200px;
    background-color: white;
    border-radius: 6px;
    padding: 1rem;
}

.qkd-channel {
    flex: 2;
    min-width: 300px;
    height: 250px;
    background-color: #f0f4f8;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
}

.qkd-console {
    height: 200px;
    overflow-y: auto;
    background-color: #f0f4f8;
    padding: 0.5rem;
    border-radius: 4px;
    font-family: monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
}

.photon-stream {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
}

.photon {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: #ffeb3b;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(255, 235, 59, 0.8);
}

.eve-position {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.eve-icon {
    background-color: #dc3545;
    color: white;
    font-weight: bold;
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

.qkd-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    align-items: center;
}

.qkd-status {
    flex-grow: 1;
    background-color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    min-height: 1.5rem;
}

/* Quiz */
.quiz-container {
    padding: 0.5rem;
}

.quiz-question {
    margin-bottom: 1.5rem;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-left: 1rem;
}

.quiz-results {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #f0f4f8;
    border-radius: 4px;
    display: none;
}

/* Timeline visualization */
.timeline-visualization {
    margin: 2rem 0;
}

.timeline {
    display: flex;
    overflow-x: auto;
    padding: 2rem 0;
    position: relative;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--primary-color);
    transform: translateY(-50%);
}

.timeline-point {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.timeline-year {
    background-color: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.timeline-event {
    background-color: white;
    padding: 0.8rem;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    position: relative;
    z-index: 2;
    margin-top: 2rem;
}

.timeline-point::before {
    content: '';
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background-color: white;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    transform: translateY(-50%);
}

/* Code examples */
.code-example {
    background-color: #282c34;
    color: #abb2bf;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 1rem 0;
    font-family: monospace;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bit-comparison {
        flex-direction: column;
        gap: 1rem;
    }
    
    .shor-visual {
        flex-direction: column;
    }
    
    .pqc-types {
        grid-template-columns: 1fr;
    }
    
    .qkd-simulation {
        flex-direction: column;
    }
    
    .timeline-point {
        flex: 0 0 150px;
    }
    
    .timeline-year {
        font-size: 0.9rem;
        padding: 0.3rem 0.8rem;
    }
    
    .timeline-event {
        font-size: 0.9rem;
        padding: 0.5rem;
    }
}