/* Styles specific to the Playfair cipher lesson */

/* Playfair grid display */
.playfair-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    margin: 1rem 0;
    max-width: 300px;
}

.playfair-grid-example {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2px;
    margin: 1rem 0;
    max-width: 300px;
}

.grid-cell {
    background-color: #f0f4f8;
    border: 1px solid #ddd;
    padding: 0.5rem;
    text-align: center;
    font-weight: bold;
    font-family: monospace;
}

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

.result-cell {
    background-color: var(--secondary-color);
    color: white;
}

/* Playfair rule visualization */
.playfair-visualization {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.rule-explanation {
    padding: 1rem;
    background-color: #f8f9fa;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1rem;
}

/* Process steps display */
.process-steps {
    font-family: monospace;
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    white-space: pre-wrap;
    line-height: 1.6;
}

.grid-display {
    margin: 1rem 0;
}

.digraph {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    margin: 0.2rem;
    background-color: #f0f4f8;
    border-radius: 3px;
    font-family: monospace;
}

.digraph-arrow {
    display: inline-block;
    padding: 0 0.5rem;
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .playfair-visualization {
        flex-direction: row;
        align-items: flex-start;
    }
    
    .playfair-grid {
        flex: 0 0 300px;
    }
    
    .rule-explanation {
        flex: 1;
    }
}

@media (max-width: 767px) {
    .playfair-grid, 
    .playfair-grid-example {
        max-width: 100%;
    }
    
    .grid-cell {
        padding: 0.3rem;
    }
}