:root {
    --primary-color: #047857;
    --primary-dark: #065f46;
    --secondary-color: #d97706;
    --accent-color: #8b5cf6;
    --bg-light: #f3f4f6;
    --text-dark: #1f2937;
    --card-bg: #ffffff;
    --canvas-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--bg-light);
    margin: 0;
    padding: 0;
}

.poster-maker-container {
    display: flex;
    flex-direction: row-reverse;
    height: calc(100vh - 80px); /* Adjust based on header height */
    overflow: hidden;
}

/* Editor Toolbar */
.editor-toolbar {
    width: 350px;
    background: var(--card-bg);
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    padding: 20px;
    overflow-y: auto;
    z-index: 10;
}

.toolbar-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.toolbar-section h3 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Canvas Area */
.canvas-area {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #e5e7eb;
    padding: 20px;
    position: relative;
    overflow: auto;
}

.canvas-wrapper {
    position: relative;
    box-shadow: var(--canvas-shadow);
    background: white;
}

canvas {
    display: block;
    max-width: 100%;
}

/* Controls */
.control-group {
    margin-bottom: 15px;
}

.control-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="text"], 
input[type="number"], 
select, 
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: inherit;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s;
    border: none;
    width: 100%;
    margin-bottom: 10px;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.color-pill {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.2s;
}

.color-pill:hover {
    transform: scale(1.1);
}

.color-pill.active {
    border-color: #000;
}

/* Text Items List */
.text-layers-list {
    margin-top: 10px;
}

.layer-item {
    background: #f9fafb;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border: 1px solid transparent;
}

.layer-item.active {
    border-color: var(--primary-color);
    background: #ecfdf5;
}

.layer-actions {
    display: flex;
    gap: 5px;
}

.layer-actions i {
    cursor: pointer;
    color: #666;
}

.layer-actions i:hover {
    color: #dc2626;
}

.presets-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 5px;
    margin-top: 5px;
}

/* Background Presets */
.bg-presets {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.bg-preset {
    aspect-ratio: 1;
    border-radius: 4px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
}

.bg-preset.active {
    border-color: var(--primary-color);
}

/* Responsive */
@media (max-width: 900px) {
    .poster-maker-container {
        flex-direction: column;
        height: auto;
    }
    .editor-toolbar {
        width: 100%;
        order: 2;
        height: auto;
    }
    .canvas-area {
        order: 1;
        min-height: 400px;
    }
}
