/* Binary to Decimal Converter Tool Styles */

/* Tool Container - Full Page Layout */
.binary-decimal-converter-tool {
    width: 100%;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    padding: 0;
    margin: 0;
}

.tool-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* Tool Header */
.tool-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem 0;
}

.tool-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: rgb(34, 33, 33);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.tool-header h1 i {
    color: var(--primary-color);
    font-size: 1.8rem;
}

.tool-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0;
    line-height: 1.6;
}

/* Converter Interface */
.converter-interface {
    margin-bottom: 3rem;
}

.converter-card {
    background: white;
    border-radius: 12px;
    padding: 2.5rem;
    border: 1px solid #e5e7eb;
    
}

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

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.input-label i {
    color: var(--primary-color);
    margin-right: 0.5rem;
}

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

.binary-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    font-size: 1.125rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
    transition: all 0.2s ease-in-out;
    font-family: 'Courier New', monospace;
    font-weight: 500;
    letter-spacing: 0.05em;
}

.binary-input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: white;
    box-shadow: 0 0 0 3px rgba(50, 146, 109, 0.1);
}

.binary-input.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.binary-input.valid {
    border-color: #059669;
    background-color: #ecfdf5;
}

.binary-input::placeholder {
    font-family: inherit;
    letter-spacing: normal;
    color: #9ca3af;
}

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

.control-btn {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
    font-size: 0.875rem;
}

.control-btn:hover {
    color: var(--primary-color);
    background-color: rgba(50, 146, 109, 0.1);
}

.input-info {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--text-light);
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item i {
    color: #3b82f6;
}

.info-item.error i {
    color: #dc2626;
}

.info-item.valid i {
    color: #059669;
}

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

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

.options-title i {
    color: #6b7280;
}

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

.option-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-color);
    transition: all 0.2s ease-in-out;
}

.option-item:hover {
    color: var(--primary-color);
}

.option-item input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--primary-color);
    cursor: pointer;
}

.option-label {
    font-weight: 500;
    cursor: pointer;
}

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

.convert-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.convert-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 8px -1px rgba(0, 0, 0, 0.15);
}

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

.convert-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Result Section */
.result-section {
    background: linear-gradient(135deg, #dcfce7 0%, #c9f4fc 100%);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    border: 1px solid #86efac;
    animation: fadeInScale 0.5s ease-out;
}

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

.result-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.copy-btn {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

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

.result-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.result-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.binary-qualifier {
    font-size: 1rem;
    font-weight: 600;
    color: #059669;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.15) 100%);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.1);
}

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

.result-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
    transition: all 0.3s ease-in-out;
    line-height: 1;
    display: inline-block;
    word-break: break-all;
}

.result-unit {
    font-size: 1.25rem;
    font-weight: 600;
    color: #374151;
    line-height: 1;
}

/* Result Formats */
.result-formats {
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1rem;
    width: 100%;
}

.format-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.format-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.format-item:last-child {
    border-bottom: none;
}

.format-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.format-label i {
    color: #6b7280;
    font-size: 0.75rem;
}

.format-value {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-weight: 500;
    font-size: 0.875rem;
    word-break: break-all;
    text-align: right;
    max-width: 60%;
}

@keyframes fadeInScale {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Conversion Steps */
.conversion-steps {
    background: #f8fafc;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid #e5e7eb;
    animation: fadeInScale 0.5s ease-out;
}

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

.steps-header h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.steps-header i {
    color: #3b82f6;
}

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

.step-item {
    background: white;
    border-radius: 6px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease-in-out;
}

.step-item:hover {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.step-number {
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-description {
    font-size: 0.875rem;
    color: var(--text-color);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.step-calculation {
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 500;
    word-break: break-all;
}

/* Loading Indicator */
.loading-indicator {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Error Message */
.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    padding: 1rem;
    color: #dc2626;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    animation: fadeInScale 0.3s ease-out;
}

.error-message i {
    color: #dc2626;
    font-size: 1rem;
}

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

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

.examples-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.examples-header p {
    color: var(--text-light);
    margin: 0;
}

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

.example-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: center;
}

.example-item:hover {
    background: #f0f9ff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.example-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.example-input {
    font-family: 'Courier New', monospace;
    font-size: 1rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.example-output {
    font-size: 0.875rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* Related Tools Section */
.related-tools-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid #e5e7eb;
}

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

.related-tools-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

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

.related-tool-link {
    background: #f8fafc;
    color: var(--primary-color);
    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;
}

.related-tool-link:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}


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

    .converter-card {
        padding: 1.5rem;
    }

    .tool-header h1 {
        font-size: 1.5rem;
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .binary-input {
        font-size: 1rem;
        padding: 0.875rem 2.5rem 0.875rem 0.875rem;
    }

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

    .result-value-container {
        flex-direction: column;
        gap: 0.25rem;
    }

    .result-unit {
        font-size: 1rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

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

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

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

    .format-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .format-value {
        max-width: 100%;
        text-align: left;
    }

    .result-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }

    .copy-btn {
        width: 100%;
        justify-content: center;
    }

    .step-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .step-number {
        align-self: flex-start;
    }



    .input-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .seo-content {
        padding: 1.5rem;
    }


}

@media (max-width: 480px) {
    .tool-container {
        padding: 0.75rem;
    }

    .converter-card {
        padding: 1rem;
    }

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

    .binary-input {
        font-size: 0.875rem;
        padding: 0.75rem 2rem 0.75rem 0.75rem;
    }

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

    .format-options {
        padding: 1rem;
    }

    .examples-section {
        padding: 1rem;
    }

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

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





    .step-calculation {
        font-size: 0.75rem;
    }

    .example-input {
        font-size: 0.875rem;
    }

    .seo-content {
        padding: 1rem;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .binary-input {
        border-width: 3px;
    }

    .binary-input:focus {
        box-shadow: 0 0 0 4px rgba(50, 146, 109, 0.2);
    }

    .convert-btn {
        border: 2px solid transparent;
    }

    .convert-btn:focus {
        border-color: white;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .convert-btn:hover {
        transform: none;
    }

    .example-item:hover {
        transform: none;
    }
}



/* SEO Content Styles */
.seo-content {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 2rem;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
}

.seo-content h2 {
    color: var(--text-color);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    margin-top: 2rem;
}

.seo-content h2:first-child {
    margin-top: 0;
}

.seo-content h3 {
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
}

.seo-content h4 {
    color: var(--text-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    margin-top: 1rem;
}

.seo-content p {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.seo-content ul,
.seo-content ol {
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.seo-content li {
    margin-bottom: 0.5rem;
}

.seo-content li strong {
    color: var(--primary-color);
    font-weight: 600;
}

.seo-content a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.seo-content a:hover {
    text-decoration: underline;
}

.mb-10 {
    margin-bottom: 2.5rem;
}

/* Print styles */
@media print {
    .binary-decimal-converter-tool {
        background: white;
    }

    .converter-card,
    .examples-section,
    .seo-content {
        box-shadow: none;
        border: 1px solid #000;
    }

    .convert-btn,
    .copy-btn,
    .control-btn {
        display: none;
    }

    .loading-indicator {
        display: none;
    }
}
