/* ===== Base64 Converter Specific Styles ===== */
.base64-converter-section {
    max-width: 700px;
    margin: 0 auto;
}

.base64-converter-container {
    display: flex;
    flex-direction: column;
}

/* ===== Single Card Design ===== */
.converter-card {
    background: white;
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.converter-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0 0 1rem 0;
}

/* ===== Conversion Type Tabs ===== */
.conversion-type-tabs {
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.tabs-container {
    display: flex;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: #666;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    cursor: pointer;
}

.tab-btn:hover {
    color: #0071e3;
    background: rgba(74, 129, 123, 0.1);
}

.tab-btn.active {
    background: #0071e3;
    color: white;
    outline: none;
    box-shadow: 0 2px 8px rgba(174, 177, 177, 0.3);
}

.tab-icon {
    font-size: 1rem;
}

.tab-label {
    font-size: 0.9rem;
    font-weight: 500;
}

.btn-secondary, .btn-primary {
    outline: none;
}

/* ===== Input/Output Sections ===== */
.input-section,
.output-section {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.input-header,
.output-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.input-info,
.output-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.85rem;
    color: #666;
}

.char-count {
    color: #4a817b;
    font-weight: 500;
}

.size-info {
    color: #666;
}

.validation-status {
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.validation-status.valid {
    background: #e8f5e8;
    color: #2d5a2d;
}

.validation-status.invalid {
    background: #ffeaea;
    color: #c53030;
}

.validation-status.warning {
    background: #fff4e6;
    color: #b7791f;
}

/* ===== Textarea Styling ===== */
.textarea-wrapper {
    position: relative;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    background: #f8f9fa;
    transition: border-color 0.2s ease;
}

.textarea-wrapper:focus-within {
    border-color: #4a817b;
    background: white;
}

.input-textarea,
.output-textarea {
    width: 100%;
    padding: 1rem;
    padding-right: 3rem;
    border: none;
    border-radius: 12px;
    background: transparent;
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #333;
    resize: vertical;
    min-height: 120px;
    outline: none;
}

.input-textarea::placeholder,
.output-textarea::placeholder {
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.output-textarea {
    background: #fafbfc;
    color: #4a817b;
}

.textarea-controls {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    display: flex;
    gap: 0.25rem;
}

.control-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    color: #666;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.control-btn:hover {
    background: white;
    color: #4a817b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-icon {
    font-size: 1.2rem;
}

/* ===== Action Section ===== */
.action-section {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.action-buttons .btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background-color: #4a817b;
    color: white;
    border: none;
    flex: 1;
}

.btn-primary:hover {
    background-color: #3d6b65;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    color: #4a817b;
    border: 1px solid #4a817b;
    min-width: auto;
}

.btn-secondary:hover {
    background: #f0f7f6;
    transform: translateY(-1px);
}

.swap-icon {
    font-size: 1rem;
    font-weight: bold;
}

/* ===== Settings Section ===== */
.settings-section {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.option-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.option-row:last-child {
    margin-bottom: 0;
}

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

/* ===== Toggle Switch (Reused from password generator) ===== */

input:checked + .toggle-slider {
    background-color: #4a817b;
}

input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.3s;
    border-radius: 12px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: 0.3s;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}


/* ===== Info Section ===== */
.info-section {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

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

.info-label {
    font-weight: 500;
    color: #333;
    font-size: 0.9rem;
}

.info-value {
    font-family: 'SF Mono', 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85rem;
    color: #4a817b;
    font-weight: 500;
}

/* ===== Success Animation ===== */
.copy-success {
    animation: copySuccess 0.3s ease;
}

@keyframes copySuccess {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* ===== Error States ===== */
.textarea-wrapper.error {
    border-color: #ff4757;
    background: #fff5f5;
}

.textarea-wrapper.error .input-textarea,
.textarea-wrapper.error .output-textarea {
    background: transparent;
}

/* ===== Loading State ===== */
.converting {
    opacity: 0.7;
    pointer-events: none;
}

.converting .btn-primary {
    background: #ccc;
}

/* ===== Responsive Design ===== */
@media (max-width: 600px) {
    .base64-converter-section {
        max-width: 100%;
        padding: 0 15px;
    }

    .converter-card {
        border-radius: 12px;
    }

    .conversion-type-tabs,
    .input-section,
    .output-section,
    .action-section,
    .settings-section,
    .info-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .tabs-container {
        gap: 2px;
        padding: 2px;
    }

    .tab-btn {
        padding: 0.6rem 0.75rem;
        font-size: 0.85rem;
    }

    .tab-icon {
        font-size: 0.9rem;
    }

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

    .input-info,
    .output-info {
        gap: 0.75rem;
        font-size: 0.8rem;
    }

    .action-buttons {
        flex-direction: column;
        gap: 0.5rem;
    }

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

    .btn-secondary {
        min-width: auto;
    }

    .input-textarea,
    .output-textarea {
        font-size: 0.85rem;
        min-height: 100px;
    }

    .textarea-controls {
        top: 0.5rem;
        right: 0.5rem;
    }

    .control-btn {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 400px) {
    .conversion-type-tabs,
    .input-section,
    .output-section,
    .action-section,
    .settings-section,
    .info-section {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .input-info,
    .output-info {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .validation-status {
        order: -1;
        width: 100%;
        text-align: center;
    }

    .toggle-switch {
        width: 40px;
        height: 22px;
    }

    .toggle-slider:before {
        height: 16px;
        width: 16px;
    }

    input:checked + .toggle-slider:before {
        transform: translateX(18px);
    }
}