/* Bitwise Calculator Styles */

/* Input and Visualization */
.bitwise-input {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
}

.bitwise-result {
    font-family: 'Courier New', monospace;
    letter-spacing: 1px;
    font-size: 1.5rem;
    font-weight: bold;
}

.value-info {
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.value-info div {
    margin-bottom: 0.25rem;
}

.bit-visualization {
    margin-top: 1rem;
}

.text-small {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.bits-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.bit-visual {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 0.875rem;
    border: 2px solid transparent;
}

.bit-0 {
    background-color: #9ca3af;
    color: white;
}

.bit-1 {
    background-color: #10b981;
    color: white;
}

/* Operations Section */
.operations-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.operations-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.op-btn {
    padding: 0.75rem;
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.op-btn:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.op-btn:active {
    transform: translateY(0);
}

/* Shift Section */
.shift-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.shift-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.shift-group {
    display: flex;
    flex-direction: column;
}

.shift-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.shift-control {
    display: flex;
    gap: 0.5rem;
}

.shift-control input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.shift-control input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.shift-control button {
    padding: 0.5rem 1rem;
}

/* Result Section */
.result-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.result-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.result-item {
    display: flex;
    flex-direction: column;
}

.result-item label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.result-box {
    padding: 1rem;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.result-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary);
    word-break: break-all;
    margin-bottom: 0.5rem;
}

.result-value:last-child {
    margin-bottom: 0;
}

/* Truth Table Section */
.truth-table-section {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-secondary);
    border-radius: 6px;
}

.truth-table-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.table-responsive {
    overflow-x: auto;
    margin-bottom: 0;
}

.truth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.truth-table thead {
    background-color: var(--border-color);
}

.truth-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
}

.truth-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.truth-table tbody tr:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

.text-center {
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .button-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .shift-control {
        flex-direction: column;
    }
    
    .shift-control button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .button-grid {
        grid-template-columns: 1fr;
    }
    
    .bits-container {
        gap: 0.125rem;
    }
    
    .bit-visual {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}