/* Base64 Converter Section */
.base64-converter-section {
    margin-bottom: 3rem;
}

.converter-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Converter Wrapper - Horizontal Split Layout */
.converter-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 500px;
}

@media (min-width: 768px) {
    .converter-wrapper {
        flex-direction: row;
        align-items: stretch;
    }
}

/* Input and Output Sections */
.input-section,
.output-section {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 400px;
    border-right: none;
}

@media (min-width: 768px) {
    .input-section {
        border-right: 1px solid #e5e7eb;
    }
    
    .output-section {
        border-right: none;
    }
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e5e7eb;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.section-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
}

.section-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 8px;
    background: #e5e7eb;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-badge.success {
    background: #d1fae5;
    color: #065f46;
}

.section-controls {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.control-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.control-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #111827;
    transform: translateY(-1px);
}

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

.control-btn.primary {
    background: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}

.control-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.control-btn svg {
    flex-shrink: 0;
}

/* Editor Container */
.editor-container {
    flex: 1;
    position: relative;
    min-height: 300px;
    background: #ffffff;
}

.code-editor {
    width: 100%;
    height: 100%;
    min-height: 300px;
}

/* Output Container */
.output-container {
    flex: 1;
    padding: 1.5rem;
    background: #f9fafb;
    min-height: 300px;
    overflow: auto;
}

.base64-display {
    width: 100%;
    min-height: 100%;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.6;
    color: #111827;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-wrap: break-word;
}

.base64-display:empty::before {
    content: 'Base64 encoded output will appear here...';
    color: #9ca3af;
    font-style: italic;
}

/* Conversion Indicator */
.conversion-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    flex-direction: row;
}

@media (min-width: 768px) {
    .conversion-indicator {
        flex-direction: column;
        padding: 1.5rem 1rem;
        border-top: none;
        border-bottom: none;
        border-left: 1px solid #e5e7eb;
        border-right: 1px solid #e5e7eb;
        width: 60px;
        flex-shrink: 0;
    }
}

.indicator-line {
    flex: 1;
    height: 2px;
    background: linear-gradient(90deg, transparent, #d1d5db, transparent);
}

@media (min-width: 768px) {
    .indicator-line {
        width: 2px;
        height: 100%;
        background: linear-gradient(180deg, transparent, #d1d5db, transparent);
    }
}

.indicator-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    color: #6b7280;
    flex-shrink: 0;
}

@media (min-width: 768px) {
    .indicator-icon {
        transform: rotate(90deg);
    }
}

/* Section Footer */
.section-footer {
    padding: 0.75rem 1.5rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.stats-bar {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}

.error-display {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #991b1b;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Info Section */
.info-section {
    margin-top: 4rem;
    margin-bottom: 2rem;
}

.info-content {
    margin-bottom: 3rem;
}

.info-content:last-child {
    margin-bottom: 0;
}

.info-header {
    margin-bottom: 1.5rem;
}

.info-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.info-text {
    color: #4b5563;
    line-height: 1.7;
}

.info-text p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
}

.info-text p:last-child {
    margin-bottom: 0;
}

.info-list {
    margin: 1.25rem 0;
    padding-left: 1.5rem;
    list-style-position: outside;
}

.info-list li {
    margin-bottom: 0.75rem;
    font-size: 1rem;
    line-height: 1.6;
    color: #4b5563;
}

.info-list.ordered {
    list-style-type: decimal;
}

.info-list:not(.ordered) {
    list-style-type: disc;
}

/* Mobile First Responsive Design */
@media (max-width: 767px) {
    .converter-card {
        border-radius: 12px;
    }

    .converter-wrapper {
        min-height: auto;
    }

    .input-section,
    .output-section {
        min-height: 300px;
    }

    .section-header {
        padding: 0.875rem 1rem;
        flex-direction: column;
        align-items: stretch;
    }

    .section-title-wrapper {
        width: 100%;
    }

    .section-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .control-btn {
        flex: 1;
        justify-content: center;
        min-width: 0;
        padding: 0.625rem 0.875rem;
        font-size: 0.8125rem;
    }

    .editor-container {
        min-height: 250px;
    }

    .code-editor {
        min-height: 250px;
    }

    .output-container {
        min-height: 250px;
        padding: 1rem;
    }

    .base64-display {
        font-size: 0.8125rem;
        padding: 0.875rem;
    }

    .conversion-indicator {
        padding: 0.75rem 1rem;
    }

    .indicator-icon {
        width: 28px;
        height: 28px;
    }

    .section-footer {
        padding: 0.625rem 1rem;
    }

    .stats-bar {
        gap: 1rem;
    }

    .stat {
        font-size: 0.75rem;
    }

    .info-header h2 {
        font-size: 1.5rem;
    }

    .info-text p {
        font-size: 0.9375rem;
    }

    .info-list li {
        font-size: 0.9375rem;
    }
}

@media (min-width: 768px) {
    .converter-wrapper {
        min-height: 500px;
    }

    .input-section,
    .output-section {
        min-height: 500px;
    }

    .editor-container {
        min-height: 400px;
    }

    .code-editor {
        min-height: 400px;
    }

    .output-container {
        min-height: 400px;
    }
}

@media (min-width: 1024px) {
    .converter-card {
        border-radius: 20px;
    }

    .converter-wrapper {
        min-height: 600px;
    }

    .input-section,
    .output-section {
        min-height: 600px;
    }

    .section-header {
        padding: 1.25rem 2rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .editor-container {
        min-height: 500px;
    }

    .code-editor {
        min-height: 500px;
    }

    .output-container {
        min-height: 500px;
        padding: 2rem;
    }

    .base64-display {
        font-size: 0.9375rem;
        padding: 1.25rem;
    }

    .section-footer {
        padding: 1rem 2rem;
    }
}

/* ACE Editor Customization */
.ace-xcode .ace_content {
    background-color: #ffffff;
}

.ace-xcode .ace_gutter {
    background-color: #f9fafb;
    border-right: 1px solid #e5e7eb;
}

.ace-xcode .ace_gutter-active-line {
    background-color: #f3f4f6;
}

/* Loading and Success States */
.converter-card.processing .indicator-icon {
    animation: pulse 1.5s ease-in-out infinite;
    border-color: #3b82f6;
    color: #3b82f6;
}

.converter-card.success .indicator-icon {
    border-color: #10b981;
    color: #10b981;
    background: #d1fae5;
}

.converter-card.error .indicator-icon {
    border-color: #ef4444;
    color: #ef4444;
    background: #fee2e2;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Focus States for Accessibility */
.control-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.base64-display:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}
