:root {
    --bg-color: #0F1215;
    --card-bg: rgba(255, 255, 255, 0.05);
    --primary-color: #636E72;
    --secondary-color: #B2BEC3;
    --accent-color: #00B894;
    --text-color: #F5F5F5;
    --text-muted: #B2BEC3;
    --border-color: rgba(255, 255, 255, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 184, 148, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(99, 110, 114, 0.1) 0%, transparent 40%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem 1rem;
}

.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

header {
    text-align: center;
    margin-bottom: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.logo i {
    color: var(--accent-color);
    width: 32px;
    height: 32px;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -1px;
}

.logo h1 span {
    color: var(--accent-color);
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

main {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
}

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

.creator-section, .preview-section {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: calc(var(--radius) - 4px);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.75rem;
    border-radius: calc(var(--radius) - 6px);
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.tab-btn i {
    width: 18px;
    height: 18px;
}

.tab-btn:hover {
    color: var(--text-color);
}

.tab-btn.active {
    background: var(--primary-color);
    color: white;
}

.tab-content {
    display: none;
    flex-direction: column;
    gap: 1.25rem;
    animation: fadeIn 0.3s ease;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-muted);
}

input[type="text"], select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    width: 100%;
}

input[type="text"]:focus, select:focus {
    outline: none;
    border-color: var(--accent-color);
}

.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 100%;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 3rem 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.upload-area:hover, .upload-area.drag-over {
    border-color: var(--accent-color);
    background: rgba(0, 184, 148, 0.05);
}

.upload-area i {
    width: 48px;
    height: 48px;
    color: var(--primary-color);
}

.hidden {
    display: none;
}

.preview-card h3 {
    margin-bottom: 1.25rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.canvas-container {
    background: #000;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.canvas-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    opacity: 0.3;
}

#main-canvas {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    background-image: 
        linear-gradient(45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(-45deg, #1a1a1a 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #1a1a1a 75%),
        linear-gradient(-45deg, transparent 75%, #1a1a1a 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.preview-samples {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    gap: 1rem;
}

.sample {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.sample span {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sample-icon {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    border: 1px solid var(--border-color);
}

.sample-icon.small { width: 16px; height: 16px; }
.sample-icon.medium { width: 32px; height: 32px; }
.sample-icon.large { width: 48px; height: 48px; } /* displayed smaller for UI */

.actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-primary, .btn-secondary, .btn-accent {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    width: 100%;
}

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

.btn-primary:hover {
    background: #535c5f;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

.btn-accent {
    background: var(--accent-color);
    color: white;
}

.btn-accent:hover {
    background: #00a383;
}

footer {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.875rem;
    padding: 1rem 0;
}

input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: var(--accent-color);
    cursor: pointer;
    margin-top: -6px;
}

#toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    background: var(--primary-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    animation: slideIn 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
    font-size: 0.875rem;
    font-weight: 500;
    min-width: 200px;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}
