/* Integer to English Words - Algorithm-specific styles */

/* Digit Groups Display */
.digit-groups {
    display: flex;
    gap: 8px;
    justify-content: center;
    align-items: flex-end;
    margin: 20px 0;
    flex-wrap: wrap;
    min-height: 70px;
}

.digit-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.digit-group-digits {
    display: flex;
    gap: 3px;
}

.digit-box {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 18px;
    font-family: 'Courier New', monospace;
    border-radius: 6px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.digit-box.leading-zero {
    opacity: 0.3;
}

.group-separator {
    font-size: 24px;
    color: #666;
    align-self: center;
    margin-bottom: 20px;
}

.scale-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

/* Group colors */
.group-ones .digit-box {
    background: rgba(78, 205, 196, 0.15);
    border-color: #4ecdc4;
    color: #4ecdc4;
}
.group-ones .scale-label { color: #4ecdc4; }
.group-ones-legend { background: rgba(78, 205, 196, 0.3); border-color: #4ecdc4; }

.group-thousands .digit-box {
    background: rgba(0, 217, 255, 0.15);
    border-color: #00d9ff;
    color: #00d9ff;
}
.group-thousands .scale-label { color: #00d9ff; }
.group-thousands-legend { background: rgba(0, 217, 255, 0.3); border-color: #00d9ff; }

.group-millions .digit-box {
    background: rgba(230, 126, 34, 0.15);
    border-color: #e67e22;
    color: #e67e22;
}
.group-millions .scale-label { color: #e67e22; }
.group-millions-legend { background: rgba(230, 126, 34, 0.3); border-color: #e67e22; }

.group-billions .digit-box {
    background: rgba(155, 89, 182, 0.15);
    border-color: #9b59b6;
    color: #9b59b6;
}
.group-billions .scale-label { color: #9b59b6; }
.group-billions-legend { background: rgba(155, 89, 182, 0.3); border-color: #9b59b6; }

/* Active/completed group states */
.digit-group.active .digit-box {
    box-shadow: 0 0 12px currentColor;
    transform: scale(1.05);
}

.digit-group.completed .digit-box {
    opacity: 0.4;
}

/* Decomposition display */
.decomposition {
    background: #1e1e3f;
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0 20px;
    min-height: 50px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.decomp-step {
    display: flex;
    align-items: center;
    gap: 6px;
    animation: fadeIn 0.3s ease;
}

.decomp-value {
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    font-weight: bold;
    background: #2a2a4a;
    border: 1px solid #444;
    color: #ccc;
}

.decomp-value.highlight {
    border-color: #ffaa00;
    color: #ffaa00;
    background: #3a3a2a;
    box-shadow: 0 0 8px rgba(255, 170, 0, 0.3);
}

.decomp-arrow {
    color: #666;
    font-size: 16px;
}

.decomp-word {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    background: rgba(0, 255, 136, 0.1);
    border: 1px solid #00ff88;
    color: #00ff88;
    animation: fadeIn 0.3s ease;
}

/* Lookup Tables */
.lookup-section {
    display: flex;
    gap: 20px;
    margin: 10px 0 20px;
    flex-wrap: wrap;
}

.lookup-container {
    flex: 1;
    min-width: 200px;
}

.lookup-table {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}

.lookup-cell {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
    background: #2a2a4a;
    border: 1px solid #3a3a5a;
    border-radius: 4px;
    color: #888;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

.lookup-cell.active {
    background: #3a3a2a;
    border-color: #ffaa00;
    color: #ffaa00;
    box-shadow: 0 0 10px rgba(255, 170, 0, 0.5);
    transform: scale(1.15);
    z-index: 1;
}

.lookup-cell-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a2e;
    border: 1px solid #ffaa00;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 10px;
    color: #ffaa00;
    white-space: nowrap;
    margin-bottom: 4px;
    z-index: 10;
}

.lookup-cell.active .lookup-cell-tooltip {
    display: block;
}

/* Result Display */
.result-display {
    background: #1e1e3f;
    border-radius: 10px;
    padding: 16px;
    margin: 10px 0 20px;
    min-height: 40px;
    font-size: 18px;
    font-weight: bold;
    line-height: 1.6;
    word-wrap: break-word;
}

.result-word {
    padding: 2px 4px;
    border-radius: 3px;
    animation: fadeIn 0.3s ease;
    white-space: nowrap;
}

.result-word.group-ones-color { color: #4ecdc4; }
.result-word.group-thousands-color { color: #00d9ff; }
.result-word.group-millions-color { color: #e67e22; }
.result-word.group-billions-color { color: #9b59b6; }

/* Info panel layout */
.info-panel {
    grid-template-columns: repeat(4, 1fr);
}

/* Empty state text */
.empty-text {
    color: #555;
    font-style: italic;
    font-size: 13px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    .info-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .digit-box {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }

    .lookup-cell {
        width: 24px;
        height: 24px;
        font-size: 8px;
    }

    .result-display {
        font-size: 14px;
    }
}
