/* ============================================
   INDIAN CARD DESIGNER - STYLES
   ============================================ */

/* --- CSS Variables / Theming --- */
:root,
[data-theme="light"] {
    --bg-primary: #f5f0eb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #faf7f4;
    --bg-canvas: #e8e0d8;
    --text-primary: #2c1810;
    --text-secondary: #5a4a3f;
    --text-muted: #8a7a6f;
    --border-color: #d4c5b9;
    --border-light: #e8ddd4;
    --accent: #c41e3a;
    --accent-hover: #a01830;
    --accent-light: #fce8ec;
    --gold: #d4a017;
    --gold-light: #fdf3d7;
    --shadow-sm: 0 1px 3px rgba(44,24,16,0.08);
    --shadow-md: 0 4px 12px rgba(44,24,16,0.1);
    --shadow-lg: 0 8px 30px rgba(44,24,16,0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --sidebar-width: 260px;
    --props-width: 280px;
    --toolbar-height: 52px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg-primary: #1a1210;
    --bg-secondary: #252019;
    --bg-tertiary: #2e2820;
    --bg-canvas: #3a322a;
    --text-primary: #f0e8e0;
    --text-secondary: #c0b0a0;
    --text-muted: #887868;
    --border-color: #4a4038;
    --border-light: #3a3028;
    --accent: #e85a72;
    --accent-hover: #d44060;
    --accent-light: #3a2028;
    --gold: #e8b830;
    --gold-light: #3a3020;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.5;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* --- Toolbar --- */
#toolbar {
    height: var(--toolbar-height);
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    gap: 12px;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.toolbar-center {
    gap: 2px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
}

.logo-icon {
    font-size: 22px;
    color: var(--accent);
    font-weight: 700;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: 'Playfair Display', serif;
}

.toolbar-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    white-space: nowrap;
    transition: all var(--transition);
}

.toolbar-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

.toolbar-btn.primary:hover {
    background: var(--accent-hover);
}

.toolbar-btn.icon-only {
    padding: 6px 8px;
}

.toolbar-btn svg {
    flex-shrink: 0;
}

.toolbar-separator {
    width: 1px;
    height: 24px;
    background: var(--border-light);
    margin: 0 4px;
}

/* --- Main Layout --- */
#main-content {
    display: flex;
    height: calc(100vh - var(--toolbar-height));
}

/* --- Sidebar --- */
#sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.sidebar-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0;
    flex-shrink: 0;
}

.sidebar-tab {
    flex: 1;
    padding: 10px 4px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    border-bottom: 2px solid transparent;
}

.sidebar-tab:hover {
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.sidebar-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
}

.sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.sidebar-panel {
    display: none;
}

.sidebar-panel.active {
    display: block;
}

.sidebar-section {
    margin-bottom: 16px;
}

.section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    padding: 4px 4px 8px;
}

.sidebar-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sidebar-items.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    cursor: grab;
    transition: all var(--transition);
    border: 1px solid transparent;
    background: var(--bg-tertiary);
}

.sidebar-item:hover {
    background: var(--accent-light);
    border-color: var(--accent);
    color: var(--accent);
}

.sidebar-item:active {
    cursor: grabbing;
    transform: scale(0.97);
}

.sidebar-item.square {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 4px;
    aspect-ratio: 1;
    gap: 4px;
}

.item-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--accent);
    flex-shrink: 0;
}

.item-label {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-secondary);
}

.item-label-sm {
    font-size: 10px;
    color: var(--text-muted);
    text-align: center;
}

.decor-preview {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.decor-preview svg {
    width: 100%;
    height: 100%;
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    color: var(--text-muted);
    margin-bottom: 12px;
}

.upload-area:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-light);
}

.upload-area svg {
    margin-bottom: 8px;
}

.upload-area p {
    font-size: 11px;
}

/* --- Canvas Area --- */
#canvas-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg-canvas);
}

#canvas-container {
    flex: 1;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
}

#canvas {
    background: #fff;
    position: relative;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    transition: width 0.3s ease, height 0.3s ease;
    transform-origin: center center;
}

#canvas.drop-active {
    outline: 3px dashed var(--accent);
    outline-offset: 4px;
}

/* Canvas Controls */
#canvas-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.canvas-ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.canvas-ctrl-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

#zoom-level {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 40px;
    text-align: center;
}

#card-size-select {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    font-size: 11px;
    font-family: inherit;
    cursor: pointer;
}

/* --- Canvas Elements --- */
.canvas-element {
    position: absolute;
    cursor: move;
    user-select: none;
    min-width: 20px;
    min-height: 20px;
    transition: box-shadow 0.15s ease;
}

.canvas-element:hover {
    outline: 1px solid rgba(196, 30, 58, 0.3);
}

.canvas-element.selected {
    outline: 2px solid var(--accent);
    z-index: 999 !important;
}

.canvas-element.editing {
    outline: 2px solid var(--gold);
    cursor: text;
}

/* Element Content */
.element-content {
    width: 100%;
    height: 100%;
    outline: none;
    overflow: hidden;
}

.element-content[contenteditable="true"] {
    cursor: text;
}

/* Resize Handles */
.resize-handles {
    display: none;
}

.canvas-element.selected .resize-handles {
    display: block;
}

.resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: white;
    border: 2px solid var(--accent);
    border-radius: 2px;
    z-index: 1000;
}

.resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }
.resize-handle.n { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.resize-handle.s { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.resize-handle.e { right: -5px; top: 50%; transform: translateY(-50%); cursor: e-resize; }
.resize-handle.w { left: -5px; top: 50%; transform: translateY(-50%); cursor: w-resize; }

.rotate-handle {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    background: white;
    border: 2px solid var(--gold);
    border-radius: 50%;
    cursor: grab;
    z-index: 1000;
    display: none;
}

.rotate-handle::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 14px;
    background: var(--gold);
}

.canvas-element.selected .rotate-handle {
    display: block;
}

/* --- Properties Panel --- */
#properties-panel {
    width: var(--props-width);
    background: var(--bg-secondary);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

#props-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

#props-header h3 {
    font-size: 13px;
    font-weight: 600;
}

#props-content {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.props-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 40px 16px;
    font-size: 12px;
}

.props-section {
    margin-bottom: 16px;
}

.props-section-title {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.props-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.props-row label {
    font-size: 11px;
    color: var(--text-secondary);
    min-width: 55px;
    flex-shrink: 0;
}

.props-row input[type="text"],
.props-row input[type="number"],
.props-row select,
.props-row textarea {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.props-row input:focus,
.props-row select:focus,
.props-row textarea:focus {
    border-color: var(--accent);
}

.props-row input[type="color"] {
    width: 32px;
    height: 28px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    padding: 2px;
    background: var(--bg-tertiary);
}

.props-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.props-row .small-input {
    width: 60px;
    flex: none;
}

.props-btn-group {
    display: flex;
    gap: 2px;
}

.props-btn {
    padding: 4px 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    transition: all var(--transition);
    font-family: inherit;
}

.props-btn:hover,
.props-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.props-font-select {
    width: 100%;
}

/* Language toggle */
.lang-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.lang-btn {
    padding: 3px 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 12px;
    cursor: pointer;
    font-size: 10px;
    transition: all var(--transition);
    font-family: inherit;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* --- Modal --- */
#modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.2s ease;
}

#modal-overlay.hidden {
    display: none;
}

#modal-container {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 800px;
    max-height: 85vh;
    width: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: modalIn 0.25s ease;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    font-family: 'Playfair Display', serif;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all var(--transition);
    font-size: 18px;
}

.modal-close:hover {
    background: var(--accent);
    color: white;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

/* Modal Buttons */
.btn {
    padding: 8px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    transition: all var(--transition);
}

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

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--border-color);
}

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

.btn-gold:hover {
    background: #b88a14;
}

/* --- Event Type Selector (New Card Modal) --- */
.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.event-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 12px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: var(--bg-tertiary);
}

.event-card:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.event-card.selected {
    border-color: var(--accent);
    background: var(--accent-light);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.event-card-icon {
    font-size: 32px;
    line-height: 1;
}

.event-card-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
}

.event-card-sub {
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Theme Picker --- */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
}

.theme-card {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    overflow: hidden;
}

.theme-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 30, 58, 0.15);
}

.theme-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.theme-preview-inner {
    width: 60px;
    height: 84px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 6px;
    gap: 4px;
}

.theme-preview-inner .line {
    height: 3px;
    border-radius: 2px;
    width: 70%;
}

.theme-preview-inner .line.short {
    width: 50%;
}

.theme-info {
    padding: 10px 12px;
    background: var(--bg-secondary);
}

.theme-name {
    font-size: 12px;
    font-weight: 600;
}

.theme-desc {
    font-size: 10px;
    color: var(--text-muted);
}

/* --- Guided Form / Wizard --- */
.wizard-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.wizard-step {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    transition: all var(--transition);
}

.wizard-step.active {
    background: var(--accent);
    color: white;
}

.wizard-step.completed {
    background: #2d9c5a;
    color: white;
}

.wizard-step-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 600;
    background: rgba(255,255,255,0.2);
}

.wizard-form {
    max-width: 500px;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 60px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* --- Preview Modal --- */
.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.preview-tabs {
    display: flex;
    gap: 8px;
}

.preview-tab {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 12px;
    font-family: inherit;
    transition: all var(--transition);
}

.preview-tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.preview-card-wrap {
    max-width: 100%;
    overflow: auto;
}

.preview-mobile {
    width: 375px;
    border: 8px solid #333;
    border-radius: 30px;
    padding: 10px;
    background: #fff;
}

/* --- Export Modal --- */
.export-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.export-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    text-align: center;
    background: var(--bg-tertiary);
}

.export-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
    transform: translateY(-2px);
}

.export-option-icon {
    font-size: 28px;
}

.export-option-label {
    font-size: 13px;
    font-weight: 600;
}

.export-option-desc {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Share Modal --- */
.share-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg-tertiary);
}

.share-option:hover {
    border-color: var(--accent);
    background: var(--accent-light);
}

.share-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.share-icon.whatsapp {
    background: #25D366;
    color: white;
}

.share-icon.email {
    background: #4285F4;
    color: white;
}

.share-icon.link {
    background: var(--gold);
    color: white;
}

.share-text h4 {
    font-size: 13px;
    font-weight: 600;
}

.share-text p {
    font-size: 11px;
    color: var(--text-muted);
}

/* --- Toast Notification --- */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 13px;
    box-shadow: var(--shadow-md);
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.5s forwards;
    max-width: 320px;
}

.toast.success {
    background: #2d9c5a;
}

.toast.error {
    background: #c41e3a;
}

.toast.info {
    background: #3b82f6;
}

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

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

/* --- Decorative Element Styles on Canvas --- */
.decor-element svg,
.icon-element svg {
    width: 100%;
    height: 100%;
}

/* --- Canvas Background Patterns --- */
.canvas-bg-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.15;
}

/* --- Image Element on Canvas --- */
.image-element {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Drag Ghost --- */
.drag-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 99999;
    opacity: 0.8;
    padding: 6px 12px;
    background: var(--accent);
    color: white;
    border-radius: var(--radius-sm);
    font-size: 12px;
    white-space: nowrap;
}

/* --- Empty State --- */
.canvas-empty-state {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    pointer-events: none;
    opacity: 0.6;
}

.canvas-empty-state svg {
    margin-bottom: 16px;
    opacity: 0.4;
}

.canvas-empty-state p {
    font-size: 14px;
    margin-bottom: 4px;
}

.canvas-empty-state span {
    font-size: 11px;
}

/* --- Utility --- */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

/* Selection info bar */
.selection-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: var(--accent-light);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 500;
}

/* Canvas border decoration overlays */
.canvas-border-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 1;
}

/* --- AI Button Glow --- */
.toolbar-btn.ai-glow {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.12), rgba(196, 30, 58, 0.12));
    color: #9c6eff;
    border: 1px solid rgba(124, 77, 255, 0.25);
}

.toolbar-btn.ai-glow:hover {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(196, 30, 58, 0.2));
    color: #b388ff;
    border-color: rgba(124, 77, 255, 0.4);
    box-shadow: 0 0 16px rgba(124, 77, 255, 0.15);
}

/* --- AI Modal - Coming Soon --- */
.ai-coming-soon {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 32px 16px;
}

.ai-coming-soon-icon {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.12), rgba(196, 30, 58, 0.08));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: aiPulse 2.5s ease-in-out infinite;
}

@keyframes aiPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.15); }
    50% { box-shadow: 0 0 0 16px rgba(124, 77, 255, 0); }
}

.ai-coming-tag {
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 12px;
}

/* --- Background Image Controls --- */
.bg-image-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.bg-preview-area {
    width: 100%;
    height: 160px;
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    background: var(--bg-tertiary);
}

.bg-preview-area:hover {
    border-color: var(--accent);
}

.bg-preview-area img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.bg-preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 12px;
}

.bg-controls-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bg-controls-row label {
    font-size: 12px;
    color: var(--text-secondary);
    min-width: 60px;
}

.bg-controls-row input[type="range"] {
    flex: 1;
    accent-color: var(--accent);
}

.bg-controls-row select {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 12px;
    font-family: inherit;
}

.canvas-bg-image {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Ensure canvas elements are above background */
.canvas-element {
    z-index: 2;
}

/* --- Responsive (basic) --- */
@media (max-width: 1024px) {
    #sidebar {
        width: 200px;
    }
    #properties-panel {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .toolbar-btn span {
        display: none;
    }
    #sidebar {
        width: 180px;
    }
    #properties-panel {
        width: 220px;
    }
}
