/* Vigenère Cipher Lesson Styles */

/* Vigenère Square */
.vigenere-square-container {
    margin: 2rem 0;
    overflow-x: auto;
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
}

.vigenere-square {
    display: inline-block;
    min-width: 100%;
}

.square-row {
    display: flex;
    margin: 0;
}

.square-cell {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    font-size: 11px;
    font-weight: 500;
    background: white;
    font-family: monospace;
}

.square-cell.header {
    background: #4a90e2;
    color: white;
    font-weight: bold;
}

.square-cell.corner {
    background: #2c5aa0;
}

.square-cell:hover:not(.header) {
    background: #e3f2fd;
    cursor: pointer;
}

/* Vigenère alignment example */
.vigenere-align {
    font-family: monospace;
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    line-height: 1.8;
}

.vigenere-align span {
    display: block;
}

/* Formula boxes */
.formula-box {
    background: #e8f4f8;
    border-left: 4px solid #4a90e2;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-radius: 4px;
}

.formula-box p {
    margin: 0.5rem 0;
    font-family: 'Georgia', serif;
}

.formula-box ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.formula-box ul li {
    margin: 0.3rem 0;
    font-size: 0.95rem;
}

/* Visualization display */
.visualization-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.visualization-display {
    background: #f8f9fa;
    border: 2px solid #4a90e2;
    border-radius: 8px;
    padding: 2rem;
    min-height: 150px;
}

.viz-step {
    animation: fadeIn 0.3s ease-in;
}

.viz-text {
    font-family: monospace;
    font-size: 1.1rem;
    background: white;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

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

/* History note styling */
.history-note {
    background: #fff9e6;
    border-left: 4px solid #ffa500;
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 4px;
}

.history-note h3 {
    color: #cc8400;
    margin-top: 0;
}

/* Interactive demo enhancements */
.result-group {
    margin-top: 1.5rem;
}

.result-group h4 {
    margin-bottom: 0.5rem;
    color: #333;
}

.process-steps {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 400px;
    overflow-y: auto;
}

/* Grid cell highlighting for visualization */
.grid-cell.highlighted {
    background: #ffeb3b !important;
    border: 2px solid #fbc02d;
    font-weight: bold;
}

.grid-cell.result-cell {
    background: #4caf50 !important;
    color: white;
    font-weight: bold;
}

/* Responsive design */
@media (max-width: 768px) {
    .square-cell {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    
    .vigenere-square-container {
        padding: 0.5rem;
    }
    
    .visualization-controls {
        flex-direction: column;
    }
    
    .visualization-controls .btn-small {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .square-cell {
        width: 20px;
        height: 20px;
        font-size: 8px;
    }
    
    .vigenere-align {
        font-size: 0.85rem;
        padding: 0.75rem;
    }
}

/* Analysis result styling */
#analysisResult {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 1rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.9rem;
    white-space: pre-wrap;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
}

/* Button group spacing */
.button-group {
    display: flex;
    gap: 0.5rem;
    margin: 1rem 0;
    flex-wrap: wrap;
}

.button-group .btn-small {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 600px) {
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn-small {
        width: 100%;
    }
}
