/* Octal Converter Styles */
.octal-converter-tool {
    min-height: 100vh;
    background: white;
    padding: 2rem 1rem;
}

.tool-container {
    max-width: 1200px;
    margin: 0 auto;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    color: #2d3748;
}

.tool-header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.tool-header h1 i {
    margin-right: 1rem;
    color: #ffd700;
}

.tool-description {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.6;
}

.converter-interface {
    margin-bottom: 3rem;
}

.converter-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mode Toggle */
.mode-toggle-section {
    margin-bottom: 2rem;
}

.mode-toggle-container {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: nowrap;
}

.mode-btn {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #4a5568;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 200px;
    justify-content: center;
}

.mode-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.mode-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.mode-btn i {
    font-size: 1.2rem;
}

/* Input Section */
.input-section {
    margin-bottom: 2rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.input-label i {
    color: #667eea;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.number-input {
    width: 100%;
    padding: 1.25rem 4rem 1.25rem 1.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    background: #f8fafc;
    transition: all 0.3s ease;
    outline: none;
}

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

.input-controls {
    position: absolute;
    right: 0.5rem;
    display: flex;
    gap: 0.25rem;
}

.control-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #64748b;
}

.control-btn:hover {
    background: #e2e8f0;
    color: #475569;
}

.input-info {
    display: flex;
    justify-content: space-between;
    margin-top: 0.75rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.info-item i {
    color: #667eea;
}

/* Format Options */
.format-options {
    background: #f8fafc;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.options-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1rem;
}

.options-title i {
    color: #667eea;
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.option-item:hover {
    background: rgba(102, 126, 234, 0.05);
}

.option-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.option-label {
    font-size: 0.95rem;
    color: #4a5568;
    font-weight: 500;
}

/* Convert Button */
.convert-section {
    text-align: center;
    margin-bottom: 2rem;
}

.convert-btn {
    background: rgb(9, 119, 14);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

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

/* Error Message */
.error-message {
    background: linear-gradient(135deg, #fed7d7 0%, #feb2b2 100%);
    color: #c53030;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border: 1px solid #fca5a5;
}

.error-message i {
    font-size: 1.2rem;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: #64748b;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #f0fff4 0%, #c6f6d5 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #9ae6b4;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    color: #22543d;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.copy-btn {
    background: #38a169;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: #2f855a;
    transform: translateY(-1px);
}

.result-display {
    text-align: center;
}

.result-content {
    margin-bottom: 2rem;
}

.input-qualifier {
    font-size: 0.9rem;
    color: #4a5568;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.result-value-container {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: #22543d;
    font-family: 'Courier New', monospace;
    word-break: break-all;
}

.result-unit {
    font-size: 1.5rem;
    color: #38a169;
    font-weight: 600;
}

/* Result Formats */
.result-formats {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #c6f6d5;
}

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

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.format-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    color: #2d3748;
    font-size: 0.9rem;
}

.format-label i {
    color: #667eea;
}

.format-value {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #22543d;
    word-break: break-all;
    text-align: right;
    max-width: 150px;
    overflow-wrap: break-word;
}

/* Conversion Steps */
.conversion-steps {
    background: #f8fafc;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e2e8f0;
}

.steps-header h4 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0 0 1.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.steps-header i {
    color: #667eea;
}

.steps-content {
    font-family: 'Courier New', monospace;
    line-height: 1.8;
}

.step-item {
    background: white;
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    border-left: 4px solid #667eea;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.step-number {
    color: #667eea;
    font-weight: 700;
    margin-right: 0.5rem;
}

.step-calculation {
    color: #2d3748;
    font-weight: 600;
}

.step-result {
    color: #38a169;
    font-weight: 700;
    margin-left: 1rem;
}

/* Examples Section */
.examples-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    
}

.examples-header {
    text-align: center;
    margin-bottom: 2rem;
}

.examples-header h3 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.examples-header h3 i {
    color: #ffd700;
}

.examples-header p {
    color: #64748b;
    font-size: 1.1rem;
}

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

.example-item {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    text-align: center;
}

.example-item:hover {
    transform: translateY(-3px);
    
    border-color: #667eea;
}

.example-label {
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.example-input {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2d3748;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.5rem;
}

.example-output {
    font-size: 1.1rem;
    color: #667eea;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    
}

.info-card h3 {
    color: #2d3748;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-card h3 i {
    color: #667eea;
}

.info-card h4 {
    color: #2d3748;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 2rem 0 1rem 0;
}

.info-card p {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
}

.info-card ul, .info-card ol {
    color: #4a5568;
    line-height: 1.7;
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.info-card li {
    margin-bottom: 0.5rem;
}

.info-card strong {
    color: #2d3748;
    font-weight: 600;
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.related-tools-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.related-tools-header h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tools-header h3 i {
    color: #667eea;
}

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

.related-tool-link {
    background: #f8fafc;
    color: #667eea;
    text-decoration: none;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    border: 1px solid #e5e7eb;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.related-tool-link:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.related-tool-link i {
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .octal-converter-tool {
        padding: 1rem 0.5rem;
    }

    .tool-header h1 {
        font-size: 2.2rem;
    }

    .tool-description {
        font-size: 1rem;
    }

    .converter-card {
        padding: 1.5rem;
    }

    .mode-toggle-container {
        flex-direction: row;
        gap: 0.5rem;
    }

    .mode-btn {
        min-width: auto;
        flex: 1;
        max-width: 48%;
        padding: 0.6rem 0.8rem;
        font-size: 0.9rem;
        gap: 0.4rem;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .format-grid {
        grid-template-columns: 1fr;
    }
    
    .result-header {
        flex-direction: column;
        text-align: center;
    }
    
    .result-value {
        font-size: 2rem;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .info-section, .examples-section {
        padding: 1.5rem;
    }

    .related-tools-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .related-tool-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.8rem;
    }

    .converter-card {
        padding: 1rem;
    }

    .mode-btn {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        gap: 0.25rem;
        max-width: 48%;
    }

    .result-value {
        font-size: 1.5rem;
    }

    .format-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .format-value {
        text-align: center;
        max-width: none;
    }

    .related-tools-section {
        padding: 1rem;
    }

    .related-tools-grid {
        grid-template-columns: 1fr;
    }
}

/* Comparison Table Styles */
.comparison-table {
    margin: 1.5rem 0;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.comparison-table th {
    background: #667eea;
    color: white;
    padding: 1rem;
    text-align: center;
    font-weight: 600;
    font-size: 0.95rem;
}

.comparison-table td {
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    color: #2d3748;
}

.comparison-table tr:nth-child(even) td {
    background: #f7fafc;
}

.comparison-table tr:hover td {
    background: #edf2f7;
}

@media (max-width: 768px) {
    .comparison-table {
        font-size: 0.9rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
    }
}
