/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted, #64748b);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Main Converter Styles */
.octal-hex-converter {
    margin: 2rem 0;
}

.converter-wrapper {
    margin: 0 auto;
}

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

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

.input-group-wrapper {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1.5rem;
    padding: 2rem;
    align-items: start;
}

.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.input-section > *,
.output-section > * {
    width: 100%;
}

.input-label,
.output-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    width: 100%;
    height: 32px;
    flex-shrink: 0;
}

.label-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.number-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    transition: all 0.3s ease;
    
    height: 64px;
    box-sizing: border-box;
    flex-shrink: 0;
}

.number-input:focus {
    outline: none;
    border-color: #667eea;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.number-input::placeholder {
    color: #cbd5e1;
    font-weight: 400;
}

.clear-btn {
    position: absolute;
    right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.input-container:has(.number-input:not(:placeholder-shown)) .clear-btn {
    opacity: 1;
    pointer-events: all;
}

.clear-btn:hover {
    background: #f1f5f9;
    color: #475569;
}

.input-hint {
    font-size: 0.75rem;
    color: #94a3b8;
    padding-left: 0.25rem;
    min-height: 1.125rem;
    line-height: 1.5;
}

.input-hint.error {
    color: #ef4444;
}

.arrow-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
    align-self: start;
    margin-top: 48px;
    position: relative;
    height: 64px;
    flex-shrink: 0;
}

.arrow-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.result-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #bae6fd;
    border-radius: 12px;
    
    height: 64px;
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.result-value {
    color: #0ea5e9;
}

.result-base {
    font-size: 1rem;
    color: #64748b;
    font-weight: 500;
}

.copy-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    margin-top: 0.5rem;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    align-self: flex-start;
}

.copy-btn:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #475569;
}

.copy-btn:active {
    transform: scale(0.98);
}

.copy-btn.copied {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.copy-btn.copied .copy-text {
    display: none;
}

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

.details-panel {
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
}

.details-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 2rem;
    cursor: pointer;
    user-select: none;
}

.details-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.toggle-btn:hover {
    background: #e2e8f0;
}

.toggle-btn.rotated {
    transform: rotate(180deg);
}

.details-content {
    padding: 0 2rem 1.5rem;
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.details-panel.collapsed .details-content {
    max-height: 0;
    padding: 0 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    background: white;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
}

.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.detail-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1e293b;
    
}

.steps-panel {
    border-top: 1px solid #e2e8f0;
    background: #ffffff;
    animation: slideDown 0.3s ease;
}

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

.steps-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.steps-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin: 0;
}

.steps-content {
    padding: 2rem;
}

.step-section {
    margin-bottom: 2rem;
}

.step-section:last-child {
    margin-bottom: 0;
}

.step-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.step-calculation {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 8px;
    margin: 0.5rem 0;
    
    font-size: 0.9375rem;
    color: #475569;
}

.step-result {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-left: 4px solid #0ea5e9;
    border-radius: 6px;
    font-weight: 600;
    color: #0c4a6e;
}

.examples-section {
    margin-top: 2rem;
}

.examples-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
}

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

.example-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.example-card:hover {
    border-color: #667eea;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.example-input,
.example-output {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    
}

.example-arrow {
    color: #94a3b8;
    font-size: 1.25rem;
    font-weight: 300;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .input-group-wrapper {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem;
        align-items: stretch;
    }

    .arrow-container {
        transform: rotate(90deg);
        padding: 0.5rem 0;
        margin-top: 0;
    }

    .arrow-icon {
        width: 40px;
        height: 40px;
    }

    .number-input {
        font-size: 1.125rem;
        padding: 0.875rem 3rem 0.875rem 1rem;
    }

    .result-display {
        font-size: 1.25rem;
        padding: 0.875rem 1rem;
        min-height: 56px;
    }

    .details-header {
        padding: 1rem 1.5rem;
    }

    .details-content {
        padding: 0 1.5rem 1.25rem;
    }

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

    .steps-header,
    .steps-content {
        padding: 1.25rem 1.5rem;
    }

    .examples-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .example-card {
        padding: 1rem 0.75rem;
    }
}

@media (max-width: 480px) {
    .converter-card {
        border-radius: 12px;
    }

    .input-group-wrapper {
        padding: 1.25rem;
    }

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

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .converter-card {
        background: #1e293b;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    }

    .number-input {
        background: #0f172a;
        border-color: #334155;
        color: #f1f5f9;
    }

    .number-input:focus {
        background: #1e293b;
        border-color: #667eea;
    }

    .result-display {
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        border-color: #334155;
    }

    .result-value {
        color: #60a5fa;
    }

    .details-panel {
        background: #0f172a;
        border-top-color: #334155;
    }

    .detail-item {
        background: #1e293b;
        border-color: #334155;
    }

    .detail-value {
        color: #f1f5f9;
    }

    .example-card {
        background: #1e293b;
        border-color: #334155;
    }

    .example-card:hover {
        background: #0f172a;
    }
}
