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

:root {
    --primary-color: #3b82f6;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
}

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: var(--text-primary);
    line-height: 1.6;
}

body.dark-mode {
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --bg-tertiary: #0f172a;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --border-color: #374151;
}

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

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

body.dark-mode .header {
    background: rgba(31, 41, 55, 0.95);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo svg {
    stroke: #667eea;
}

.lang-selector select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.lang-selector select:hover {
    border-color: var(--primary-color);
}

/* Main */
.main {
    padding: 2rem 0;
}

.subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: white;
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Editor Container */
.editor-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

/* Sidebar */
.sidebar {
    background: var(--bg-secondary);
    padding: 20px;
    max-height: 80vh;
    overflow-y: auto;
    border-right: 1px solid var(--border-color);
}

.section {
    margin-bottom: 30px;
}

.section h2 {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

/* Color Palette */
.color-palette {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.color-item {
    display: grid;
    grid-template-columns: 40px 1fr 30px;
    gap: 8px;
    align-items: center;
}

.color-item input[type="color"] {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.color-item input[type="text"],
.spacing-item input[type="text"],
.typography-item input[type="text"],
.radius-item input[type="text"],
.shadow-item input[type="text"] {
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
}

.shadow-input {
    font-size: 12px !important;
}

/* Spacing, Typography, Radius, Shadow Lists */
.spacing-list,
.typography-list,
.radius-list,
.shadow-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spacing-item,
.typography-item,
.radius-item,
.shadow-item {
    display: grid;
    grid-template-columns: 1fr 1fr 30px;
    gap: 8px;
    align-items: center;
}

.shadow-item {
    grid-template-columns: 60px 1fr 30px;
}

/* Buttons */
.btn-add {
    width: 100%;
    padding: 10px;
    margin-top: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-add:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn-remove {
    width: 30px;
    height: 30px;
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Main Content */
.main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Preview Section */
.preview-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.preview-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.theme-toggle {
    padding: 8px 16px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}

.theme-toggle:hover {
    border-color: var(--primary-color);
}

.preview {
    background: var(--bg-primary);
    border-radius: var(--radius-md);
    padding: 40px;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.preview-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    transition: all 0.3s;
}

.preview-card h3 {
    font-size: 24px;
    margin-bottom: 12px;
    font-weight: 600;
}

.preview-card p {
    color: #6b7280;
    margin-bottom: 20px;
    line-height: 1.6;
}

.preview-button {
    background: #3b82f6;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.preview-button:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Code Section */
.code-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: 20px;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.code-header h2 {
    font-size: 18px;
    font-weight: 600;
}

.code-actions {
    display: flex;
    gap: 10px;
}

.format-select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
}

.btn-copy,
.btn-download {
    padding: 8px 16px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-copy:hover,
.btn-download:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.code-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: var(--radius-md);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

body.dark-mode .code-output {
    background: #0f172a;
}

/* Features */
.features {
    margin-top: 60px;
    padding: 60px 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
}

.features h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.feature-card {
    text-align: center;
    padding: 30px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
    transition: all 0.3s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.feature-card svg {
    width: 48px;
    height: 48px;
    margin-bottom: 20px;
    stroke: var(--primary-color);
}

.feature-card h3 {
    font-size: 18px;
    margin-bottom: 10px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 30px 0;
    color: white;
    margin-top: 40px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .editor-container {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
    }
    
    .code-header,
    .preview-header {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .code-actions {
        flex-direction: column;
    }
}