:root {
    --primary: #0076ff;
    --dark: #1e1e24;
    --light: #f5f6fa;
    --border: #dcdde1;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

header h1 {
    color: var(--dark);
    font-size: 2.5rem;
    margin-bottom: 5px;
}

header p {
    color: #666;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    width: 100%;
    flex-grow: 1;
}

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

.panel {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.panel-preview {
    display: flex; 
    flex-direction: column; 
    justify-content: space-between;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--border);
    background: transparent;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s;
}

.tab-btn.active {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(0, 118, 255, 0.05);
}

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

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

input[type="text"], select, input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 1rem;
}

.color-pickers {
    display: flex;
    gap: 20px;
}

.color-field {
    flex: 1;
}

input[type="color"] {
    width: 100%;
    height: 40px;
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
}

.preview-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #eaeaea;
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 20px;
    min-height: 250px;
}

#previewCanvas {
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: transparent;
    max-width: 200px;
    width: 100%;
    height: auto;
}

.btn-generate {
    width: 100%;
    padding: 15px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-generate:hover {
    background: #005bc5;
}

.code-output {
    margin-top: 20px;
}

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

.code-header label {
    font-weight: bold;
}

.btn-copy {
    background: #e1e1e1;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-copy:hover {
    background: var(--primary);
    color: white;
}

.code-output pre {
    background: #272822;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
}

.hidden { 
    display: none !important; 
}

footer {
    text-align: center;
    padding: 30px 20px 10px 20px;
    margin-top: auto;
    font-size: 0.95rem;
}

footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
}