* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #121212;
    color: #e0e0e0;
    margin: 0;
    padding: 0;
    line-height: 1.6;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.container {
    display: flex;
    flex: 1;
    height: calc(100vh - 40px); /* Replaced --footer-height with 40px */
    overflow: hidden;
}

.sidebar {
    width: 300px;
    background-color: #1a1a1a;
    padding: 20px;
    overflow-y: auto;
    border-right: 1px solid #333;
    flex-shrink: 0;
    height: 100%;
}

.content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    height: 100%;
}

.content-card {
    background-color: #1e1e1e;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
}

.sidebar h2 {
    color: #bb86fc;
    font-size: 1.5em;
    margin-bottom: 15px;
}

.sidebar h3 {
    color: #03dac6;
    font-size: 1.2em;
    margin: 20px 0 10px;
}

.cipher-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cipher-list li {
    padding: 10px;
    margin: 5px 0;
    background-color: #252525;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.cipher-list li:hover {
    background-color: #333;
}

.cipher-list li.active {
    background-color: #bb86fc;
    color: #000;
}

h1, h2 {
    color: #bb86fc;
}

h3 {
    color: #bb86fc;
}

h4 {
    color: #03dac6;
}

.btn {
    background-color: #bb86fc;
    color: #000;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
}

.btn:hover {
    background-color: #9a67ea;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #03dac6;
    color: #000;
}

.btn-secondary:hover {
    background-color: #00b9a9;
}

.overview {
    font-style: italic;
    color: #b0b0b0;
    margin-top: 5px;
}

.demo-container, .animation-container {
    height: 200px;
    border: 1px dashed #333;
    border-radius: 4px;
    margin: 15px 0;
    position: relative;
    overflow: hidden;
}

.math-step {
    margin: 15px 0;
    padding: 10px;
    background-color: #252525;
    border-left: 4px solid #03dac6;
    border-radius: 0 4px 4px 0;
}

.key-display {
    font-family: monospace;
    background-color: #252525;
    padding: 10px;
    border-radius: 4px;
    word-break: break-all;
}

input, textarea {
    background-color: #2d2d2d;
    border: 1px solid #333;
    color: #e0e0e0;
    padding: 8px;
    border-radius: 4px;
    width: 100%;
    margin-bottom: 10px;
}

.message-block {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    font-family: monospace;
}

.encrypted {
    background-color: #2d2d5a;
    border-left: 4px solid #bb86fc;
}

.decrypted {
    background-color: #2d5a2d;
    border-left: 4px solid #03dac6;
}

.error-message {
    color: #cf6679;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    background-color: #5a2d2d;
    border-left: 4px solid #cf6679;
    display: none;
}

.warning-message {
    color: #ffa726;
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
    background-color: #3d2f1a;
    border-left: 4px solid #ffa726;
    display: none;
}

.rules-list {
    background-color: #252525;
    padding: 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.rules-list li {
    margin: 8px 0;
}

.vulnerability {
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
    background-color: #5a2d2d;
    border-left: 4px solid #cf6679;
}

.tab-container {
    display: flex;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #252525;
    border: 1px solid #333;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
}

.tab.active {
    background-color: #1e1e1e;
    border-bottom: 1px solid #1e1e1e;
    color: #bb86fc;
}

.tab-content {
    display: none;
}

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

.progress-container {
    width: 100%;
    background-color: #252525;
    border-radius: 4px;
    margin: 20px 0;
}

.progress-bar {
    height: 20px;
    background-color: #bb86fc;
    border-radius: 4px;
    width: 0%;
    transition: width 0.5s;
}

.logo {
    width: 100px;
    margin-bottom: 20px;
    display: block;
}

footer {
    background-color: #1a1a1a;
    padding: 10px 20px;
    text-align: center;
    border-top: 1px solid #333;
    color: #b0b0b0;
    font-size: 0.9em;
    height: 40px; /* Replaced --footer-height with 40px */
    flex-shrink: 0;
}

footer a {
    color: #bb86fc;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.animation-container + .btn {
    margin-top: 10px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.caesar-wheel {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto;
}

.wheel-outer, .wheel-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    transition: transform 0.5s ease;
}

.wheel-outer {
    background-color: #03dac6;
    opacity: 0.8;
}

.wheel-inner {
    background-color: #bb86fc;
    width: 160px;
    height: 160px;
    top: 20px;
    left: 20px;
    opacity: 0.9;
}

.wheel-letter {
    position: absolute;
    width: 20px;
    height: 20px;
    text-align: center;
    color: #e0e0e0;
    font-family: monospace;
    font-size: 14px;
    top: 50%;
    left: 50%;
    transform-origin: center;
}

.caesar-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
    font-family: monospace;
    background-color: #1e1e1e;
}

.caesar-table th, .caesar-table td {
    border: 1px solid #e0e0e0;
    padding: 5px;
    text-align: center;
}

.caesar-table th {
    background-color: #03dac6;
    color: #e0e0e0;
}

.caesar-table td {
    background-color: #bb86fc;
    color: #e0e0e0;
}

.cipher-cell.highlight-plain {
    background-color: #ffeb3b;
    color: #000;
}

.cipher-cell.highlight-cipher {
    background-color: #f06292;
    color: #000;
}

.frequency-table {
    width: 50%;
    border-collapse: collapse;
    margin: 10px 0;
    font-size: 14px;
    font-family: monospace;
}

.frequency-table th, .frequency-table td {
    border: 1px solid #e0e0e0;
    padding: 5px;
    text-align: center;
}

.frequency-table th {
    background-color: #cf6679;
    color: #e0e0e0;
}

.frequency-table td {
    background-color: #1e1e1e;
}

.freq-plain {
    transition: background-color 0.5s ease;
}

.freq-plain.highlight {
    background-color: #ffeb3b;
}

.shift-controls {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.arrow-btn {
    width: 40px;
    font-size: 18px;
    padding: 5px;
}

#shift-counter {
    text-align: center;
    margin-top: 10px;
    font-size: 14px;
    color: #e0e0e0;
}

.tab-container {
    margin-bottom: 10px;
}

.tab {
    cursor: pointer;
    display: inline-block;
    padding: 8px 16px;
    background-color: #f0f0f0;
    border-radius: 4px 4px 0 0;
}

.tab.active {
    background-color: #007bff;
    color: white;
}

.tab-content {
    display: none;
}

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

.key-inputs {
    margin: 10px 0;
}

.key-inputs label {
    margin-right: 15px;
}

textarea {
    width: 100%;
    height: 80px;
    margin-top: 10px;
}

.message-block {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
}

.message-block.encrypted {
    background-color: #e6f3ff;
}

.message-block.decrypted {
    background-color: #e6ffe6;
}

.affine-example {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 10px 0;
}

.letter-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #007bff;
    color: white;
    border-radius: 4px;
    font-size: 18px;
}

.arrow {
    font-size: 24px;
}

.pulse {
    animation: pulse 0.3s ease-in-out;
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}