/* Octal to Binary Converter Styles */
.octal-binary-converter {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.converter-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.converter-panel {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.converter-panel:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.panel-header {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    padding: 1.75rem 2rem;
    color: white;
    text-align: center;
}

.base-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.base-badge {
    padding: 0.625rem 1.25rem;
    border-radius: 12px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.octal-badge {
    background: rgba(255, 255, 255, 0.3);
}

.binary-badge {
    background: rgba(255, 255, 255, 0.3);
}

.conversion-flow {
    display: flex;
    align-items: center;
    color: white;
}

.flow-arrow {
    width: 32px;
    height: 32px;
    opacity: 0.95;
}

.panel-subtitle {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.95;
    font-weight: 400;
    letter-spacing: 0.025em;
}

.panel-body {
    padding: 2rem;
}

.input-section,
.output-section {
    margin-bottom: 1.75rem;
}

.field-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.75rem;
}

.label-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 700;
}

.binary-label-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.input-field-wrapper,
.output-field-wrapper {
    position: relative;
    display: flex;
    align-items: stretch;
}

.octal-input {
    width: 100%;
    padding: 1.125rem 3.5rem 1.125rem 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    
    font-size: 1.0625rem;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.25s ease;
}

.octal-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
    background: #fffbeb;
}

.octal-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.field-clear-btn {
    position: absolute;
    right: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.input-field-wrapper:hover .field-clear-btn,
.octal-input:not(:placeholder-shown) ~ .field-clear-btn {
    opacity: 1;
    pointer-events: all;
}

.field-clear-btn:hover {
    background: #f3f4f6;
    color: #374151;
}

.binary-output {
    width: 100%;
    padding: 1.125rem 1.25rem 3.5rem 1.25rem;
    border: 2px solid #10b981;
    border-radius: 14px;
    
    font-size: 1rem;
    line-height: 1.7;
    color: #065f46;
    background: #f0fdf4;
    resize: vertical;
    min-height: 100px;
    letter-spacing: 0.05em;
    word-break: break-all;
    transition: all 0.25s ease;
}

.binary-output:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12);
}

.binary-output::placeholder {
    color: #9ca3af;
}

.copy-result-btn {
    position: absolute;
    right: 0.875rem;
    bottom: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.125rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.copy-result-btn:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

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

.copy-result-btn.copied {
    background: #059669;
}

.copy-result-btn.copied .copy-label {
    display: none;
}

.copy-result-btn.copied::after {
    content: 'Copied!';
}

.copy-icon {
    width: 20px;
    height: 20px;
}

.field-hint {
    min-height: 1.5rem;
    font-size: 0.875rem;
    color: #dc2626;
    margin-top: 0.5rem;
    padding-left: 0.375rem;
    font-weight: 500;
}

.output-meta {
    min-height: 1.5rem;
    font-size: 0.8125rem;
    color: #6b7280;
    margin-top: 0.5rem;
    padding-left: 0.375rem;
    font-weight: 500;
}

.options-panel {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #f9fafb;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.option-group {
    flex: 1;
    min-width: 180px;
}

.option-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
}

.option-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #f59e0b;
}

.option-text {
    font-size: 0.9375rem;
    color: #374151;
    font-weight: 500;
}

.steps-container {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.steps-header {
    margin-bottom: 1rem;
}

.steps-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.steps-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-item {
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border-left: 4px solid #f59e0b;
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #374151;
}

.step-item strong {
    color: #1f2937;
    font-weight: 600;
}

.action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.875rem;
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 2px solid #f3f4f6;
}

.action-button {
    flex: 1;
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
    text-decoration: none;
}

.primary-action {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.primary-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.secondary-action {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.secondary-action:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.link-action {
    background: transparent;
    color: #f59e0b;
    border: 2px solid #f59e0b;
}

.link-action:hover {
    background: #f59e0b;
    color: white;
}

.action-icon {
    width: 20px;
    height: 20px;
}

.reference-panel,
.examples-panel {
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.reference-header,
.examples-header {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e5e7eb;
}

.reference-title,
.examples-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.reference-content {
    padding: 1.5rem 2rem;
}

.reference-table {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.table-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.875rem;
    background: #f9fafb;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.875rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.table-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    padding: 0.875rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.table-row:hover {
    background: #fffbeb;
    border-color: #f59e0b;
    transform: translateX(4px);
}

.table-cell {
    
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1f2937;
}

.table-row .table-cell:first-child {
    color: #f59e0b;
    font-weight: 700;
}

.table-row .table-cell:last-child {
    color: #10b981;
    font-weight: 700;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    padding: 1.5rem 2rem;
}

.example-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 14px;
    padding: 1.25rem;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.example-item:hover {
    border-color: #f59e0b;
    background: #fffbeb;
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(245, 158, 11, 0.2);
}

.example-value {
    
    font-weight: 700;
    color: #f59e0b;
    font-size: 1rem;
}

.example-result {
    
    font-weight: 600;
    color: #10b981;
    font-size: 0.875rem;
    word-break: break-all;
    line-height: 1.5;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .panel-body {
        padding: 1.5rem;
    }

    .panel-header {
        padding: 1.5rem 1.5rem;
    }

    .base-indicator {
        gap: 0.75rem;
    }

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

    .flow-arrow {
        width: 24px;
        height: 24px;
    }

    .octal-input,
    .binary-output {
        font-size: 0.9375rem;
        padding: 1rem 3rem 1rem 1rem;
    }

    .binary-output {
        padding-bottom: 3rem;
    }

    .action-bar {
        flex-direction: column;
    }

    .action-button {
        width: 100%;
    }

    .options-panel {
        flex-direction: column;
        gap: 1rem;
    }

    .option-group {
        min-width: 100%;
    }

    .reference-content,
    .examples-grid {
        padding: 1.25rem 1.5rem;
    }

    .reference-header,
    .examples-header {
        padding: 1.25rem 1.5rem;
    }

    .copy-result-btn {
        position: static;
        width: 100%;
        margin-top: 0.75rem;
        justify-content: center;
    }

    .output-field-wrapper {
        flex-direction: column;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .panel-body {
        padding: 1.25rem;
    }

    .panel-header {
        padding: 1.25rem;
    }

    .octal-input {
        padding-right: 2.5rem;
    }

    .reference-title,
    .examples-title,
    .steps-title {
        font-size: 1rem;
    }

    .table-header,
    .table-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

    .table-row {
        padding: 0.75rem;
    }
}
