* {
    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;
    padding: 20px;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    overflow: hidden;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    opacity: 0.9;
    font-size: 1.1em;
}

.mode-selector {
    display: flex;
    background: rgba(255,255,255,0.2);
    border-radius: 10px;
    padding: 5px;
    max-width: 400px;
    margin: 20px auto 0;
}

.mode-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: white;
    font-weight: bold;
    font-size: 1em;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.mode-btn.active {
    background: white;
    color: #667eea;
}

.tabs {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #ddd;
}

.tab {
    flex: 1;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    font-weight: bold;
    font-size: 1.1em;
    background: #e9ecef;
    border: none;
    transition: all 0.3s;
    position: relative;
}

.tab:hover {
    background: #dee2e6;
}

.tab.active {
    background: white;
    color: #667eea;
}

.tab.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.tab-content {
    display: none;
    padding: 30px;
}

.tab-content.active {
    display: block;
}

.direction-selector {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.direction-selector h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.direction-options {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.direction-option {
    background: white;
    padding: 15px 30px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    border: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
}

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

.direction-option.active {
    border-color: #667eea;
    background: #f0f4ff;
}

.direction-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.generation-section {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.generation-section h3 {
    color: white;
    margin-bottom: 15px;
    font-size: 1.2em;
}

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

.input-section.single {
    grid-template-columns: 1fr;
}

.input-group {
    display: flex;
    flex-direction: column;
}

.input-group label {
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-badge {
    background: #667eea;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: normal;
}

.label-badge.lua {
    background: #5a67d8;
}

.label-badge.generate {
    background: #00c9ff;
}

textarea {
    width: 100%;
    min-height: 350px;
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    resize: vertical;
    transition: all 0.3s;
    background: #f8f9fa;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.config-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid #e9ecef;
}

.config-section h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #555;
    font-size: 0.95em;
}

.config-item input,
.config-item select {
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.config-item input:focus,
.config-item select:focus {
    outline: none;
    border-color: #667eea;
}

.config-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
    flex-wrap: wrap;
}

button {
    padding: 15px 40px;
    font-size: 1.1em;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.btn-convert:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-generate {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.btn-generate:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(79, 172, 254, 0.4);
}

.btn-download {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.btn-download:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 87, 108, 0.4);
}

.btn-clear {
    background: #6c757d;
    color: white;
}

.btn-clear:hover {
    background: #5a6268;
}

.btn-add {
    background: #28a745;
    color: white;
    padding: 10px 20px;
    font-size: 0.9em;
}

.btn-add:hover {
    background: #218838;
}

.btn-remove {
    background: #dc3545;
    color: white;
    padding: 8px 15px;
    font-size: 0.85em;
}

.btn-remove:hover {
    background: #c82333;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.output-section {
    margin-top: 30px;
}

.output-section h3 {
    margin-bottom: 15px;
    color: #333;
    display: flex;
    align-items: center;
    gap: 10px;
}

.output-textarea {
    background: #f8f9fa;
    border: 2px solid #ddd;
}

.status {
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: none;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.status.success {
    background: #d4edda;
    border: 2px solid #c3e6cb;
    color: #155724;
}

.status.error {
    background: #f8d7da;
    border: 2px solid #f5c6cb;
    color: #721c24;
}

.info-box {
    background: #e7f3ff;
    border-left: 4px solid #2196F3;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.info-box h4 {
    color: #1976D2;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-box ul {
    margin-left: 20px;
}

.info-box li {
    margin: 5px 0;
}

.gen-info-box {
    background: #e0f7ff;
    border-left: 4px solid #00c9ff;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.gen-info-box h4 {
    color: #0099cc;
    margin-bottom: 10px;
}

.animation-list {
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.animation-item {
    background: #f8f9fa;
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 5px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.animation-info {
    flex: 1;
}

.animation-info strong {
    color: #667eea;
    font-size: 1.1em;
}

.animation-details {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

@media (max-width: 768px) {
    .input-section {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.8em;
    }

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

    button {
        justify-content: center;
    }

    .tabs {
        flex-direction: column;
    }

    .direction-options {
        flex-direction: column;
    }
}