* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #1f2937;
}

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

header {
    text-align: center;
    padding: 40px 20px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    margin-bottom: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #6b7280;
}

.language-selector {
    position: absolute;
    top: 20px;
    right: 20px;
}

.language-selector select {
    padding: 8px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.language-selector select:hover {
    border-color: #667eea;
}

.main-content {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.controls-panel,
.preview-panel {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: #1f2937;
    font-weight: 600;
}

h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: #4b5563;
    font-weight: 600;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #4b5563;
    font-size: 0.95rem;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.slider-container input[type="range"] {
    flex: 1;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #667eea;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s;
}

.slider-container input[type="range"]::-webkit-slider-thumb:hover {
    background: #764ba2;
    transform: scale(1.2);
}

.slider-container span {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    color: #667eea;
}

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

.color-input-group input[type="color"] {
    width: 50px;
    height: 40px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    cursor: pointer;
    background: white;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    transition: all 0.3s;
}

.color-input-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
}

.preset-section {
    margin-top: 35px;
    padding-top: 25px;
    border-top: 2px solid #e5e7eb;
}

.preset-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.preset-btn {
    padding: 12px 20px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    color: #4b5563;
}

.preset-btn:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.preview-container {
    background: #f9fafb;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
}

.preview-modes {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
}

.mode-btn {
    padding: 10px 25px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    color: #6b7280;
}

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

.preview-area {
    padding: 40px;
    border-radius: 12px;
    transition: all 0.3s;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.preview-area.light-mode {
    background: white;
}

.preview-area.dark-mode {
    background: #1f2937;
    color: white;
}

.switch-preview-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-states {
    display: flex;
    gap: 40px;
    align-items: center;
}

.state-example {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.state-example span {
    font-size: 0.9rem;
    color: #6b7280;
    font-weight: 500;
}

.dark-mode .state-example span {
    color: #9ca3af;
}

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

.code-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
}

.code-tab {
    padding: 10px 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
    color: #6b7280;
}

.code-tab.active {
    background: #1f2937;
    color: white;
}

.code-container {
    position: relative;
    background: #1f2937;
    border-radius: 0 8px 8px 8px;
    padding: 20px;
    overflow: hidden;
}

.code-container pre {
    margin: 0;
    overflow-x: auto;
    max-height: 400px;
}

.code-container code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    line-height: 1.6;
    color: #e5e7eb;
    white-space: pre;
}

.copy-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.copy-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.copy-btn.copied {
    background: #10b981;
}

.export-section {
    margin-top: 25px;
    display: flex;
    gap: 15px;
}

.export-btn {
    flex: 1;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

footer {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

footer p {
    color: #6b7280;
    font-size: 0.95rem;
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .controls-panel,
    .preview-panel {
        padding: 20px;
    }
    
    .preset-buttons {
        grid-template-columns: 1fr;
    }
    
    .preview-states {
        flex-direction: column;
        gap: 20px;
    }
    
    .export-section {
        flex-direction: column;
    }
    
    .language-selector {
        position: static;
        margin-top: 20px;
    }
}