* {
    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;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 10px;
}

.attribution {
    font-size: 0.9rem;
}

.attribution a {
    color: #ffd700;
    text-decoration: none;
}

.attribution a:hover {
    text-decoration: underline;
}

.app-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 20px;
}

.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn.primary {
    background: #007bff;
    color: white;
}

.btn.success {
    background: #28a745;
    color: white;
}

.btn.warning {
    background: #ffc107;
    color: #212529;
}

.btn.danger {
    background: #dc3545;
    color: white;
}

.btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
}

.editor-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.input-section, .code-section {
    display: flex;
    flex-direction: column;
}

h3 {
    margin-bottom: 10px;
    color: #495057;
    font-size: 1.2rem;
}

h4 {
    margin-bottom: 8px;
    color: #6c757d;
}

textarea {
    flex: 1;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    resize: vertical;
    min-height: 200px;
}

textarea:focus {
    outline: none;
    border-color: #007bff;
}

.examples {
    margin-top: 15px;
}

.example-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.example-btn {
    padding: 6px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

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

.output-section {
    margin-bottom: 20px;
}

#outputContainer {
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    min-height: 120px;
    background: #f8f9fa;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 300px;
}

.status-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-top: 1px solid #e9ecef;
}

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

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #6c757d;
}

.status.idle .status-dot {
    background: #6c757d;
}

.status.loading .status-dot {
    background: #007bff;
    animation: pulse 1.5s infinite;
}

.status.success .status-dot {
    background: #28a745;
}

.status.error .status-dot {
    background: #dc3545;
}

.progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 200px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: #007bff;
    width: 0%;
    transition: width 0.3s ease;
}

.features {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.features ul {
    list-style: none;
    padding-left: 0;
}

.features li {
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.features li:last-child {
    border-bottom: none;
}

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

@media (max-width: 768px) {
    .editor-section {
        grid-template-columns: 1fr;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .control-group {
        justify-content: center;
    }
}