/* Beautifier Section */
.beautifier-section {
    margin-top: 2rem;
}

.beautifier-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 24px;
}

/* Panel Styles */
.input-panel,
.output-panel {
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.input-panel:hover,
.output-panel:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Controls Panel - now inside input panel */
.controls-panel {
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    margin-top: 0;
}

.panel-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.input-panel .panel-header {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.output-panel .panel-header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* Controls panel no longer has its own header */

.panel-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

/* Editor Container */
.editor-container {
    flex: 1;
    min-height: 500px;
    position: relative;
    overflow: hidden;
}

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

/* Controls Panel */
.controls-content {
    padding: 20px 24px;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    min-width: 140px;
}

.control-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    margin-bottom: 4px;
}

.label-text {
    color: #495057;
}

.label-value {
    background: #e9ecef;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #667eea;
    min-width: 40px;
    text-align: center;
}

.form-range {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: #667eea;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-webkit-slider-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.form-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: #667eea;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
}

.form-range::-moz-range-thumb:hover {
    background: #5568d3;
    transform: scale(1.1);
}

.control-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    user-select: none;
}

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

.check-label {
    flex: 1;
}

/* Button Group */
.button-group {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
    margin-top: 4px;
    flex-basis: 100%;
}

.button-group .btn {
    flex: 1;
}

.btn {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: #ffffff;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

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

.btn i {
    font-size: 14px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .beautifier-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .controls-content {
        flex-direction: column;
        gap: 16px;
    }

    .control-group {
        width: 100%;
        min-width: auto;
    }

    .button-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .beautifier-section {
        margin-top: 1.5rem;
    }

    .beautifier-wrapper {
        gap: 16px;
    }

    .panel-header {
        padding: 16px 20px;
    }

    .panel-title {
        font-size: 18px;
    }

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

    .editor {
        min-height: 400px;
    }

    .controls-content {
        padding: 16px;
        gap: 14px;
    }

    .control-group {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .editor-container {
        min-height: 350px;
    }

    .editor {
        min-height: 350px;
    }

    .panel-header {
        padding: 12px 16px;
    }

    .panel-title {
        font-size: 16px;
    }

    .controls-content {
        padding: 12px 16px;
    }

    .label-value {
        font-size: 12px;
        padding: 3px 8px;
    }
}

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

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

/* Loading State */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Success Animation */
.btn.success {
    background: #28a745;
}

.btn.success i::before {
    content: "\f00c";
}

/* Copy Feedback */
.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: #ffffff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 1000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

