* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    position: relative;
}

.header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.back-btn {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-5px);
}

.main-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.formatter-container {
    width: 100%;
}

.controls {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.language-selector, .format-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

label {
    font-weight: 600;
    color: #333;
}

select {
    padding: 10px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    min-width: 150px;
}

select:focus {
    border-color: #667eea;
}

.editor-sections {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 20px;
    align-items: start;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.section-header h3 {
    color: #333;
    font-size: 1.2rem;
}

textarea {
    width: 100%;
    height: 400px;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    resize: vertical;
    outline: none;
}

textarea:focus {
    border-color: #667eea;
}

#outputCode {
    background-color: #f8f9fa;
}

.format-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    padding-top: 50px;
}

.format-btn, .minify-btn {
    padding: 15px 25px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 150px;
    justify-content: center;
}

.format-btn {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.minify-btn {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.format-btn:hover, .minify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.clear-btn, .copy-btn {
    padding: 8px 15px;
    border: none;
    background: #6c757d;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.copy-btn {
    background: #28a745;
}

.clear-btn:hover {
    background: #5a6268;
}

.copy-btn:hover {
    background: #218838;
}

footer {
    text-align: center;
    color: white;
    margin-top: 30px;
    padding: 20px;
}

@media (max-width: 1024px) {
    .editor-sections {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .format-section {
        padding-top: 0;
        flex-direction: row;
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 20px;
    }
    
    .format-section {
        flex-direction: column;
    }
    
    textarea {
        height: 300px;
    }
}
