/* Layout Principal */
.sc-caesar-cipher-wrapper {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
}

.sc-caesar-cipher-wrapper.layout-block {
    flex-direction: column;
}

/* Boxes (Padrão Scout Codes) */
.sc-caesar-cipher-wrapper .sc-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
}

.sc-caesar-cipher-wrapper .sc-toolbar {
    background: linear-gradient(135deg, rgb(35, 60, 43) 0%, rgb(82, 128, 95) 24%, rgb(35, 60, 43) 100%);
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    gap: 10px;
}

.sc-caesar-cipher-wrapper .sc-label {
    font-weight: bold;
    font-size: 13px;
    color: #FFF;
    text-transform: uppercase;
}

.sc-caesar-cipher-wrapper .sc-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* Botões da Toolbar */
.sc-caesar-cipher-wrapper .sc-btn-action {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #FFF;
    padding: 5px 10px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px; 
    line-height: 1;
}

.sc-caesar-cipher-wrapper .sc-btn-action:hover {
    background-color: #e0e0e0;
    color: #000;
    border-color: #ccc;
}

.sc-caesar-cipher-wrapper .sc-btn-action i {
    font-size: 14px;
    pointer-events: none;
}

/* Textareas */
.sc-caesar-cipher-wrapper .sc-textarea {
    width: 100%;
    min-height: 120px;
    border: none;
    padding: 15px;
    resize: vertical;
    font-size: 16px;
    background: #deefe4;
    color: #333;
    box-sizing: border-box;
    font-family: monospace;
}
.sc-caesar-cipher-wrapper .sc-textarea:focus { outline: none; }

/* Output com Fonte Personalizada */
.sc-caesar-cipher-wrapper .sc-js-output {
    font-family: 'Shine Bubble', 'Courier New', monospace;
    text-align: center;
    font-size: 26px;
    line-height: 1.5;
}

/* --- ÁREA DE CONTROLES CENTRAL --- */
.sc-caesar-cipher-wrapper .sc-controls-area {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    gap: 20px;
    flex-wrap: wrap;
}

/* Grupo do Deslocamento */
.sc-control-group-shift {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    padding: 5px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.sc-label-shift {
    font-weight: bold;
    font-size: 14px;
    color: #333;
}

.sc-input-shift {
    width: 70px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 16px;
    text-align: center;
}
/* --- TABELA DO ALFABETO (AJUSTADA) --- */
.sc-alphabet-table-wrapper {
    /* O Segredo: fit-content tira o espaço vazio, max-width força o scroll no mobile */
    width: -moz-fit-content;
    width: fit-content;
    max-width: 100%;
    
    /* Centralização */
    margin: 0 auto 20px auto;
    
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    
    /* Rolagem Horizontal */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; 
}

/* Scrollbar Customizada */
.sc-alphabet-table-wrapper::-webkit-scrollbar {
    height: 6px; /* Barra um pouco mais fina para combinar com a tabela menor */
}
.sc-alphabet-table-wrapper::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}
.sc-alphabet-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sc-alphabet-grid {
    display: grid;
    /* Seu ajuste: 26 colunas de 20px */
    grid-template-columns: repeat(26, 20px);
    width: max-content; /* Garante que as células não esmaguem */
}

.sc-cell-column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid #eee;
}
/* Remove a borda da última coluna para não duplicar com a borda do wrapper */
.sc-cell-column:last-child {
    border-right: none;
}

.sc-cell-top, 
.sc-cell-bottom {
    /* Ajustei a altura para ficar proporcional à largura de 20px */
    height: 30px; 
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: monospace;
    /* Fonte reduzida para caber nos 20px */
    font-size: 12px; 
    font-weight: bold;
    overflow: hidden; /* Evita que letras largas quebrem o layout */
}

/* Linha Superior (Alfabeto Normal) */
.sc-cell-top {
    background-color: #f4f4f4;
    color: #555;
    border-bottom: 1px solid #ddd;
}

/* Linha Inferior (Deslocado) */
.sc-cell-bottom {
    background-color: #fff;
    color: #000;
}