/* Number Base Converter Specific Styles */

/* Converter Grid */
.converter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

@media (max-width: 768px) {
    .converter-grid {
        grid-template-columns: 1fr;
    }
}

/* Base Input Styles */
.base-input {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.base-input:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.base-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.base-field {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1.125rem;
    font-family: 'Fira Code', 'Monaco', monospace;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    transition: border-color 0.2s;
}

.base-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.base-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* Badge Styles */
.badge {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge.bin {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.badge.dec {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success-color);
}

.badge.hex {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-color);
}

.badge.oct {
    background: rgba(14, 165, 233, 0.15);
    color: var(--secondary-color);
}

/* Bit Visualization */
.bit-visual {
    padding: 1rem 0;
}

.bit-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.bit-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 64px;
    border-radius: var(--radius-sm);
    font-family: 'Fira Code', monospace;
    transition: all 0.2s;
}

.bit-cell.one {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.bit-cell.zero {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border-color);
}

.bit-value {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.bit-position {
    font-size: 0.65rem;
    margin-top: 0.25rem;
    opacity: 0.8;
}

.bit-position sup {
    font-size: 0.5rem;
}

/* Power Breakdown */
.power-breakdown {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 1.25rem;
}

.power-breakdown h4 {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.power-formula {
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.power-term {
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}

.power-term.active {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
}

.power-term.inactive {
    color: var(--text-muted);
}

/* Values Table */
.values-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.values-table th,
.values-table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.values-table th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.values-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.clickable-value {
    color: var(--primary-light);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.clickable-value:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Base Cards */
.base-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .base-cards {
        grid-template-columns: 1fr;
    }
}

.base-card {
    padding: 1.25rem;
    border-radius: var(--radius-md);
    border-left: 4px solid;
}

.base-card.bin {
    background: rgba(99, 102, 241, 0.08);
    border-left-color: var(--primary-color);
}

.base-card.dec {
    background: rgba(16, 185, 129, 0.08);
    border-left-color: var(--success-color);
}

.base-card.hex {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: var(--accent-color);
}

.base-card.oct {
    background: rgba(14, 165, 233, 0.08);
    border-left-color: var(--secondary-color);
}

.base-card h4 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.base-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.base-card p:last-child {
    margin-bottom: 0;
}

.base-card code {
    background: rgba(0, 0, 0, 0.2);
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    font-family: 'Fira Code', monospace;
    font-size: 0.85em;
}

/* Warning Box */
.warning-box {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--accent-color);
    padding: 1rem 1.25rem;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-bottom: 1rem;
}

.warning-box:last-child {
    margin-bottom: 0;
}

.warning-box p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Explanation Section */
.explanation-section {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.explanation-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.explanation-section h4 {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.375rem;
}

.explanation-section p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* Tool Link */
.tool-link {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.tool-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}




/* ===== Mobile Responsive Styles ===== */
@media (max-width: 768px) {
    .base-input {
        padding: 1rem;
    }

    .base-field {
        font-size: 1rem;
        padding: 0.75rem;
    }

    .bit-cell {
        width: 44px;
        height: 56px;
    }

    .bit-value {
        font-size: 1.25rem;
    }

    .bit-position {
        font-size: 0.6rem;
    }

    .power-formula {
        font-size: 0.8rem;
    }

    .values-table th,
    .values-table td {
        padding: 0.625rem 0.75rem;
        font-size: 0.8rem;
    }

    .base-card {
        padding: 1rem;
    }

    .base-card h4 {
        font-size: 0.9rem;
    }

    .base-card p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .bit-row {
        gap: 0.375rem;
    }

    .bit-cell {
        width: 36px;
        height: 48px;
    }

    .bit-value {
        font-size: 1rem;
    }

    .bit-position {
        font-size: 0.55rem;
    }

    .power-breakdown {
        padding: 1rem;
    }

    .power-formula {
        font-size: 0.75rem;
        gap: 0.375rem;
    }

    .power-term {
        padding: 0.2rem 0.375rem;
    }

    .values-table th,
    .values-table td {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .base-cards {
        gap: 0.75rem;
    }
}