/* Kasiski Examination Tool - Styles */
/* Consistent with Matrix Portal theme */

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.tool-header {
    text-align: center;
    margin-bottom: 30px;
}

.tool-header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    color: #0f0;
    text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.subtitle {
    color: #0c0;
    font-size: 1.1em;
}

/* Breadcrumb Navigation */
.breadcrumb {
    margin-bottom: 20px;
    padding: 10px;
    background: rgba(0, 20, 0, 0.6);
    border-left: 3px solid #0f0;
    font-size: 0.9em;
}

.breadcrumb a {
    color: #0f0;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #0ff;
}

.breadcrumb span {
    color: #0c0;
}

/* Main Tool Box */
.tool-box {
    background: rgba(0, 20, 0, 0.8);
    border: 2px solid #0f0;
    border-radius: 5px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

/* Input Group */
.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    color: #0f0;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group textarea {
    width: 100%;
    padding: 12px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0f0;
    border-radius: 3px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    resize: vertical;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.input-group textarea:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.input-info {
    margin-top: 8px;
    color: #0c0;
    font-size: 0.85em;
}

/* Settings Group */
.settings-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 10, 0, 0.5);
    border: 1px solid #0a0;
    border-radius: 3px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    color: #0f0;
    font-size: 0.9em;
    font-weight: bold;
}

.setting-item input[type="number"] {
    padding: 8px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0f0;
    border-radius: 3px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
}

.setting-help {
    color: #0a0;
    font-size: 0.8em;
}

/* Analyze Button */
.analyze-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0a0, #0f0);
    border: 2px solid #0f0;
    border-radius: 5px;
    color: #000;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.analyze-btn:hover {
    background: linear-gradient(135deg, #0f0, #0ff);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
    transform: translateY(-2px);
}

.analyze-btn:active {
    transform: translateY(0);
}

/* Results Container */
.results-container {
    margin-top: 30px;
    display: none;
}

.results-container.active {
    display: block;
}

.result-section {
    background: rgba(0, 15, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 20px;
}

.result-section h3 {
    color: #0f0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Key Lengths Grid */
.key-lengths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.key-length-card {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0a0;
    border-radius: 5px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.key-length-card:hover {
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
    transform: translateY(-3px);
}

.key-length-card.top-pick {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.1);
}

.key-length-number {
    font-size: 2em;
    color: #0f0;
    font-weight: bold;
}

.key-length-score {
    color: #0c0;
    font-size: 0.85em;
    margin-top: 5px;
}

.key-length-confidence {
    color: #0a0;
    font-size: 0.75em;
    margin-top: 3px;
}

/* Toggle Section */
.toggle-section {
    margin: 15px 0;
}

.toggle-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 3px;
    padding: 10px 15px;
    color: #0f0;
    cursor: pointer;
    width: 100%;
    text-align: left;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.toggle-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
}

.toggle-btn span {
    display: inline-block;
    transition: transform 0.3s;
}

.toggle-btn.active span {
    transform: rotate(180deg);
}

/* Sequences Display */
.sequences-display {
    display: none;
    margin-top: 15px;
    overflow-x: auto;
}

.sequences-display.active {
    display: block;
}

.sequences-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.sequences-table thead {
    background: rgba(0, 255, 0, 0.1);
}

.sequences-table th {
    padding: 12px;
    color: #0f0;
    border: 1px solid #0a0;
    text-align: left;
    font-weight: bold;
}

.sequences-table td {
    padding: 10px;
    color: #0c0;
    border: 1px solid #0a0;
}

.sequences-table tbody tr:hover {
    background: rgba(0, 255, 0, 0.05);
}

.sequence-text {
    color: #0ff;
    font-weight: bold;
}

.position-list {
    color: #0a0;
    font-size: 0.85em;
}

.distance-list {
    color: #0f0;
}

.factors-list {
    color: #0c0;
}

/* Timeline Display */
.timeline-display {
    display: none;
    margin-top: 15px;
}

.timeline-display.active {
    display: block;
}

.timeline-canvas {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 3px;
    padding: 20px;
    min-height: 200px;
    position: relative;
    overflow-x: auto;
}

.timeline-row {
    margin-bottom: 15px;
    position: relative;
    height: 30px;
}

.timeline-label {
    color: #0f0;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.timeline-bar {
    position: relative;
    height: 8px;
    background: rgba(0, 50, 0, 0.3);
    border-radius: 4px;
}

.timeline-marker {
    position: absolute;
    width: 4px;
    height: 20px;
    background: #0ff;
    top: -6px;
    cursor: pointer;
    transition: all 0.3s;
}

.timeline-marker:hover {
    background: #0f0;
    height: 26px;
    top: -9px;
}

.timeline-marker.sequence-marker {
    background: #f0f;
    z-index: 2;
}

.timeline-legend {
    margin-top: 15px;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #0c0;
    font-size: 0.85em;
}

.color-box {
    width: 20px;
    height: 12px;
    border-radius: 2px;
}

.sequence-color {
    background: #f0f;
}

.distance-color {
    background: #0ff;
}

/* Factors Display */
.factors-display {
    display: none;
    margin-top: 15px;
}

.factors-display.active {
    display: block;
}

.factors-chart {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 3px;
    padding: 20px;
}

.factor-bar-container {
    margin-bottom: 12px;
}

.factor-label {
    color: #0f0;
    font-size: 0.9em;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
}

.factor-bar-bg {
    background: rgba(0, 50, 0, 0.3);
    height: 25px;
    border-radius: 3px;
    overflow: hidden;
}

.factor-bar {
    background: linear-gradient(90deg, #0a0, #0f0);
    height: 100%;
    transition: width 0.5s ease;
    display: flex;
    align-items: center;
    padding-left: 10px;
    color: #000;
    font-weight: bold;
    font-size: 0.85em;
}

/* IC Results */
.ic-results {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 3px;
    padding: 20px;
}

.ic-item {
    display: flex;
    justify-content: space-between;
    padding: 10px;
    border-bottom: 1px solid #0a0;
}

.ic-item:last-child {
    border-bottom: none;
}

.ic-label {
    color: #0c0;
    font-weight: bold;
}

.ic-value {
    color: #0f0;
    font-family: 'Courier New', monospace;
}

.ic-interpretation {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 255, 0, 0.05);
    border-left: 3px solid #0f0;
    color: #0c0;
    font-size: 0.9em;
    line-height: 1.6;
}

/* Export Section */
.export-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.export-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0a0;
    border-radius: 3px;
    color: #0f0;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
    font-weight: bold;
}

.export-btn:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0f0;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

/* Content Section */
.content-section {
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 5px;
    padding: 30px;
    margin-bottom: 30px;
    line-height: 1.8;
}

.content-section h2 {
    color: #0f0;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.content-section h3 {
    color: #0f0;
    margin-top: 25px;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.content-section h4 {
    color: #0c0;
    margin-top: 15px;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.content-section p {
    color: #0c0;
    margin-bottom: 15px;
}

.content-section ul,
.content-section ol {
    color: #0c0;
    margin-left: 25px;
    margin-bottom: 15px;
}

.content-section li {
    margin-bottom: 8px;
}

.content-section strong {
    color: #0f0;
}

.content-section code {
    background: rgba(0, 0, 0, 0.6);
    padding: 2px 6px;
    border-radius: 3px;
    color: #0ff;
    font-family: 'Courier New', monospace;
}

/* Example Box */
.example-box {
    background: rgba(0, 0, 0, 0.6);
    border-left: 3px solid #0f0;
    padding: 20px;
    margin: 20px 0;
    border-radius: 0 3px 3px 0;
}

.example-box p {
    margin-bottom: 10px;
}

.example-box code {
    display: block;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0a0;
    border-radius: 3px;
    margin: 10px 0;
    overflow-x: auto;
}

/* Process Steps */
.process-steps {
    margin: 25px 0;
}

.step-item {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
    border: 1px solid #0a0;
}

.step-number {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #0a0, #0f0);
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    font-weight: bold;
}

.step-content h4 {
    color: #0f0;
    margin-bottom: 8px;
}

.step-content p {
    color: #0c0;
    margin: 0;
}

/* Tips Box */
.tips-box {
    background: rgba(0, 100, 0, 0.1);
    border: 2px solid #0f0;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.tips-box h4 {
    color: #0f0;
    margin-bottom: 12px;
}

.tips-box ul {
    color: #0c0;
    margin-left: 20px;
}

/* FAQ Section */
.faq-section {
    background: rgba(0, 20, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 5px;
    padding: 30px;
    margin-bottom: 30px;
}

.faq-section h2 {
    color: #0f0;
    margin-bottom: 25px;
    font-size: 1.8em;
}

.faq-item {
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #0a0;
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item h3 {
    color: #0f0;
    margin-bottom: 12px;
    font-size: 1.2em;
}

.faq-item p {
    color: #0c0;
    line-height: 1.7;
}

/* Footer */
.tool-footer {
    text-align: center;
    padding: 20px;
    color: #0a0;
    font-size: 0.9em;
}

.tool-footer p {
    margin-bottom: 8px;
}

.tool-footer code {
    background: rgba(0, 0, 0, 0.6);
    padding: 3px 8px;
    border-radius: 3px;
    color: #0ff;
}

/* Decryption Section */
.decryption-section {
    background: rgba(0, 30, 0, 0.7);
    border: 2px solid #0ff;
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.2);
}

.decryption-intro {
    margin-bottom: 20px;
    padding: 15px;
    background: rgba(0, 255, 255, 0.05);
    border-left: 3px solid #0ff;
    color: #0c0;
    font-size: 0.95em;
}

.key-length-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 5px;
}

.key-length-selector label {
    color: #0ff;
    font-weight: bold;
    white-space: nowrap;
}

.key-length-select {
    flex: 1;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0ff;
    border-radius: 3px;
    color: #0f0;
    font-family: 'Courier New', monospace;
    font-size: 1em;
}

.key-length-select:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.decrypt-analyze-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #0aa, #0ff);
    border: 2px solid #0ff;
    border-radius: 5px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.decrypt-analyze-btn:hover {
    background: linear-gradient(135deg, #0ff, #0ff);
    box-shadow: 0 0 20px rgba(0, 255, 255, 0.6);
    transform: translateY(-2px);
}

.decrypt-analyze-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Position Analysis */
.position-analysis-container {
    display: none;
    margin-top: 20px;
}

.position-analysis-container.active {
    display: block;
}

.position-card {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0a0;
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 15px;
}

.position-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.position-title {
    color: #0ff;
    font-size: 1.1em;
    font-weight: bold;
}

.position-subtitle {
    color: #0a0;
    font-size: 0.85em;
}

.frequency-bars {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(30px, 1fr));
    gap: 5px;
    margin: 15px 0;
}

.freq-bar-container {
    text-align: center;
}

.freq-letter {
    color: #0f0;
    font-size: 0.8em;
    margin-bottom: 3px;
}

.freq-bar-wrapper {
    height: 100px;
    display: flex;
    align-items: flex-end;
    background: rgba(0, 50, 0, 0.2);
    border-radius: 2px;
}

.freq-bar {
    width: 100%;
    background: linear-gradient(180deg, #0ff, #0a0);
    border-radius: 2px 2px 0 0;
    transition: height 0.5s ease;
    position: relative;
}

.freq-bar.english-comparison {
    background: linear-gradient(180deg, #f90, #fa0);
}

.freq-count {
    color: #0a0;
    font-size: 0.7em;
    margin-top: 3px;
}

.shift-suggestions {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0, 100, 100, 0.1);
    border-left: 3px solid #0ff;
}

.shift-suggestions h5 {
    color: #0ff;
    margin-bottom: 10px;
}

.shift-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.shift-option {
    padding: 8px 15px;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 3px;
    color: #0f0;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Courier New', monospace;
}

.shift-option:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #0ff;
}

.shift-option.selected {
    background: rgba(0, 255, 255, 0.2);
    border-color: #0ff;
    color: #0ff;
    font-weight: bold;
}

/* Key Reconstruction */
.key-reconstruction-container {
    display: none;
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 20, 20, 0.6);
    border: 2px solid #0ff;
    border-radius: 5px;
}

.key-reconstruction-container.active {
    display: block;
}

.key-reconstruction-container h4 {
    color: #0ff;
    margin-bottom: 15px;
}

.key-input-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.key-position-input {
    text-align: center;
}

.key-position-input label {
    display: block;
    color: #0c0;
    font-size: 0.85em;
    margin-bottom: 5px;
}

.key-position-input input {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0a0;
    border-radius: 3px;
    color: #0ff;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    font-family: 'Courier New', monospace;
    text-transform: uppercase;
}

.key-position-input input:focus {
    outline: none;
    border-color: #0ff;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3);
}

.key-display {
    margin-bottom: 20px;
}

.key-display label {
    display: block;
    color: #0ff;
    font-weight: bold;
    margin-bottom: 8px;
}

.reconstructed-key-input {
    width: 100%;
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #0ff;
    border-radius: 5px;
    color: #0ff;
    font-size: 1.5em;
    font-weight: bold;
    text-align: center;
    font-family: 'Courier New', monospace;
    letter-spacing: 5px;
}

.decrypt-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #0aa, #0ff);
    border: 2px solid #0ff;
    border-radius: 5px;
    color: #000;
    font-size: 1.2em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.decrypt-btn:hover {
    background: linear-gradient(135deg, #0ff, #0ff);
    box-shadow: 0 0 30px rgba(0, 255, 255, 0.8);
    transform: translateY(-2px);
}

.decrypt-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Decrypted Output */
.decrypted-output-container {
    display: none;
    margin-top: 25px;
    padding: 20px;
    background: rgba(0, 50, 0, 0.3);
    border: 2px solid #0f0;
    border-radius: 5px;
}

.decrypted-output-container.active {
    display: block;
    animation: successPulse 1s ease;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 20px rgba(0, 255, 0, 0.3); }
    50% { box-shadow: 0 0 40px rgba(0, 255, 0, 0.6); }
}

.decrypted-output-container h4 {
    color: #0f0;
    margin-bottom: 15px;
}

.output-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.comparison-pane {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid #0a0;
    border-radius: 5px;
    padding: 15px;
}

.comparison-pane label {
    display: block;
    color: #0c0;
    font-weight: bold;
    margin-bottom: 10px;
    font-size: 0.9em;
}

.comparison-text {
    padding: 15px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #0a0;
    border-radius: 3px;
    color: #0a0;
    font-family: 'Courier New', monospace;
    font-size: 0.95em;
    line-height: 1.6;
    max-height: 300px;
    overflow-y: auto;
    word-wrap: break-word;
}

.comparison-text.decrypted-text {
    color: #0f0;
    border-color: #0f0;
}

.decrypt-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.decrypt-actions .copy-btn,
.decrypt-actions .export-btn {
    flex: 1;
    min-width: 200px;
}

/* Frequency Comparison Section */
.comparison-section {
    margin-top: 15px;
}

.comparison-toggle {
    width: 100%;
    margin-bottom: 0;
}

.frequency-comparison {
    display: none;
    margin-top: 15px;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #0a0;
    border-radius: 5px;
}

.frequency-comparison.active {
    display: block;
}

.comparison-info {
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(0, 100, 100, 0.1);
    border-left: 3px solid #0ff;
    color: #0c0;
    font-size: 0.9em;
}

.comparison-info p {
    margin: 5px 0;
}

/* Frequency Comparison Table */
.frequency-comparison-table {
    margin: 15px 0;
    max-height: 400px;
    overflow-y: auto;
}

.comparison-row {
    display: grid;
    grid-template-columns: 80px 80px 1fr 1fr 80px;
    gap: 10px;
    padding: 8px;
    border-bottom: 1px solid #0a0;
    align-items: center;
}

.comparison-header {
    background: rgba(0, 255, 0, 0.1);
    font-weight: bold;
    color: #0f0;
    position: sticky;
    top: 0;
    z-index: 1;
}

.comparison-cell {
    color: #0c0;
    font-size: 0.9em;
}

.cipher-letter {
    color: #0ff;
    font-weight: bold;
    font-size: 1.1em;
}

.plain-letter {
    color: #0f0;
    font-weight: bold;
}

/* Mini frequency bars in comparison */
.mini-bar-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.mini-bar {
    height: 20px;
    border-radius: 2px;
    transition: width 0.3s ease;
}

.cipher-bar {
    background: linear-gradient(90deg, #0aa, #0ff);
}

.english-bar {
    background: linear-gradient(90deg, #a60, #f90);
}

.bar-value {
    color: #0c0;
    font-size: 0.85em;
    min-width: 40px;
}

/* Match quality indicators */
.good-match {
    color: #0f0;
    font-weight: bold;
}

.ok-match {
    color: #ff0;
}

.poor-match {
    color: #f90;
}

/* Comparison Summary */
.comparison-summary {
    margin: 15px 0;
    padding: 12px;
    background: rgba(0, 255, 255, 0.1);
    border: 1px solid #0ff;
    border-radius: 3px;
    color: #0ff;
    text-align: center;
}

/* Try All Shifts Button */
.try-all-shifts-btn {
    width: 100%;
    padding: 12px;
    margin-top: 15px;
    background: linear-gradient(135deg, #0a0, #0f0);
    border: 2px solid #0f0;
    border-radius: 5px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.try-all-shifts-btn:hover {
    background: linear-gradient(135deg, #0f0, #0ff);
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
    transform: translateY(-2px);
}

/* All Shifts Comparison Grid */
.all-shifts-comparison {
    margin-top: 15px;
}

.all-shifts-comparison h5 {
    color: #0ff;
    margin-bottom: 15px;
    text-align: center;
}

.shifts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.shift-card {
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid #0a0;
    border-radius: 5px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
}

.shift-card:hover {
    border-color: #0f0;
    background: rgba(0, 255, 0, 0.05);
    transform: translateY(-3px);
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.shift-card.best-shift {
    border-color: #0ff;
    background: rgba(0, 255, 255, 0.1);
}

.shift-card.selected {
    border-color: #f0f;
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 20px rgba(255, 0, 255, 0.4);
}

.shift-key-letter {
    font-size: 2em;
    color: #0f0;
    font-weight: bold;
    margin-bottom: 5px;
}

.shift-number {
    color: #0c0;
    font-size: 0.85em;
    margin-bottom: 3px;
}

.shift-score {
    color: #0a0;
    font-size: 0.75em;
    margin-bottom: 3px;
}

.shift-rank {
    color: #0ff;
    font-size: 0.7em;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tool-container {
        padding: 15px;
    }

    .tool-box {
        padding: 20px;
    }

    .tool-header h1 {
        font-size: 2em;
    }

    .settings-group {
        grid-template-columns: 1fr;
    }

    .key-lengths-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    }

    .export-buttons {
        flex-direction: column;
    }

    .export-btn {
        min-width: 100%;
    }

    .step-item {
        flex-direction: column;
        text-align: center;
    }

    .step-number {
        margin: 0 auto;
    }
    
    /* Decryption mobile styles */
    .key-length-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .decrypt-analyze-btn {
        width: 100%;
    }
    
    .frequency-bars {
        grid-template-columns: repeat(13, 1fr);
        gap: 3px;
    }
    
    .freq-letter {
        font-size: 0.7em;
    }
    
    .freq-bar-wrapper {
        height: 60px;
    }
    
    .freq-count {
        font-size: 0.65em;
    }
    
    .shift-options {
        flex-direction: column;
    }
    
    .shift-option {
        width: 100%;
    }
    
    .key-input-grid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
        gap: 10px;
    }
    
    .output-comparison {
        grid-template-columns: 1fr;
    }
    
    .decrypt-actions {
        flex-direction: column;
    }
    
    .decrypt-actions .copy-btn,
    .decrypt-actions .export-btn {
        min-width: 100%;
    }
    
    /* Comparison table mobile */
    .comparison-row {
        grid-template-columns: 60px 60px 1fr 1fr 60px;
        gap: 5px;
        padding: 6px;
        font-size: 0.85em;
    }
    
    .mini-bar-container {
        flex-direction: column;
        gap: 3px;
    }
    
    .bar-value {
        font-size: 0.75em;
        min-width: auto;
    }
    
    .shifts-grid {
        grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
        gap: 8px;
    }
    
    .shift-card {
        padding: 8px;
    }
    
    .shift-key-letter {
        font-size: 1.5em;
    }
}

/* Loading State */
.analyze-btn.loading {
    background: rgba(0, 100, 0, 0.3);
    cursor: not-allowed;
    pointer-events: none;
}

.analyze-btn.loading::after {
    content: " Processing...";
}

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

.result-section {
    animation: fadeIn 0.5s ease;
}

.key-length-card {
    animation: fadeIn 0.3s ease backwards;
}

.key-length-card:nth-child(1) { animation-delay: 0.05s; }
.key-length-card:nth-child(2) { animation-delay: 0.1s; }
.key-length-card:nth-child(3) { animation-delay: 0.15s; }
.key-length-card:nth-child(4) { animation-delay: 0.2s; }
.key-length-card:nth-child(5) { animation-delay: 0.25s; }