/* static/css/hill.css */

/* --- Hill Cipher specific styles --- */

/* Hill-specific result box styling */
#result-section .result-box {
    font-size: 0.9rem;      /* Slightly smaller font for the long hash string */
    letter-spacing: 1px;   /* Add some space between characters */
    line-height: 1.8;      /* Increase line height if the hash wraps */
}

/* Ensure the image in the 'About' section has a neutral background in case of transparency */
#about .info-image img {
    background-color: #ffffff; /* A white background for the diagram */
    padding: 10px;             /* Add some padding around the image */
    border: 1px solid var(--border-color); /* Use the theme's border color */
}

/* Style the icon for the hash generation button */
#process-btn .btn-icon .fa-cog {
    transition: transform 0.8s ease-in-out;
}

#process-btn:hover .btn-icon .fa-cog {
    transform: rotate(360deg);
}

/* Hill cipher specific input type support - extends caesar.css input styling */
textarea, input[type="text"], select {
    width: 100%;
    padding: 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    transition: border 0.3s, box-shadow 0.3s, background-color 0.3s;
    background-color: var(--input-bg);
    color: var(--light-color);
}

textarea:focus, input[type="text"]:focus, select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: var(--glow-effect);
}

/* Hill Cipher Specific Visualization Styles */
.shift-visualization {
    overflow-x: auto;
    margin: 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 0, 0, 0.02) 100%);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
}

.shift-visualization:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(255, 0, 0, 0.1);
}

.visualization-guide {
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    color: var(--light-color);
    font-weight: 500;
    padding: 1rem;
    background: rgba(255, 0, 0, 0.08);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.visualization-info {
    text-align: center;
    margin-top: 2rem;
    padding: 1.2rem;
    font-size: 1rem;
    color: var(--light-color);
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.1), rgba(255, 0, 0, 0.05));
    border-radius: 12px;
    border: 2px solid rgba(255, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.1);
}

.visualization-info.active {
    background: linear-gradient(135deg, rgba(255, 0, 0, 0.15), rgba(255, 0, 0, 0.08));
    border-color: rgba(255, 0, 0, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 0, 0, 0.15);
}

/* Enhanced matrix and vector styling */
.matrix-step {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.matrix-step:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.step-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.step-number {
    background: var(--primary-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

.matrix-operation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    padding: 1rem 0;
}

.operation-symbol {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    min-width: 30px;
    text-align: center;
}

.matrix-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.matrix-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--light-color);
    opacity: 0.8;
}

.result-highlight {
    background: linear-gradient(135deg, rgba(0, 255, 153, 0.1), rgba(0, 255, 153, 0.05));
    border: 2px solid rgba(0, 255, 153, 0.3);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
    text-align: center;
}

.result-text {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00ff99;
    font-family: 'Consolas', monospace;
}

/* Matrix input grid styling */
#matrix-input-grid {
    display: inline-block;
    margin: 0.5rem 0;
}
#matrix-input-grid input[type="text"] {
    width: 55px;
    height: 50px;
    margin: 2px;
    text-align: center;
    font-size: 1.1rem;
    border: 2px solid #ff0000;
    border-radius: 4px;
    background: #181818;
    color: #fff;
    font-weight: 600;
    outline: none;
    transition: all 0.2s;
    box-shadow: 0 0 6px rgba(255, 0, 0, 0.3), 0 2px 4px rgba(0, 0, 0, 0.2);
}
#matrix-input-grid input[type="text"]:focus {
    border: 2px solid #ff0000;
    background: #222;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5), 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Visualization matrix/vector table styling */
.matrix-visual table {
    margin: 0 auto 1rem auto;
    border-collapse: collapse; /* For Hill cipher, collapse is usually better */
    background: #181818;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(255,0,0,0.08);
}
.matrix-visual td {
    border: 2px solid var(--primary-color); /* Use var for theme consistency */
    padding: 10px 18px;
    font-size: 1.1rem;
    color: var(--light-color); /* Use var for theme consistency */
    background: var(--input-bg); /* Use var for theme consistency */
    text-align: center;
    min-width: 32px;
    border-radius: 4px;
    font-weight: 600;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.4), 0 2px 4px rgba(0, 0, 0, 0.3);
}
.vector-visual { /* This seems unused, keep for consistency if it was in paste.txt */
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1rem;
}
.vector-visual .vector-block { /* This seems unused, keep for consistency if it was in paste.txt */
    background: #181818;
    border: 1.5px solid #ff3333;
    border-radius: 6px;
    padding: 8px 16px;
    color: #fff;
    font-family: 'Consolas', monospace;
    font-size: 1.1rem;
    margin: 2px 0;
    box-shadow: 0 1px 4px rgba(255,0,0,0.07);
}

/* Hill-specific responsive adjustments only */
@media (max-width: 768px) {
    .matrix-operation {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .operation-symbol {
        font-size: 1.5rem;
        transform: rotate(90deg); /* Rotate symbol for vertical layout */
    }
    .matrix-step {
        padding: 1rem;
        margin: 1rem 0;
    }
    .step-title {
        font-size: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    .visualization-guide {
        font-size: 0.9rem;
        padding: 0.8rem;
    }
}

@media (max-width: 480px) {
    .matrix-operation > div {
        max-width: 100%;
        overflow-x: auto;
    }
    .shift-visualization h3 {
        font-size: 1.3rem;
    }
    .step-title {
        font-size: 0.9rem;
    }
}
