:root {
    --primary-color: #007bff;
    --text-color: #f0f0f0; /* Lighter text for dark background */
    --border-radius: 0.8rem;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

body {
    font-family: var(--font-family);
    /* Add a gradient/image background to make the glass effect visible */
    background: linear-gradient(135deg, #2b2d42, #1d1e2c);
    color: var(--text-color);
    margin: 0;
    padding: 2rem;
    min-height: 100vh;
    box-sizing: border-box;
}

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

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

h1 {
    font-size: 2.5rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.main-content {
    display: grid;
    /* Change to 1fr 1fr for a 50/50 split */
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.controls-panel, .preview-panel {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* This is where the magic happens */
.card {
    /* Frosted glass effect */
    background: rgba(255, 255, 255, 0.08); /* Semi-transparent background */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px); /* For Safari */
    
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.card-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.card-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.control-group label {
    font-weight: 500;
    font-size: 0.9rem;
    color: #d0d0d0; /* Lighter label color */
}

input[type="number"],
textarea {
    background: rgba(0, 0, 0, 0.2);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    padding: 0.75rem;
    font-size: 1rem;
    box-sizing: border-box;
    transition: background-color 0.2s, border-color 0.2s;
}

input[type="number"]:focus,
textarea:focus {
    background: rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 123, 255, 0.5);
    outline: none;
}

input[type="color"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 100%;
    height: 40px;
    background-color: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
    cursor: pointer;
}
input[type="color"]::-webkit-color-swatch {
    border-radius: 0.25rem;
    border: none;
}
input[type="color"]::-moz-color-swatch {
    border-radius: 0.25rem;
    border: none;
}


textarea {
    resize: vertical;
    min-height: 80px;
}

.file-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: rgba(255, 255, 255, 0.1);
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.file-label:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.file-label input[type="file"] {
    display: none;
}

#file-name {
    font-size: 0.9rem;
    color: #a0a0a0;
    margin-top: 0.5rem;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 0.5rem;
}

button {
    padding: 0.85rem 1rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

button.primary {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

button.primary:hover {
    background-color: #0069d9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.3);
}

#save-btn {
    background-color: transparent;
    color: #f0f0f0;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#save-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

canvas {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    background-color: rgba(0,0,0,0.1);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 0.5rem;
}

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