/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Main Colors */
    --primary-bg: #1e1e1e;
    --secondary-bg: #292929;
    --panel-bg: #333333;
    --border-color: #3a3a3a;
    --text-color: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-color: #2b7de9;
    --danger-color: #e53935;
    --success-color: #43a047;

    /* UI Elements */
    --btn-bg: #3a3a3a;
    --btn-hover: #4a4a4a;
    --slider-bg: #3a3a3a;
    --slider-thumb: var(--accent-color);

    /* Spacing */
    --space-xs: 4px;
    --space-s: 8px;
    --space-m: 12px;
    --space-l: 16px;
    --space-xl: 24px;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background-color: var(--primary-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
}

/* App Container */
.app-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    position: relative;
    padding: 0;
}

/* Connect toolbar and content visually */
.toolbar-and-content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin: 0;
    /* Remove margin for flush layout */
    height: 100vh;
}

/* Toolbar */
.toolbar {
    background-color: #1a1a1a;
    /* Match sidebar background */
    padding: var(--space-m);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: none;
    /* Remove shadow */
    z-index: 10;
    margin: 0;
    border-radius: 12px 12px 0 0;
    /* Round top corners to match panels */
    border: 1px solid #2a2a2a;
    /* Add border around all sides */
    border-bottom: none;
    /* Remove bottom border */
}

.toolbar-left,
.toolbar-center,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

/* App Logo */
.app-logo {
    display: flex;
    align-items: center;
    margin-right: var(--space-l);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #2b7de9, #66c3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    user-select: none;
}

.toolbar-right {
    margin-left: auto;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-s);
    background-color: #3a3a3a;
    border: none;
    border-radius: 6px;
    color: var(--text-color);
    padding: var(--space-s) var(--space-l);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 1;
    position: relative;
    overflow: hidden;
}

.btn * {
    pointer-events: none;
    user-select: none;
}

.btn:hover:not(:disabled) {
    background-color: #4a4a4a;
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.icon-btn {
    padding: var(--space-s);
    font-size: 16px;
}

.small-btn {
    padding: 6px 12px;
    font-size: 13px;
}

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

.primary-btn:hover:not(:disabled) {
    background-color: #3b92ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 146, 255, 0.3);
}

/* Ensure primary button hover works with proper specificity */
#export-btn.primary-btn:hover:not(:disabled) {
    background-color: #3b92ff !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(59, 146, 255, 0.3);
}

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

.danger-btn:hover:not(:disabled) {
    background-color: #c62828;
}

/* All buttons use same dark styling */
.success-btn {
    background-color: #3a3a3a;
    /* Dark theme grey */
}

.success-btn:hover:not(:disabled) {
    background-color: #4a4a4a;
    /* Darker for hover */
}

/* Donate button is now a proper button element, no special styling needed */

/* Main Content */
.main-content {
    display: flex;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
    padding: 0;
    /* Flush layout */
    gap: 0;
    /* No gaps */
    position: relative;
    margin: 0;
    border-radius: 0;
    /* Flush layout */
    border: none;
    border-top: 1px solid #2a2a2a;
    /* Separation from toolbar */
    background-color: var(--primary-bg);
}

/* Left Column (Canvas Area) */
.left-column {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    /* Allow shrinking */
    overflow: hidden;
    background-color: #0d0d0d;
    /* Slightly darker than sidebars */
}

/* Gallery Bar (vertical left side) */
/* Gallery Bar (vertical left side) */
.gallery-bar {
    display: flex;
    flex-direction: column;
    background-color: #1a1a1a;
    width: 320px;
    /* Increased from 280px */
    height: 100%;
    min-height: 0;
    border-radius: 0;
    /* Cleaner flat look */
    box-shadow: none;
    overflow: hidden;
    margin-right: 0;
    /* Remove margin for flush look */
    border-right: 1px solid var(--border-color);
    /* Add separation border */
    border-left: none;
    border-top: none;
    border-bottom: none;
}

/* Remove .hidden class override since gallery should always show */
.gallery-bar.hidden {
    display: flex;
    /* Always show gallery */
}

.gallery-content-wrapper {
    display: flex;
    flex-direction: column;
    padding: var(--space-m);
    overflow: hidden;
    background-color: #1a1a1a;
    /* Match control panel background */
}

.gallery-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-s);
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--space-s);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
    min-height: 100%;
    max-height: calc(100vh - 150px);
    align-items: start;
}

/* Make gallery content scrollbar match customize sidebar */
.gallery-content::-webkit-scrollbar {
    width: 8px;
}

.gallery-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.gallery-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.gallery-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

.gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    cursor: pointer;
    border-radius: 6px;
    padding: 4px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    border: 1px solid transparent;
    align-self: start;
}

.gallery-item:hover .gallery-item-image {
    background-color: rgba(255, 255, 255, 0.05);
    transform: scale(1.02);
}

.gallery-item.selected .gallery-item-image {
    background-color: rgba(67, 160, 71, 0.2);
    border: 2px solid var(--accent-color);
    box-shadow: 0 0 0 2px rgba(67, 160, 71, 0.3);
    transform: scale(1.02);
}

.gallery-item-image {
    width: 100%;
    aspect-ratio: 1;
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    background-color: var(--panel-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    /* Center content horizontally */
}

.gallery-item-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Canvas Container */
.canvas-container {
    flex: 1;
    padding: 40px;
    /* Internal breathing room */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background-color: #0d0d0d;
    position: relative;
    border-radius: 0;
    margin-bottom: 0;
    border: none;
}

.canvas-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    overflow: auto;
    scrollbar-width: thin;
}

.canvas-preview {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100%;
    min-height: 100%;
    overflow: visible;
}

.image-drop-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(30, 30, 30, 0.7);
    border: 2px dashed #555;
    border-radius: 8px;
    z-index: 10;
}

.image-drop-zone.hidden {
    display: none;
}

.upload-prompt {
    text-align: center;
    max-width: 250px;
}

.upload-prompt i {
    font-size: 48px;
    color: #888;
    margin-bottom: 16px;
}

.upload-prompt p {
    margin-bottom: 20px;
    color: #ddd;
}

#preview-canvas {
    max-width: 50%;
    max-height: 50%;
    width: auto;
    height: auto;
    display: block;
    background-color: transparent;
    object-fit: contain;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border: none;
    transform-origin: center center;
}

/* Gallery Bar (left side) */
.gallery-header,
.gallery-header h3 {
    display: none;
}

.gallery-header .gallery-actions {
    display: flex;
    gap: var(--space-s);
}

.gallery-item-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.gallery-item:hover .gallery-item-remove {
    opacity: 1;
}

.gallery-item-remove i {
    font-size: 12px;
    color: white;
}

/* Adjustments */
.adjustment-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-xs) 0;
    margin-bottom: var(--space-s);
}

.adjustment-row label {
    font-size: 14px;
    font-weight: 400;
    color: var(--text-color);
}

.value-display {
    font-size: 14px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Sliders */
.slider-container {
    padding: 0;
    margin-bottom: var(--space-m);
}

.slider-container input[type="range"] {
    width: 100%;
    height: 4px;
    background: #2a2a2a;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.slider-container input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3b82f6;
    border: 2px solid #1a1a1a;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

/* Reset buttons */
.reset-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.2s ease;
    cursor: pointer;
    padding: 4px;
    margin-left: 8px;
}

.reset-btn:hover:not(:disabled) {
    opacity: 1;
}

.reset-btn:disabled {
    opacity: 0.3;
}

/* Section collapse/expand icons */
.settings-section .section-header::after {
    content: '\f077';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 12px;
    color: #3b82f6;
    transition: transform 0.2s ease;
}

.settings-section.collapsed .section-header::after {
    transform: rotate(180deg);
}

.settings-section .section-content {
    padding: 0;
    padding-bottom: 20px;
}

/* Export Settings */
.export-settings-section {
    padding: var(--space-l);
    border-bottom: 1px solid var(--border-color);
}

.export-settings-section h4 {
    margin-bottom: var(--space-m);
    font-size: 16px;
    font-weight: 600;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-m);
}

.setting-row label {
    flex: 0 0 80px;
    font-size: 14px;
}

.select-control {
    flex: 1;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.number-input {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
}

.dimension-input-container {
    display: flex;
    align-items: center;
    margin-right: var(--space-l);
}

.dimension-input-container label {
    flex: 0 0 60px;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.checkbox-container input[type="checkbox"] {
    margin-right: var(--space-s);
}

#custom-size-controls {
    flex-wrap: wrap;
    padding-top: var(--space-s);
}

#custom-size-controls.hidden {
    display: none;
}

.modal .button-row {
    padding: var(--space-l);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-m);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* Increased z-index */
    backdrop-filter: blur(4px);
}

.modal.visible {
    display: flex !important;
    /* Added !important */
}

.modal-content {
    background-color: var(--secondary-bg);
    border-radius: 12px;
    width: 500px;
    /* Reduced width for better proportions */
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-l);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.modal-header h3 i {
    color: var(--accent-color);
    font-size: 20px;
}

.modal-body {
    padding: var(--space-l);
    flex: 1;
    overflow-y: auto;
}

/* Export Settings Section */
.export-settings-section {
    margin-bottom: var(--space-xl);
}

.export-settings-section h4 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: var(--space-l);
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-l);
    gap: var(--space-m);
}

.setting-row label {
    flex: 0 0 80px;
    font-size: 14px;
    color: var(--text-color);
}

.select-control {
    flex: 1;
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 14px;
    height: 40px;
}

/* Custom Size Controls */
#custom-size-controls {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-m);
    padding: var(--space-m) 0;
    border-top: 1px solid var(--border-color);
    margin-top: var(--space-m);
}

.dimension-input-container {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.dimension-input-container label {
    flex: 0 0 auto;
    font-size: 14px;
    color: var(--text-color);
}

.number-input {
    background-color: var(--panel-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    width: 100px;
    height: 36px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    margin-left: auto;
}

.checkbox-container input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
}

.checkbox-container label {
    font-size: 14px;
    color: var(--text-color);
}

/* Button Row */
.modal .button-row {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-m);
    padding: var(--space-l);
    border-top: 1px solid var(--border-color);
    background-color: var(--secondary-bg);
}

.modal .button-row button {
    min-width: 100px;
    height: 36px;
}

/* Hide custom size controls when not needed */
#custom-size-controls.hidden {
    display: none;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .modal-content {
        width: 95%;
    }

    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-s);
    }

    .setting-row label {
        margin-bottom: var(--space-xs);
    }

    .select-control {
        width: 100%;
    }

    #custom-size-controls {
        flex-direction: column;
    }

    .dimension-input-container {
        width: 100%;
    }

    .checkbox-container {
        margin-left: 0;
        margin-top: var(--space-s);
    }
}

/* History Items */
.history-items {
    overflow-y: auto;
    max-height: 400px;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.history-item {
    display: flex;
    align-items: center;
    padding: var(--space-m) var(--space-l);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.history-item-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: var(--space-m);
}

.history-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.history-item-info {
    flex: 1;
}

.history-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.history-item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: var(--space-m);
}

.history-item-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.history-item-btn.download {
    color: var(--accent-color);
}

.history-item-btn.delete {
    color: var(--danger-color);
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-history i {
    font-size: 60px;
    color: #555;
    margin-bottom: var(--space-l);
}

.empty-history h4 {
    font-size: 20px;
    margin-bottom: var(--space-s);
}

.empty-history p {
    color: var(--text-secondary);
}

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

/* Shadow Position Control */
.shadow-position-control {
    margin: 0 var(--space-m) var(--space-l);
}

.shadow-position-grid {
    width: 100%;
    aspect-ratio: 1;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    position: relative;
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.shadow-position-handle {
    width: 16px;
    height: 16px;
    background-color: var(--accent-color);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    cursor: grab;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

.shadow-position-handle:active {
    cursor: grabbing;
}

/* Remove old gallery panel styles */
.gallery-panel {
    display: none;
}

/* Fix for any old gallery styles */
.control-panel.gallery-panel {
    display: none;
}

.button-container {
    display: flex;
    justify-content: flex-end;
    padding: 0 var(--space-m);
    margin-bottom: var(--space-m);
}

/* Text Layers */
.text-layers-list {
    margin-bottom: var(--space-m);
}

.empty-text-layers {
    padding: var(--space-m);
    color: var(--text-secondary);
    text-align: center;
    font-style: italic;
}

.text-layer-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-s) var(--space-m);
    margin-bottom: var(--space-xs);
    background-color: var(--panel-bg);
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.text-layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-layer-item.selected {
    background-color: rgba(43, 125, 233, 0.15);
    border-left: 3px solid var(--accent-color);
}

.text-layer-info {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    flex: 1;
    overflow: hidden;
}

.text-layer-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.text-layer-actions {
    display: flex;
    gap: var(--space-xs);
}

.text-layer-actions button {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    padding: 4px;
    transition: color 0.2s ease;
}

.text-layer-actions button:hover {
    color: var(--text-color);
}

.text-layer-visibility {
    margin-right: 8px;
    cursor: pointer;
    color: white;
}

.text-layer-visibility.hidden {
    opacity: 0.5;
}

/* Text Editor */
.text-editor {
    margin-top: var(--space-m);
}

.form-group {
    margin-bottom: var(--space-m);
}

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

.form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: var(--text-secondary);
    font-style: italic;
}

textarea,
select {
    width: 100%;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    padding: var(--space-s);
    font-size: 14px;
    resize: vertical;
}

.text-align-buttons,
.text-style-buttons {
    display: flex;
    gap: var(--space-xs);
}

.text-align-buttons .btn,
.text-style-buttons .btn {
    flex: 1;
    justify-content: center;
}

.text-align-buttons .btn.active,
.text-style-buttons .btn.active {
    background-color: var(--accent-color);
}

/* Draggable text on canvas */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 5px;
    transition: transform 0.1s ease;
    z-index: 10;
}

.text-element.selected {
    outline: 2px solid var(--accent-color);
}

.text-element-controls {
    position: absolute;
    top: -30px;
    right: 0;
    display: flex;
    gap: 5px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 4px;
    padding: 4px;
}

.text-element-controls button {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    width: 24px;
    height: 24px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
}

.text-element-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Delete button */
.text-element-controls .delete-text-btn {
    color: #ff6b6b;
}

/* Control Panels - Refactored for Robustness */
/* Control Panels - Refactored for Robustness */
.control-panels {
    display: flex;
    flex-direction: column;
    width: 440px;
    /* Increased from 380px to 440px for more breathing room */
    height: 100%;
    margin-left: auto;
    overflow: hidden;
    border-left: 1px solid var(--border-color);
}

.control-panel {
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    border: none;
    overflow: hidden;
    /* Ensure only content scrolls */
}

.panel-title {
    padding: var(--space-m) var(--space-l);
    font-size: 14px;
    font-weight: 600;
    background-color: #1a1a1a;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

.panel-title #apply-to-all-btn {
    margin-left: auto;
    font-size: 12px;
    padding: 5px 10px;
}

.panel-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    min-height: 0;
    /* Critical for nested flex scrolling */
    padding-bottom: 40px;
    /* Space for bottom elements */
    -webkit-overflow-scrolling: touch;
}

/* Settings sections - remove grey background */
.settings-section {
    margin: 0;
    padding: var(--space-m) var(--space-l);
    position: relative;
    border-radius: 0;
    background-color: transparent;
    border-bottom: 1px solid #2a2a2a;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    min-height: auto !important;
}

.settings-section.collapsed {
    opacity: 0.85;
    padding: var(--space-s) var(--space-l);
    overflow: hidden;
}

.settings-section .section-header {
    padding: var(--space-s) 0;
    margin-bottom: var(--space-m);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: transparent;
}

.settings-section.collapsed .section-header {
    margin-bottom: 0;
}

/* Clean up section headers */
.settings-section .section-header h5 {
    margin: 0;
    flex: 1;
}

.settings-section .section-header button {
    margin-left: auto;
    flex-shrink: 0;
}

/* Ensure content transitions smoothly */
.settings-section .section-content {
    transition: opacity 0.3s ease, max-height 0.3s ease;
    max-height: 2000px;
    opacity: 1;
    padding: 0;
    height: auto !important;
}

.settings-section.collapsed .section-content {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

/* Export Settings */
.export-settings-section {
    padding: var(--space-l);
    border-bottom: 1px solid var(--border-color);
}

.export-settings-section h4 {
    margin-bottom: var(--space-m);
    font-size: 16px;
    font-weight: 600;
}

.setting-row {
    display: flex;
    align-items: center;
    margin-bottom: var(--space-m);
}

.setting-row label {
    flex: 0 0 80px;
    font-size: 14px;
}

.select-control {
    flex: 1;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
}

.number-input {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    width: 80px;
}

.dimension-input-container {
    display: flex;
    align-items: center;
    margin-right: var(--space-l);
}

.dimension-input-container label {
    flex: 0 0 60px;
    font-size: 14px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.checkbox-container input[type="checkbox"] {
    margin-right: var(--space-s);
}

#custom-size-controls {
    flex-wrap: wrap;
    padding-top: var(--space-s);
}

#custom-size-controls.hidden {
    display: none;
}

.modal .button-row {
    padding: var(--space-l);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-m);
}

/* Improved zoom controls */
.canvas-zoom-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 10;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 20px;
    padding: 5px;
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* Increased z-index */
    backdrop-filter: blur(4px);
}

.modal.visible {
    display: flex !important;
    /* Added !important */
}

.modal-content {
    background-color: var(--secondary-bg);
    border-radius: 8px;
    width: 700px;
    max-width: 90%;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

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

.modal-actions {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 18px;
    cursor: pointer;
    padding: var(--space-s);
}

.modal-body {
    padding: 0;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}

/* History Items */
.history-items {
    overflow-y: auto;
    max-height: 400px;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.history-item {
    display: flex;
    align-items: center;
    padding: var(--space-m) var(--space-l);
    border-bottom: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.history-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.history-item-image {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    margin-right: var(--space-m);
}

.history-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.history-item-info {
    flex: 1;
}

.history-item-name {
    font-weight: 500;
    margin-bottom: 4px;
}

.history-item-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.history-item-actions {
    display: flex;
    gap: var(--space-m);
}

.history-item-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.2s ease;
}

.history-item-btn.download {
    color: var(--accent-color);
}

.history-item-btn.delete {
    color: var(--danger-color);
}

.empty-history {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.empty-history i {
    font-size: 60px;
    color: #555;
    margin-bottom: var(--space-l);
}

.empty-history h4 {
    font-size: 20px;
    margin-bottom: var(--space-s);
}

.empty-history p {
    color: var(--text-secondary);
}

.empty-history .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Notification fix to ensure it doesn't affect layout */
.notification {
    position: fixed !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    top: 20px !important;
    right: 20px !important;
}

.text-position-controls {
    display: flex;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
}

.text-position-controls button {
    flex: 1;
    font-size: 13px;
}

/* Add quick position grid styles */
/* Quick position grid styles moved to app.html embedded styles */

/* Existing styles for shadow options */
.shadow-options,
.background-options {
    padding: var(--space-s);
    margin-bottom: var(--space-m);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    max-width: 100%;
    overflow: hidden;
}

.template-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
}

.template-item.selected {
    border-color: var(--accent-color);
    border-width: 2px;
}

.template-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-item-name {
    opacity: 1;
}

/* Help Modal Improvements */
.help-modal-content {
    max-width: 680px;
    width: 90vw;
    max-height: 85vh;
}

.help-modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-l) var(--space-xl);
    border-bottom: 1px solid #333;
}

.help-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.help-modal-body {
    padding: var(--space-xl);
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-l);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--space-m);
}

.help-section h4 i {
    color: var(--accent-color);
    font-size: 18px;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-m);
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section ul {
    margin: var(--space-m) 0;
    padding-left: var(--space-xl);
}

.help-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-s);
}

.help-section li strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Help modal scrollbar */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.help-section button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-section button:hover {
    background-color: var(--btn-hover);
}

/* Responsive Adjustments */
@media (max-width: 1280px) {
    .main-content {
        padding: var(--space-s);
        gap: var(--space-s);
    }

    .left-column {
        max-width: calc(100% - 620px);
    }

    .gallery-bar {
        width: 240px;
    }

    .control-panels {
        width: 360px;
        max-height: calc(100vh - 70px);
        /* Adjusted for smaller screens */
    }

    .background-content {
        max-height: 350px;
    }

    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 52px);
        overflow-y: auto;
        /* Make the main content scrollable on mobile */
    }

    .left-column {
        max-width: 100%;
        margin-bottom: var(--space-m);
    }

    .gallery-bar {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: var(--space-m);
    }

    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .control-panels {
        width: 100%;
        height: auto;
        max-height: 60vh;
        /* Increased for better mobile view */
    }

    .background-content {
        max-height: 300px;
    }

    .background-categories {
        max-height: none;
    }

    /* Fix for mobile safari bottom bar issues */
    .panel-content {
        padding-bottom: 80px;
    }
}

/* Background Options */
.subsection-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: var(--space-m) 0 var(--space-s) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subsection-title:first-child {
    margin-top: 0;
}

.subsection-title .btn {
    font-size: 11px;
    padding: 4px 8px;
    margin: 0;
}

.color-grid,
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    /* Contain hover effects */
}

.color-swatch,
.gradient-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch:hover,
.gradient-swatch:hover {
    transform: scale(1.05);
    z-index: 1;
    /* Add z-index to keep it above neighboring swatches */
    position: relative;
    /* Ensure z-index works */
}

.color-swatch.selected,
.gradient-swatch.selected {
    border-color: white;
    border-width: 2px;
}

/* Gradient Grid */
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Remove old gradient category styles - now using gradient-grid */
.gradient-section-header {
    margin-top: var(--space-m);
    margin-bottom: var(--space-s);
    padding: 0 var(--space-m);
}

.gradient-section-header:first-child {
    margin-top: 0;
}

.gradient-section-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.gradient-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: var(--space-m);
    max-width: 100%;
    overflow: hidden;
}

/* Background categories */
.background-categories {
    max-height: none;
    overflow-y: visible;
    scrollbar-width: none;
    padding-right: 0;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.bg-category {
    margin-bottom: var(--space-l);
    padding-bottom: 5px;
}

.bg-category h6 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 var(--space-l);
    margin-bottom: var(--space-s);
}

.bg-image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: 15px;
}

.bg-image-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.bg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add a light background when the image is loading */
.bg-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.bg-image-item.selected {
    border-color: white;
    border-width: 2px;
}

/* Text Layer Styling */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease, border-color 0.2s ease;
    z-index: 10;
}

.text-element.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.text-element-controls {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.text-element:hover .text-element-controls,
.text-element.selected .text-element-controls {
    opacity: 1;
    transform: translateY(0);
}

.text-element-controls button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.text-element-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-element-controls .delete-text-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

.text-element-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border: 1px solid white;
    border-radius: 50%;
    cursor: nw-resize;
}

.text-element-handle.top-left {
    top: -4px;
    left: -4px;
}

.text-element-handle.top-right {
    top: -4px;
    right: -4px;
}

.text-element-handle.bottom-left {
    bottom: -4px;
    left: -4px;
}

.text-element-handle.bottom-right {
    bottom: -4px;
    right: -4px;
}

/* Text Layer List */
.text-layer-item {
    display: flex;
    align-items: center;
    padding: var(--space-s) var(--space-m);
    background-color: var(--panel-bg);
    border-radius: 4px;
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-layer-item.selected {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
}

.text-layer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.text-layer-preview {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-layer-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.text-layer-item:hover .text-layer-actions {
    opacity: 1;
}

.text-layer-actions button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.text-layer-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-layer-actions .delete-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

/* Text Editor Panel */
.text-editor {
    padding: var(--space-m);
    border-top: 1px solid var(--border-color);
    background-color: var(--panel-bg);
}

.text-editor .form-group {
    margin-bottom: var(--space-m);
}

.text-editor label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.text-editor input[type="text"],
.text-editor textarea {
    width: 100%;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.text-style-buttons,
.text-align-buttons {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-s);
}

.text-style-buttons button,
.text-align-buttons button {
    flex: 1;
    background-color: var(--btn-bg);
    border: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-style-buttons button:hover,
.text-align-buttons button:hover {
    background-color: var(--btn-hover);
}

.text-style-buttons button.active,
.text-align-buttons button.active {
    background-color: var(--accent-color);
    color: white;
}

/* Scrollbar styling */
.panel-content::-webkit-scrollbar,
.background-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.background-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.background-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.background-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add a background to the scrollable content */
.background-content {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px 5px;
}

/* Improve scrolling performance */
.panel-content,
.background-content {
    scroll-behavior: smooth;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
    will-change: scroll-position;
    /* Optimize scrolling */
}

/* Fixing the backgrounds section */
.settings-section[data-section="background"] .section-content,
.settings-section:nth-child(4) .section-content {
    padding-bottom: 0;
    /* Remove extra padding since we have the scrollable container */
}

/* Last settings section needs more padding */
.settings-section:last-child {
    margin-bottom: 20px;
}

/* Create a scrollable container for all background content */
.background-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar */
    scrollbar-width: thin;
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Make sure subsection titles are well spaced in the background content */
.background-content .subsection-title {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* Responsive adjustments for the background content */
@media (max-width: 1280px) {
    .background-content {
        max-height: 350px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .background-content {
        max-height: 300px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

/* Make scrollbar always visible in background content for better UX */
.background-content::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.bg-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Gallery specific panel-title button styling */
.gallery-bar .panel-title {
    padding: var(--space-m) var(--space-l);
    font-size: 14px;
    font-weight: 600;
    background-color: #1a1a1a;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

/* Button styling for panel headers */
.panel-title button {
    font-size: 12px;
    padding: 5px 10px;
    margin-left: auto;
    background-color: #3a3a3a;
}

.panel-title button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

/* Empty Gallery State */
.empty-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    height: 100%;
    min-height: 250px;
    grid-column: 1 / -1;
    /* Span all columns in grid */
    width: 100%;
}

.empty-gallery .empty-gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    /* Center in available space */
}

.empty-gallery i {
    font-size: 36px;
    color: #555;
    margin-bottom: var(--space-m);
}

.empty-gallery p {
    color: var(--text-secondary);
    margin: 4px 0;
}

.empty-gallery .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Notification fix to ensure it doesn't affect layout */
.notification {
    position: fixed !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    top: 20px !important;
    right: 20px !important;
}

.text-position-controls {
    display: flex;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
}

.text-position-controls button {
    flex: 1;
    font-size: 13px;
}

/* Add quick position grid styles */
/* Quick position grid styles moved to app.html embedded styles */

/* Existing styles for shadow options */
.shadow-options,
.background-options {
    padding: var(--space-s);
    margin-bottom: var(--space-m);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    max-width: 100%;
    overflow: hidden;
}

.template-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
}

.template-item.selected {
    border-color: var(--accent-color);
    border-width: 2px;
}

.template-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-item-name {
    opacity: 1;
}

/* Help Modal Improvements */
.help-modal-content {
    max-width: 680px;
    width: 90vw;
    max-height: 85vh;
}

.help-modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-l) var(--space-xl);
    border-bottom: 1px solid #333;
}

.help-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.help-modal-body {
    padding: var(--space-xl);
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-l);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--space-m);
}

.help-section h4 i {
    color: var(--accent-color);
    font-size: 18px;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-m);
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section ul {
    margin: var(--space-m) 0;
    padding-left: var(--space-xl);
}

.help-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-s);
}

.help-section li strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Help modal scrollbar */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.help-section button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-section button:hover {
    background-color: var(--btn-hover);
}

/* Responsive Adjustments */
@media (max-width: 1280px) {
    .main-content {
        padding: var(--space-s);
        gap: var(--space-s);
    }

    .left-column {
        max-width: calc(100% - 620px);
    }

    .gallery-bar {
        width: 240px;
    }

    .control-panels {
        width: 360px;
        max-height: calc(100vh - 70px);
        /* Adjusted for smaller screens */
    }

    .background-content {
        max-height: 350px;
    }

    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 52px);
        overflow-y: auto;
        /* Make the main content scrollable on mobile */
    }

    .left-column {
        max-width: 100%;
        margin-bottom: var(--space-m);
    }

    .gallery-bar {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: var(--space-m);
    }

    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .control-panels {
        width: 100%;
        height: auto;
        max-height: 60vh;
        /* Increased for better mobile view */
    }

    .background-content {
        max-height: 300px;
    }

    .background-categories {
        max-height: none;
    }

    /* Fix for mobile safari bottom bar issues */
    .panel-content {
        padding-bottom: 80px;
    }
}

/* Background Options */
.subsection-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: var(--space-m) 0 var(--space-s) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subsection-title:first-child {
    margin-top: 0;
}

.subsection-title .btn {
    font-size: 11px;
    padding: 4px 8px;
    margin: 0;
}

.color-grid,
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    /* Contain hover effects */
}

.color-swatch,
.gradient-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch:hover,
.gradient-swatch:hover {
    transform: scale(1.05);
    z-index: 1;
    /* Add z-index to keep it above neighboring swatches */
    position: relative;
    /* Ensure z-index works */
}

.color-swatch.selected,
.gradient-swatch.selected {
    border-color: white;
    border-width: 2px;
}

/* Gradient Grid */
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Remove old gradient category styles - now using gradient-grid */
.gradient-section-header {
    margin-top: var(--space-m);
    margin-bottom: var(--space-s);
    padding: 0 var(--space-m);
}

.gradient-section-header:first-child {
    margin-top: 0;
}

.gradient-section-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.gradient-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: var(--space-m);
    max-width: 100%;
    overflow: hidden;
}

/* Background categories */
.background-categories {
    max-height: none;
    overflow-y: visible;
    scrollbar-width: none;
    padding-right: 0;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.bg-category {
    margin-bottom: var(--space-l);
    padding-bottom: 5px;
}

.bg-category h6 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 var(--space-l);
    margin-bottom: var(--space-s);
}

.bg-image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: 15px;
}

.bg-image-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.bg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add a light background when the image is loading */
.bg-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.bg-image-item.selected {
    border-color: white;
    border-width: 2px;
}

/* Text Layer Styling */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease, border-color 0.2s ease;
    z-index: 10;
}

.text-element.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.text-element-controls {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.text-element:hover .text-element-controls,
.text-element.selected .text-element-controls {
    opacity: 1;
    transform: translateY(0);
}

.text-element-controls button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.text-element-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-element-controls .delete-text-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

.text-element-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border: 1px solid white;
    border-radius: 50%;
    cursor: nw-resize;
}

.text-element-handle.top-left {
    top: -4px;
    left: -4px;
}

.text-element-handle.top-right {
    top: -4px;
    right: -4px;
}

.text-element-handle.bottom-left {
    bottom: -4px;
    left: -4px;
}

.text-element-handle.bottom-right {
    bottom: -4px;
    right: -4px;
}

/* Text Layer List */
.text-layer-item {
    display: flex;
    align-items: center;
    padding: var(--space-s) var(--space-m);
    background-color: var(--panel-bg);
    border-radius: 4px;
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-layer-item.selected {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
}

.text-layer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.text-layer-preview {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-layer-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.text-layer-item:hover .text-layer-actions {
    opacity: 1;
}

.text-layer-actions button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.text-layer-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-layer-actions .delete-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

/* Text Editor Panel */
.text-editor {
    padding: var(--space-m);
    border-top: 1px solid var(--border-color);
    background-color: var(--panel-bg);
}

.text-editor .form-group {
    margin-bottom: var(--space-m);
}

.text-editor label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.text-editor input[type="text"],
.text-editor textarea {
    width: 100%;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.text-style-buttons,
.text-align-buttons {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-s);
}

.text-style-buttons button,
.text-align-buttons button {
    flex: 1;
    background-color: var(--btn-bg);
    border: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-style-buttons button:hover,
.text-align-buttons button:hover {
    background-color: var(--btn-hover);
}

.text-style-buttons button.active,
.text-align-buttons button.active {
    background-color: var(--accent-color);
    color: white;
}

/* Scrollbar styling */
.panel-content::-webkit-scrollbar,
.background-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.background-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.background-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.background-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add a background to the scrollable content */
.background-content {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px 5px;
}

/* Improve scrolling performance */
.panel-content,
.background-content {
    scroll-behavior: smooth;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
    will-change: scroll-position;
    /* Optimize scrolling */
}

/* Fixing the backgrounds section */
.settings-section[data-section="background"] .section-content,
.settings-section:nth-child(4) .section-content {
    padding-bottom: 0;
    /* Remove extra padding since we have the scrollable container */
}

/* Last settings section needs more padding */
.settings-section:last-child {
    margin-bottom: 20px;
}

/* Create a scrollable container for all background content */
.background-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar */
    scrollbar-width: thin;
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Make sure subsection titles are well spaced in the background content */
.background-content .subsection-title {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* Responsive adjustments for the background content */
@media (max-width: 1280px) {
    .background-content {
        max-height: 350px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .background-content {
        max-height: 300px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

/* Make scrollbar always visible in background content for better UX */
.background-content::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.bg-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Gallery specific panel-title button styling */
.gallery-bar .panel-title {
    padding: var(--space-m) var(--space-l);
    font-size: 14px;
    font-weight: 600;
    background-color: #1a1a1a;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

/* Button styling for panel headers */
.panel-title button {
    font-size: 12px;
    padding: 5px 10px;
    margin-left: auto;
    background-color: #3a3a3a;
}

.panel-title button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

/* Empty Gallery State */
.empty-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    height: 100%;
    min-height: 250px;
    grid-column: 1 / -1;
    /* Span all columns in grid */
    width: 100%;
}

.empty-gallery .empty-gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    /* Center in available space */
}

.empty-gallery i {
    font-size: 36px;
    color: #555;
    margin-bottom: var(--space-m);
}

.empty-gallery p {
    color: var(--text-secondary);
    margin: 4px 0;
}

.empty-gallery .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Notification fix to ensure it doesn't affect layout */
.notification {
    position: fixed !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    top: 20px !important;
    right: 20px !important;
}

.text-position-controls {
    display: flex;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
}

.text-position-controls button {
    flex: 1;
    font-size: 13px;
}

/* Quick position grid styles moved to app.html embedded styles */

/* Existing styles for shadow options */
.shadow-options,
.background-options {
    padding: var(--space-s);
    margin-bottom: var(--space-m);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    max-width: 100%;
    overflow: hidden;
}

.template-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
}

.template-item.selected {
    border-color: var(--accent-color);
    border-width: 2px;
}

.template-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-item-name {
    opacity: 1;
}

/* Help Modal Improvements */
.help-modal-content {
    max-width: 680px;
    width: 90vw;
    max-height: 85vh;
}

.help-modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-l) var(--space-xl);
    border-bottom: 1px solid #333;
}

.help-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.help-modal-body {
    padding: var(--space-xl);
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-l);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--space-m);
}

.help-section h4 i {
    color: var(--accent-color);
    font-size: 18px;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-m);
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section ul {
    margin: var(--space-m) 0;
    padding-left: var(--space-xl);
}

.help-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-s);
}

.help-section li strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Help modal scrollbar */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.help-section button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-section button:hover {
    background-color: var(--btn-hover);
}

/* Responsive Adjustments */
@media (max-width: 1280px) {
    .main-content {
        padding: var(--space-s);
        gap: var(--space-s);
    }

    .left-column {
        max-width: calc(100% - 620px);
    }

    .gallery-bar {
        width: 240px;
    }

    .control-panels {
        width: 360px;
        max-height: calc(100vh - 70px);
        /* Adjusted for smaller screens */
    }

    .background-content {
        max-height: 350px;
    }

    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 52px);
        overflow-y: auto;
        /* Make the main content scrollable on mobile */
    }

    .left-column {
        max-width: 100%;
        margin-bottom: var(--space-m);
    }

    .gallery-bar {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: var(--space-m);
    }

    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .control-panels {
        width: 100%;
        height: auto;
        max-height: 60vh;
        /* Increased for better mobile view */
    }

    .background-content {
        max-height: 300px;
    }

    .background-categories {
        max-height: none;
    }

    /* Fix for mobile safari bottom bar issues */
    .panel-content {
        padding-bottom: 80px;
    }
}

/* Background Options */
.subsection-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: var(--space-m) 0 var(--space-s) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subsection-title:first-child {
    margin-top: 0;
}

.subsection-title .btn {
    font-size: 11px;
    padding: 4px 8px;
    margin: 0;
}

.color-grid,
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    /* Contain hover effects */
}

.color-swatch,
.gradient-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch:hover,
.gradient-swatch:hover {
    transform: scale(1.05);
    z-index: 1;
    /* Add z-index to keep it above neighboring swatches */
    position: relative;
    /* Ensure z-index works */
}

.color-swatch.selected,
.gradient-swatch.selected {
    border-color: white;
    border-width: 2px;
}

/* Gradient Grid */
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Remove old gradient category styles - now using gradient-grid */
.gradient-section-header {
    margin-top: var(--space-m);
    margin-bottom: var(--space-s);
    padding: 0 var(--space-m);
}

.gradient-section-header:first-child {
    margin-top: 0;
}

.gradient-section-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.gradient-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: var(--space-m);
    max-width: 100%;
    overflow: hidden;
}

/* Background categories */
.background-categories {
    max-height: none;
    overflow-y: visible;
    scrollbar-width: none;
    padding-right: 0;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.bg-category {
    margin-bottom: var(--space-l);
    padding-bottom: 5px;
}

.bg-category h6 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 var(--space-l);
    margin-bottom: var(--space-s);
}

.bg-image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: 15px;
}

.bg-image-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.bg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add a light background when the image is loading */
.bg-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.bg-image-item.selected {
    border-color: white;
    border-width: 2px;
}

/* Text Layer Styling */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease, border-color 0.2s ease;
    z-index: 10;
}

.text-element.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.text-element-controls {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.text-element:hover .text-element-controls,
.text-element.selected .text-element-controls {
    opacity: 1;
    transform: translateY(0);
}

.text-element-controls button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.text-element-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-element-controls .delete-text-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

.text-element-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border: 1px solid white;
    border-radius: 50%;
    cursor: nw-resize;
}

.text-element-handle.top-left {
    top: -4px;
    left: -4px;
}

.text-element-handle.top-right {
    top: -4px;
    right: -4px;
}

.text-element-handle.bottom-left {
    bottom: -4px;
    left: -4px;
}

.text-element-handle.bottom-right {
    bottom: -4px;
    right: -4px;
}

/* Text Layer List */
.text-layer-item {
    display: flex;
    align-items: center;
    padding: var(--space-s) var(--space-m);
    background-color: var(--panel-bg);
    border-radius: 4px;
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-layer-item.selected {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
}

.text-layer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.text-layer-preview {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-layer-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.text-layer-item:hover .text-layer-actions {
    opacity: 1;
}

.text-layer-actions button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.text-layer-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-layer-actions .delete-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

/* Text Editor Panel */
.text-editor {
    padding: var(--space-m);
    border-top: 1px solid var(--border-color);
    background-color: var(--panel-bg);
}

.text-editor .form-group {
    margin-bottom: var(--space-m);
}

.text-editor label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.text-editor input[type="text"],
.text-editor textarea {
    width: 100%;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.text-style-buttons,
.text-align-buttons {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-s);
}

.text-style-buttons button,
.text-align-buttons button {
    flex: 1;
    background-color: var(--btn-bg);
    border: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-style-buttons button:hover,
.text-align-buttons button:hover {
    background-color: var(--btn-hover);
}

.text-style-buttons button.active,
.text-align-buttons button.active {
    background-color: var(--accent-color);
    color: white;
}

/* Scrollbar styling */
.panel-content::-webkit-scrollbar,
.background-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.background-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.background-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.background-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add a background to the scrollable content */
.background-content {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px 5px;
}

/* Improve scrolling performance */
.panel-content,
.background-content {
    scroll-behavior: smooth;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
    will-change: scroll-position;
    /* Optimize scrolling */
}

/* Fixing the backgrounds section */
.settings-section[data-section="background"] .section-content,
.settings-section:nth-child(4) .section-content {
    padding-bottom: 0;
    /* Remove extra padding since we have the scrollable container */
}

/* Last settings section needs more padding */
.settings-section:last-child {
    margin-bottom: 20px;
}

/* Create a scrollable container for all background content */
.background-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar */
    scrollbar-width: thin;
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Make sure subsection titles are well spaced in the background content */
.background-content .subsection-title {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* Responsive adjustments for the background content */
@media (max-width: 1280px) {
    .background-content {
        max-height: 350px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .background-content {
        max-height: 300px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

/* Make scrollbar always visible in background content for better UX */
.background-content::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.bg-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Gallery specific panel-title button styling */
.gallery-bar .panel-title {
    padding: var(--space-m) var(--space-l);
    font-size: 14px;
    font-weight: 600;
    background-color: #1a1a1a;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

/* Button styling for panel headers */
.panel-title button {
    font-size: 12px;
    padding: 5px 10px;
    margin-left: auto;
    background-color: #3a3a3a;
}

.panel-title button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

/* Empty Gallery State */
.empty-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    height: 100%;
    min-height: 250px;
    grid-column: 1 / -1;
    /* Span all columns in grid */
    width: 100%;
}

.empty-gallery .empty-gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    /* Center in available space */
}

.empty-gallery i {
    font-size: 36px;
    color: #555;
    margin-bottom: var(--space-m);
}

.empty-gallery p {
    color: var(--text-secondary);
    margin: 4px 0;
}

.empty-gallery .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Notification fix to ensure it doesn't affect layout */
.notification {
    position: fixed !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    top: 20px !important;
    right: 20px !important;
}

.text-position-controls {
    display: flex;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
}

.text-position-controls button {
    flex: 1;
    font-size: 13px;
}

/* Add quick position grid styles */
/* Quick position grid styles moved to app.html embedded styles */

/* Existing styles for shadow options */
.shadow-options,
.background-options {
    padding: var(--space-s);
    margin-bottom: var(--space-m);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    max-width: 100%;
    overflow: hidden;
}

.template-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
}

.template-item.selected {
    border-color: var(--accent-color);
    border-width: 2px;
}

.template-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-item-name {
    opacity: 1;
}

/* Help Modal Improvements */
.help-modal-content {
    max-width: 680px;
    width: 90vw;
    max-height: 85vh;
}

.help-modal-header {
    padding: var(--space-xl) var(--space-xl) var(--space-l) var(--space-xl);
    border-bottom: 1px solid #333;
}

.help-modal-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.help-modal-body {
    padding: var(--space-xl);
    max-height: calc(85vh - 100px);
    overflow-y: auto;
}

.help-section {
    margin-bottom: var(--space-xl);
    padding: var(--space-l);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.help-section:last-child {
    margin-bottom: 0;
}

.help-section h4 {
    display: flex;
    align-items: center;
    gap: var(--space-m);
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: var(--space-m);
}

.help-section h4 i {
    color: var(--accent-color);
    font-size: 18px;
}

.help-section p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-m);
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section ul {
    margin: var(--space-m) 0;
    padding-left: var(--space-xl);
}

.help-section li {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-s);
}

.help-section li strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Help modal scrollbar */
.help-modal-body::-webkit-scrollbar {
    width: 6px;
}

.help-modal-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 3px;
}

.help-modal-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Buttons */
.help-section button {
    background-color: var(--accent-color);
    border: none;
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.help-section button:hover {
    background-color: var(--btn-hover);
}

/* Responsive Adjustments */
@media (max-width: 1280px) {
    .main-content {
        padding: var(--space-s);
        gap: var(--space-s);
    }

    .left-column {
        max-width: calc(100% - 620px);
    }

    .gallery-bar {
        width: 240px;
    }

    .control-panels {
        width: 360px;
        max-height: calc(100vh - 70px);
        /* Adjusted for smaller screens */
    }

    .background-content {
        max-height: 350px;
    }

    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .main-content {
        flex-direction: column;
        height: auto;
        max-height: calc(100vh - 52px);
        overflow-y: auto;
        /* Make the main content scrollable on mobile */
    }

    .left-column {
        max-width: 100%;
        margin-bottom: var(--space-m);
    }

    .gallery-bar {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: var(--space-m);
    }

    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    .control-panels {
        width: 100%;
        height: auto;
        max-height: 60vh;
        /* Increased for better mobile view */
    }

    .background-content {
        max-height: 300px;
    }

    .background-categories {
        max-height: none;
    }

    /* Fix for mobile safari bottom bar issues */
    .panel-content {
        padding-bottom: 80px;
    }
}

/* Background Options */
.subsection-title {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin: var(--space-m) 0 var(--space-s) 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.subsection-title:first-child {
    margin-top: 0;
}

.subsection-title .btn {
    font-size: 11px;
    padding: 4px 8px;
    margin: 0;
}

.color-grid,
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
    /* Contain hover effects */
}

.color-swatch,
.gradient-swatch {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.color-swatch:hover,
.gradient-swatch:hover {
    transform: scale(1.05);
    z-index: 1;
    /* Add z-index to keep it above neighboring swatches */
    position: relative;
    /* Ensure z-index works */
}

.color-swatch.selected,
.gradient-swatch.selected {
    border-color: white;
    border-width: 2px;
}

/* Gradient Grid */
.gradient-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

/* Remove old gradient category styles - now using gradient-grid */
.gradient-section-header {
    margin-top: var(--space-m);
    margin-bottom: var(--space-s);
    padding: 0 var(--space-m);
}

.gradient-section-header:first-child {
    margin-top: 0;
}

.gradient-section-header h4 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin: 0;
}

.gradient-category {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: var(--space-m);
    max-width: 100%;
    overflow: hidden;
}

/* Background categories */
.background-categories {
    max-height: none;
    overflow-y: visible;
    scrollbar-width: none;
    padding-right: 0;
    padding-bottom: 5px;
    margin-bottom: 0;
}

.bg-category {
    margin-bottom: var(--space-l);
    padding-bottom: 5px;
}

.bg-category h6 {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    padding: 0 var(--space-l);
    margin-bottom: var(--space-s);
}

.bg-image-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-s);
    padding: 0 var(--space-m);
    margin-bottom: 15px;
}

.bg-image-item {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
}

.bg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add a light background when the image is loading */
.bg-image-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    z-index: 0;
}

.bg-image-item.selected {
    border-color: white;
    border-width: 2px;
}

/* Text Layer Styling */
.text-element {
    position: absolute;
    cursor: move;
    user-select: none;
    padding: 8px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease, border-color 0.2s ease;
    z-index: 10;
}

.text-element.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

.text-element-controls {
    position: absolute;
    top: -40px;
    right: 0;
    display: flex;
    gap: 8px;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 6px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.text-element:hover .text-element-controls,
.text-element.selected .text-element-controls {
    opacity: 1;
    transform: translateY(0);
}

.text-element-controls button {
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    width: 28px;
    height: 28px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.text-element-controls button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-element-controls .delete-text-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

.text-element-handle {
    position: absolute;
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border: 1px solid white;
    border-radius: 50%;
    cursor: nw-resize;
}

.text-element-handle.top-left {
    top: -4px;
    left: -4px;
}

.text-element-handle.top-right {
    top: -4px;
    right: -4px;
}

.text-element-handle.bottom-left {
    bottom: -4px;
    left: -4px;
}

.text-element-handle.bottom-right {
    bottom: -4px;
    right: -4px;
}

/* Text Layer List */
.text-layer-item {
    display: flex;
    align-items: center;
    padding: var(--space-s) var(--space-m);
    background-color: var(--panel-bg);
    border-radius: 4px;
    margin-bottom: var(--space-xs);
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-layer-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.text-layer-item.selected {
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid var(--accent-color);
}

.text-layer-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.text-layer-preview {
    font-size: 13px;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.text-layer-actions {
    display: flex;
    gap: var(--space-xs);
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.text-layer-item:hover .text-layer-actions {
    opacity: 1;
}

.text-layer-actions button {
    background: transparent;
    border: none;
    color: var(--text-color);
    padding: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.text-layer-actions button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.text-layer-actions .delete-btn:hover {
    background-color: rgba(229, 57, 53, 0.2);
    color: #ff6b6b;
}

/* Text Editor Panel */
.text-editor {
    padding: var(--space-m);
    border-top: 1px solid var(--border-color);
    background-color: var(--panel-bg);
}

.text-editor .form-group {
    margin-bottom: var(--space-m);
}

.text-editor label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: var(--space-xs);
}

.text-editor input[type="text"],
.text-editor textarea {
    width: 100%;
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

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

.text-style-buttons,
.text-align-buttons {
    display: flex;
    gap: var(--space-xs);
    margin-bottom: var(--space-s);
}

.text-style-buttons button,
.text-align-buttons button {
    flex: 1;
    background-color: var(--btn-bg);
    border: none;
    color: var(--text-color);
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.text-style-buttons button:hover,
.text-align-buttons button:hover {
    background-color: var(--btn-hover);
}

.text-style-buttons button.active,
.text-align-buttons button.active {
    background-color: var(--accent-color);
    color: white;
}

/* Scrollbar styling */
.panel-content::-webkit-scrollbar,
.background-content::-webkit-scrollbar {
    width: 8px;
}

.panel-content::-webkit-scrollbar-track,
.background-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb,
.background-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.panel-content::-webkit-scrollbar-thumb:hover,
.background-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Add a background to the scrollable content */
.background-content {
    background: rgba(0, 0, 0, 0.1);
    padding: 10px 5px;
}

/* Improve scrolling performance */
.panel-content,
.background-content {
    scroll-behavior: smooth;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(0, 0, 0, 0.1);
    will-change: scroll-position;
    /* Optimize scrolling */
}

/* Fixing the backgrounds section */
.settings-section[data-section="background"] .section-content,
.settings-section:nth-child(4) .section-content {
    padding-bottom: 0;
    /* Remove extra padding since we have the scrollable container */
}

/* Last settings section needs more padding */
.settings-section:last-child {
    margin-bottom: 20px;
}

/* Create a scrollable container for all background content */
.background-content {
    max-height: 400px;
    overflow-y: auto;
    overflow-x: hidden;
    /* Prevent horizontal scrollbar */
    scrollbar-width: thin;
    padding-right: 8px;
    padding-left: 8px;
    padding-bottom: 20px;
    margin-bottom: 10px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Make sure subsection titles are well spaced in the background content */
.background-content .subsection-title {
    margin-top: 15px;
    margin-bottom: 10px;
    padding-left: 5px;
}

/* Responsive adjustments for the background content */
@media (max-width: 1280px) {
    .background-content {
        max-height: 350px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

@media (max-width: 992px) {
    .background-content {
        max-height: 300px;
    }

    /* Remove background categories max-height since it's no longer scrollable independently */
    .background-categories {
        max-height: none;
    }
}

/* Make scrollbar always visible in background content for better UX */
.background-content::-webkit-scrollbar {
    width: 8px;
    background: rgba(0, 0, 0, 0.2);
}

.bg-image-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
}

/* Gallery specific panel-title button styling */
.gallery-bar .panel-title {
    padding: var(--space-m) var(--space-l);
    font-size: 14px;
    font-weight: 600;
    background-color: #1a1a1a;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2a2a2a;
    flex-shrink: 0;
}

/* Button styling for panel headers */
.panel-title button {
    font-size: 12px;
    padding: 5px 10px;
    margin-left: auto;
    background-color: #3a3a3a;
}

.panel-title button:hover:not(:disabled) {
    background-color: #4a4a4a;
}

/* Empty Gallery State */
.empty-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 20px;
    text-align: center;
    height: 100%;
    min-height: 250px;
    grid-column: 1 / -1;
    /* Span all columns in grid */
    width: 100%;
}

.empty-gallery .empty-gallery-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: auto;
    /* Center in available space */
}

.empty-gallery i {
    font-size: 36px;
    color: #555;
    margin-bottom: var(--space-m);
}

.empty-gallery p {
    color: var(--text-secondary);
    margin: 4px 0;
}

.empty-gallery .hint {
    font-size: 12px;
    opacity: 0.7;
}

/* Notification fix to ensure it doesn't affect layout */
.notification {
    position: fixed !important;
    z-index: 10000 !important;
    box-sizing: border-box !important;
    top: 20px !important;
    right: 20px !important;
}

.text-position-controls {
    display: flex;
    justify-content: space-between;
    gap: var(--space-s);
    margin-bottom: var(--space-s);
}

.text-position-controls button {
    flex: 1;
    font-size: 13px;
}

/* Add quick position grid styles */
/* Quick position grid styles moved to app.html embedded styles */

/* Existing styles for shadow options */
.shadow-options,
.background-options {
    padding: var(--space-s);
    margin-bottom: var(--space-m);
    border-radius: 6px;
    background-color: rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.templates-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-s);
    padding: 0;
    margin-bottom: 15px;
    max-width: 100%;
    overflow: hidden;
}

.template-item {
    aspect-ratio: 1;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
    position: relative;
    background-color: rgba(255, 255, 255, 0.05);
}

.template-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.template-item:hover {
    transform: scale(1.05);
    border-color: rgba(255, 255, 255, 0.3);
    z-index: 1;
    position: relative;
}

.template-item.selected {
    border-color: var(--accent-color);
    border-width: 2px;
}

.template-item-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: 8px 6px 4px;
    font-size: 10px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.template-item:hover .template-item-name {
    opacity: 1;
}

/* Authentication Styles */
.auth-section {
    display: flex;
    align-items: center;
    gap: var(--space-m);
}

.auth-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

/* User Menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
}

.user-info {
    display: flex;
    align-items: center;
    gap: var(--space-s);
}

.user-email {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    min-width: 150px;
    overflow: hidden;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--space-s);
    width: 100%;
    padding: var(--space-m);
    background: transparent;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Authentication Gate - Split Screen Landing Page */
.auth-gate {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    display: flex;
    align-items: stretch;
    justify-content: center;
    z-index: 10000;
    overflow: hidden;
}

.landing-container {
    display: flex;
    width: 100%;
    height: 100vh;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
}

/* Remove the background extensions */

/* Left Side - Product Information */
.landing-left {
    flex: 1;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.landing-left::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" patternUnits="userSpaceOnUse" width="100" height="100"><circle cx="20" cy="20" r="1" fill="%23ffffff" opacity="0.03"/><circle cx="80" cy="40" r="0.8" fill="%23ffffff" opacity="0.02"/><circle cx="40" cy="70" r="1.2" fill="%23ffffff" opacity="0.04"/><circle cx="90" cy="90" r="0.6" fill="%23ffffff" opacity="0.02"/><circle cx="10" cy="60" r="0.9" fill="%23ffffff" opacity="0.03"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    z-index: 1;
}

/* Right Side - Authentication */
.landing-right {
    flex: 0 0 480px;
    background: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    position: relative;
    min-height: 100vh;
}

.landing-content {
    position: relative;
    z-index: 2;
    max-width: 500px;
    animation: fadeInLeft 0.8s ease-out;
}

.landing-logo {
    margin-bottom: 40px;
}

.landing-logo .logo-text {
    font-size: 36px;
    font-weight: 700;
    background: linear-gradient(135deg, #2b7de9, #66c3ff, #a8e6ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
}

.landing-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 24px;
    line-height: 1.2;
    letter-spacing: -1px;
}

.landing-subtitle {
    font-size: 20px;
    color: var(--text-secondary);
    margin-bottom: 50px;
    line-height: 1.5;
    font-weight: 400;
}

.landing-features {
    margin-bottom: 50px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    margin-bottom: 32px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(43, 125, 233, 0.3);
    transform: translateX(8px);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    flex-shrink: 0;
}

.feature-icon i {
    font-size: 20px;
    color: white;
}

.feature-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}

.feature-content p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.landing-testimonial {
    background: rgba(43, 125, 233, 0.1);
    border: 1px solid rgba(43, 125, 233, 0.2);
    border-radius: 16px;
    padding: 30px;
    position: relative;
}

.testimonial-content p {
    font-size: 16px;
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 16px;
    font-style: italic;
}

.testimonial-author {
    color: var(--accent-color);
    font-size: 14px;
}

.auth-container {
    width: 100%;
    max-width: 360px;
    animation: fadeInRight 0.8s ease-out;
}

.landing-auth-form {
    display: none;
}

.landing-auth-form.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.landing-auth-form h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    text-align: center;
}

.form-subtitle {
    font-size: 16px;
    color: #666;
    text-align: center;
    margin-bottom: 40px;
    line-height: 1.5;
}

.landing-auth-form .form-group {
    margin-bottom: 24px;
}

.landing-auth-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 8px;
}

.landing-auth-form input {
    width: 100%;
    padding: 16px;
    background-color: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    color: #1a1a1a;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.landing-auth-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(43, 125, 233, 0.1);
}

.landing-auth-form input::placeholder {
    color: #adb5bd;
}

.auth-btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    margin-bottom: 24px;
    min-height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-btn.primary {
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
    color: white;
}

.auth-btn.primary:hover {
    background: linear-gradient(135deg, #1e6bcc, #2b7de9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 125, 233, 0.3);
}

.auth-btn.loading {
    pointer-events: none;
}

.auth-btn .btn-spinner {
    position: absolute;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.auth-btn.loading .btn-text {
    opacity: 0;
}

.auth-btn.loading .btn-spinner {
    opacity: 1;
}

.auth-forgot {
    text-align: center;
    margin-bottom: 24px;
}

.forgot-link {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.forgot-link:hover {
    color: #1e6bcc;
}

.auth-switch {
    text-align: center;
    margin-bottom: 32px;
}

.auth-switch p {
    color: #666;
    font-size: 14px;
    margin: 0;
}

.switch-link {
    background: transparent;
    border: none;
    color: var(--accent-color);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.switch-link:hover {
    color: #1e6bcc;
}

.auth-features {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid #e9ecef;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #666;
    font-size: 14px;
}

.auth-feature i {
    color: #28a745;
    font-size: 16px;
}

/* Error and Success Messages for Landing Page */
.landing-auth-form .auth-error,
.landing-auth-form .auth-success {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    text-align: center;
}

.landing-auth-form .auth-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.landing-auth-form .auth-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

/* Animations */
@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .landing-container {
        flex-direction: column;
    }

    .landing-left {
        flex: 0 0 50%;
        padding: 40px;
    }

    .landing-right {
        flex: 0 0 50%;
        padding: 40px;
    }

    .landing-title {
        font-size: 36px;
    }

    .landing-subtitle {
        font-size: 18px;
    }

    .feature-item {
        padding: 16px;
        margin-bottom: 24px;
    }
}

@media (max-width: 768px) {
    .landing-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }

    .landing-left {
        flex: none;
        padding: 40px 20px;
    }

    .landing-right {
        flex: none;
        padding: 40px 20px;
    }

    .landing-title {
        font-size: 32px;
    }

    .landing-subtitle {
        font-size: 16px;
        margin-bottom: 40px;
    }

    .landing-features {
        margin-bottom: 40px;
    }

    .feature-item {
        padding: 16px;
        margin-bottom: 20px;
    }

    .feature-item:hover {
        transform: none;
    }

    .landing-testimonial {
        padding: 24px;
    }

    .auth-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {

    .landing-left,
    .landing-right {
        padding: 20px;
    }

    .landing-title {
        font-size: 28px;
    }

    .landing-logo .logo-text {
        font-size: 28px;
    }

    .feature-item {
        flex-direction: column;
        text-align: center;
    }

    .feature-icon {
        margin-right: 0;
        margin-bottom: 16px;
    }
}

/* Pricing Modal Styles */
.pricing-content {
    max-width: 900px;
    width: 95vw;
}

.pricing-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--space-xl);
    padding: var(--space-xl);
}

.pricing-card {
    background: var(--panel-bg);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: var(--space-xl);
    text-align: center;
    position: relative;
    transition: all 0.3s ease;
}

.pricing-card:hover {
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(43, 125, 233, 0.15);
}

.pricing-card.featured {
    border-color: var(--accent-color);
    background: linear-gradient(135deg, rgba(43, 125, 233, 0.05), rgba(59, 146, 255, 0.05));
}

.popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
    color: white;
    padding: 6px 20px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pricing-card h4 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: var(--space-m);
}

.price {
    font-size: 48px;
    font-weight: 700;
    color: var(--accent-color);
    margin-bottom: var(--space-l);
    line-height: 1;
}

.price span {
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 400;
}

.price-annual {
    font-size: 16px;
    font-weight: 600;
    color: #43A047;
    margin-bottom: 8px;
}

.price-annual span {
    color: #666;
    font-size: 12px;
    font-weight: 400;
}

.subscription-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-options .btn {
    font-size: 13px;
    padding: 8px 16px;
}

.pricing-card .features {
    list-style: none;
    padding: 0;
    margin: 0 0 var(--space-xl) 0;
    text-align: left;
}

.pricing-card .features li {
    display: flex;
    align-items: center;
    padding: var(--space-s) 0;
    color: var(--text-color);
    font-size: 14px;
}

.pricing-card .features li::before {
    content: '✓';
    color: #28a745;
    font-weight: bold;
    margin-right: var(--space-m);
    font-size: 16px;
}

.pricing-card .btn {
    width: 100%;
    padding: var(--space-m) var(--space-l);
    font-size: 16px;
    font-weight: 600;
    margin-top: auto;
}

.current-plan {
    background-color: var(--text-secondary) !important;
    color: var(--primary-bg) !important;
    cursor: not-allowed !important;
}

/* Usage Meter */
.usage-meter {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: var(--space-m);
    margin-bottom: var(--space-m);
}

.usage-meter h4 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: var(--space-s);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.usage-progress {
    background: var(--secondary-bg);
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
    margin-bottom: var(--space-s);
}

.usage-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #ffc107, #dc3545);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.usage-text {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
}

/* Upgrade Prompt */
.upgrade-prompt {
    background: linear-gradient(135deg, rgba(43, 125, 233, 0.1), rgba(59, 146, 255, 0.05));
    border: 1px solid rgba(43, 125, 233, 0.3);
    border-radius: 8px;
    padding: var(--space-l);
    margin: var(--space-m) 0;
    text-align: center;
}

.upgrade-prompt h4 {
    color: var(--accent-color);
    margin-bottom: var(--space-s);
    font-size: 16px;
}

.upgrade-prompt p {
    color: var(--text-secondary);
    margin-bottom: var(--space-m);
    font-size: 14px;
}

.upgrade-prompt .btn {
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
    border: none;
    color: white;
    padding: var(--space-s) var(--space-l);
    font-weight: 600;
}

.upgrade-prompt .btn:hover {
    background: linear-gradient(135deg, #1e6bcc, #2b7de9);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(43, 125, 233, 0.3);
}

/* Plan Badge */
.plan-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.free {
    background: var(--text-secondary);
}

.plan-badge.pro {
    background: linear-gradient(135deg, var(--accent-color), #3b92ff);
}

.plan-badge.team {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
}

/* Billing Section in User Settings */
.billing-section {
    border-top: 1px solid var(--border-color);
    padding-top: var(--space-l);
    margin-top: var(--space-l);
}

.billing-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-m);
}

.billing-details {
    flex: 1;
}

.billing-details h4 {
    color: var(--text-color);
    margin-bottom: var(--space-xs);
}

.billing-details p {
    color: var(--text-secondary);
    font-size: 14px;
}

.billing-actions {
    display: flex;
    gap: var(--space-s);
}

/* Subscription Status */
.subscription-status {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.subscription-status.active {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.subscription-status.canceled {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.subscription-status.past_due {
    background: rgba(255, 193, 7, 0.1);
    color: #ffc107;
}

/* Feature Lock Overlay */
.feature-lock {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.feature-lock::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    z-index: 1;
}

.feature-lock-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    z-index: 2;
    white-space: nowrap;
}

/* Premium Template Indicators */
.template-item.premium {
    position: relative;
}

.template-item.premium::before {
    content: '👑';
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    z-index: 2;
}

/* Export Resolution Lock */
.resolution-lock {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--text-secondary);
    font-size: 12px;
}

.resolution-lock i {
    color: #ffd700;
}

/* Responsive Pricing */
@media (max-width: 768px) {
    .pricing-plans {
        grid-template-columns: 1fr;
        gap: var(--space-l);
        padding: var(--space-l);
    }

    .pricing-card {
        padding: var(--space-l);
    }

    .price {
        font-size: 36px;
    }

    .pricing-content {
        width: 95vw;
        max-width: none;
    }
}

/* Loading States for Payment */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    color: white;
}

/* User Settings Modal Specific Styles */
.user-settings-content {
    max-width: 720px;
    width: 90vw;
    min-height: 600px;
    background: #1a1a1a;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.user-settings-content .modal-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 24px 32px;
    position: relative;
}

.user-settings-content .modal-header h3 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-settings-content .modal-header h3 i {
    color: #3b82f6;
    font-size: 24px;
    background: #1e3a8a;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid #1d4ed8;
}

.user-settings-content .modal-body {
    padding: 0;
    background: #0f0f0f;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 20px;
}

.user-settings-section {
    margin: 0;
    background: #1a1a1a;
    padding: 32px;
    border-bottom: 1px solid #2a2a2a;
    position: relative;
}

.user-settings-section:last-child {
    border-bottom: none;
    overflow: visible;
    padding-bottom: 40px;
}

.user-settings-section h4 {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: none;
}

.user-settings-section h4 i {
    color: #3b82f6;
    font-size: 18px;
    background: #1e3a8a;
    padding: 8px;
    border-radius: 8px;
    border: 1px solid #1d4ed8;
}

.user-settings-section p.section-description {
    color: #a1a1aa;
    font-size: 14px;
    margin-bottom: 24px;
    line-height: 1.5;
}

/* Account Information Display */
.user-info-display {
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
    transition: all 0.2s ease;
    background: #1a1a1a;
}

.info-item:hover {
    background: #262626;
}

.info-item:last-child {
    border-bottom: none;
}

.info-item label {
    font-size: 14px;
    font-weight: 500;
    color: #a1a1aa;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item label i {
    color: #71717a;
    font-size: 14px;
    width: 16px;
    text-align: center;
}

.info-item span {
    font-size: 13px;
    color: #ffffff;
    font-weight: 500;
    background: transparent;
    border: none;
}

/* Email Verification Status */
.verification-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.verification-status.verified {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.verification-status.unverified {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

/* Form Styling in User Settings */
.user-settings-section .form-group {
    margin-bottom: 24px;
}

.user-settings-section .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 8px;
}

.user-settings-section input {
    width: 100%;
    background: #0f0f0f;
    border: 1.5px solid #2a2a2a;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    font-family: inherit;
}

.user-settings-section input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #0f0f0f;
}

.user-settings-section input::placeholder {
    color: #52525b;
}

/* Buttons in User Settings */
.user-settings-section .btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1.5px solid;
    position: relative;
    overflow: hidden;
}

.user-settings-section .primary-btn {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #ffffff;
}

.user-settings-section .primary-btn:hover:not(:disabled) {
    background: #2563eb;
    border-color: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Danger Zone Styling */
.danger-section {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 32px;
    margin: 0;
    margin-top: 24px;
    position: relative;
    box-shadow: none;
    overflow: visible;
}

.danger-section h4 {
    color: #dc2626;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.danger-section h4 i {
    background: #7f1d1d;
    color: #dc2626;
    border-color: #dc2626;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.danger-section p.section-description {
    color: #fca5a5;
    font-size: 16px;
    margin-bottom: 24px;
    line-height: 1.6;
}

.danger-warning {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    font-size: 14px;
    color: #fef2f2;
    margin: 0 0 24px 0;
    padding: 20px;
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-radius: 12px;
    border: 1px solid #fca5a5;
    line-height: 1.6;
    box-shadow: 0 4px 12px rgba(254, 202, 202, 0.2);
}

.danger-warning i {
    color: #dc2626;
    font-size: 18px;
    flex-shrink: 0;
    margin-top: 2px;
    background: #ffffff;
    padding: 8px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.2);
}

.danger-warning span {
    color: #7f1d1d;
    font-weight: 500;
}

.danger-actions {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.danger-btn {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    border: 2px solid #dc2626;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    align-self: flex-start;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    box-shadow: 0 4px 16px rgba(220, 38, 38, 0.3);
    transition: all 0.3s ease;
    margin: 0;
}

.danger-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #b91c1c, #991b1b);
    border-color: #b91c1c;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(220, 38, 38, 0.4);
}

/* Fix container overflow for danger zone */
.user-settings-section:last-child {
    border-bottom: none;
    overflow: visible;
    padding-bottom: 40px;
}

.user-settings-content .modal-body {
    padding: 0;
    background: #0f0f0f;
    max-height: 70vh;
    overflow-y: auto;
    overflow-x: visible;
    padding-bottom: 20px;
}

/* User Settings Actions */
.user-settings-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    background: #0f0f0f;
    border-top: 1px solid #2a2a2a;
    gap: 16px;
}

.user-settings-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #1a1a1a;
    border: 1.5px solid #2a2a2a;
    color: #e4e4e7;
}

.user-settings-actions .btn:hover:not(:disabled) {
    background: #262626;
    border-color: #3f3f46;
    transform: translateY(-1px);
}

/* Delete Account Modal Improvements */
.delete-account-content {
    max-width: 480px;
    background: #1a1a1a;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.delete-account-content .modal-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 24px 32px;
}

.delete-account-content .modal-header h3 {
    color: #dc2626;
    font-size: 20px;
    font-weight: 700;
}

.delete-account-content .modal-body {
    background: #1a1a1a;
    padding: 32px;
}

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

.warning-icon {
    background: #fee2e2;
    border: 2px solid #fecaca;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

.warning-icon i {
    font-size: 32px;
    color: #dc2626;
}

.delete-confirmation h4 {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 12px;
}

.delete-confirmation p {
    font-size: 14px;
    color: #a1a1aa;
    margin-bottom: 24px;
    line-height: 1.6;
}

.delete-confirmation .form-group {
    text-align: left;
    margin-bottom: 24px;
}

.delete-confirmation .form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #e4e4e7;
    margin-bottom: 8px;
}

.delete-confirmation input {
    width: 100%;
    background: #0f0f0f;
    border: 1.5px solid #2a2a2a;
    color: #ffffff;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.delete-confirmation input:focus {
    outline: none;
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.warning-icon {
    background: #7f1d1d;
    border: 2px solid #dc2626;
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px auto;
}

.warning-icon i {
    font-size: 32px;
    color: #dc2626;
}

.delete-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 24px;
}

.delete-actions .btn {
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    border: 1.5px solid;
}

.delete-actions .btn:first-child {
    background: #ffffff;
    border-color: #d1d5db;
    color: #374151;
}

.delete-actions .btn:first-child:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

/* Error and Success Messages */
.auth-error,
.auth-success {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid;
    font-weight: 500;
}

.auth-error {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.auth-success {
    background: #f0f9ff;
    border-color: #bae6fd;
    color: #0369a1;
}

.auth-error.hidden,
.auth-success.hidden {
    display: none;
}

/* Loading States */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.btn-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Modal Close Button */
.user-settings-content .modal-close-btn,
.delete-account-content .modal-close-btn,
.help-modal-content .modal-close-btn {
    background: #262626;
    border: 1px solid #3f3f46;
    color: #a1a1aa;
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.user-settings-content .modal-close-btn:hover,
.delete-account-content .modal-close-btn:hover,
.help-modal-content .modal-close-btn:hover {
    background: #3f3f46;
    border-color: #52525b;
    color: #ffffff;
}

/* Responsive adjustments for user settings */
@media (max-width: 768px) {
    .user-settings-content {
        width: 95vw;
        max-width: none;
        margin: 10px;
        min-height: auto;
        max-height: 90vh;
    }

    .user-settings-content .modal-header,
    .user-settings-content .modal-body {
        padding: 20px;
    }

    .user-settings-section {
        padding: 24px 20px;
    }

    .user-settings-actions {
        padding: 20px;
        flex-direction: column;
        gap: 12px;
    }

    .user-settings-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .delete-actions {
        flex-direction: column;
    }

    .delete-actions .btn {
        width: 100%;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px 20px;
    }

    .info-item span {
        width: 100%;
        text-align: left;
    }
}

/* Dividers - Remove custom styling */
.divider {
    display: none;
}

/* Custom scrollbar for User Settings Modal */
.user-settings-content .modal-body::-webkit-scrollbar {
    width: 8px;
}

.user-settings-content .modal-body::-webkit-scrollbar-track {
    background: #0f0f0f;
    border-radius: 4px;
}

.user-settings-content .modal-body::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
    transition: background-color 0.2s ease;
}

.user-settings-content .modal-body::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

.user-settings-content .modal-body::-webkit-scrollbar-thumb:active {
    background: #5a5a5a;
}

/* Firefox scrollbar */
.user-settings-content .modal-body {
    scrollbar-width: thin;
    scrollbar-color: #3a3a3a #0f0f0f;
}

/* Analytics Dashboard Styles */
.analytics-dashboard-content {
    max-width: 1200px;
    width: 95vw;
    min-height: 800px;
    background: #1a1a1a;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.05);
    overflow: hidden;
}

.analytics-dashboard-content .modal-header {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
    padding: 24px 32px;
    position: relative;
}

.analytics-dashboard-content .modal-header h3 {
    color: #ffffff;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-dashboard-content .modal-header h3 i {
    color: #3b82f6;
    font-size: 24px;
}

.analytics-dashboard-content .modal-body {
    padding: 32px;
    background: #0f0f0f;
    max-height: 70vh;
    overflow-y: auto;
}

.analytics-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #888;
}

.analytics-loading i {
    font-size: 48px;
    margin-bottom: 20px;
    color: #3b82f6;
}

.analytics-loading p {
    font-size: 18px;
    margin: 0;
}

.analytics-content {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.analytics-section {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-section h4 {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.analytics-section h4 i {
    color: #3b82f6;
    font-size: 16px;
}

/* Analytics Grid */
.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.analytics-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.analytics-card:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.analytics-card-icon {
    margin-bottom: 12px;
}

.analytics-card-icon i {
    font-size: 24px;
    color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
    padding: 12px;
    border-radius: 8px;
}

.analytics-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.analytics-card-label {
    font-size: 14px;
    color: #a1a1aa;
    margin-bottom: 4px;
}

.analytics-card-updated {
    font-size: 12px;
    color: #71717a;
}

/* Analytics Table */
.analytics-table {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.analytics-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.02);
}

.analytics-table th {
    background: rgba(255, 255, 255, 0.05);
    color: #e4e4e7;
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 14px;
}

.analytics-table td {
    padding: 12px 16px;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 14px;
}

.analytics-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* User Level Badges */
.user-level-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pill badge base styles */
.pill-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.3px;
    border: 1px solid transparent;
}

/* User level badge colors */
.user-level-badge.standard,
.pill-badge.standard {
    background-color: #2563eb;
    color: #ffffff;
    border-color: #1d4ed8;
}

.user-level-badge.beta,
.pill-badge.beta {
    background-color: #7c3aed;
    color: #ffffff;
    border-color: #6d28d9;
}

.user-level-badge.dev,
.pill-badge.dev {
    background-color: #059669;
    color: #ffffff;
    border-color: #047857;
}

/* Verification status badge colors */
.verification-status.pill-badge.verified {
    background-color: #10b981;
    color: #ffffff;
    border-color: #059669;
}

.verification-status.pill-badge.unverified {
    background-color: #f59e0b;
    color: #ffffff;
    border-color: #d97706;
}

/* Icon spacing in badges */
.pill-badge i {
    font-size: 10px;
    margin-right: 2px;
}

/* Analytics Events List */
.analytics-events-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.analytics-event {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all 0.2s ease;
}

.analytics-event:hover {
    background: rgba(255, 255, 255, 0.06);
}

.event-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 8px;
}

.event-icon i {
    color: #3b82f6;
    font-size: 16px;
}

.event-content {
    flex: 1;
    min-width: 0;
}

.event-title {
    color: #ffffff;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 14px;
}

.event-details {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.event-user {
    color: #a1a1aa;
    font-size: 13px;
}

.event-time {
    color: #71717a;
    font-size: 12px;
}

/* Custom scrollbar for analytics events */
.analytics-events-list::-webkit-scrollbar {
    width: 6px;
}

.analytics-events-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.analytics-events-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.analytics-events-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive design for analytics dashboard */
@media (max-width: 768px) {
    .analytics-dashboard-content {
        width: 95vw;
        min-height: 90vh;
    }

    .analytics-dashboard-content .modal-body {
        padding: 20px;
        max-height: 80vh;
    }

    .analytics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-table {
        font-size: 12px;
    }

    .analytics-table th,
    .analytics-table td {
        padding: 8px 12px;
    }
}

/* Dev Feature Indicator */
.dev-feature-indicator {
    display: inline-block;
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-left: 8px;
    border: 1px solid #22c55e;
}

/* User Statistics Section */
.user-stats-section {
    margin-bottom: 32px;
}

.user-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.stat-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.stat-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 14px;
    color: #a1a1aa;
    font-weight: 500;
}

/* User Level Display */
.user-level-item .user-level-badge {
    font-size: 13px;
    padding: 6px 12px;
}

/* Responsive design for user stats */
@media (max-width: 768px) {
    .user-stats-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .stat-item {
        padding: 16px;
    }

    .stat-value {
        font-size: 24px;
    }
}

/* Global Statistics Section within User Settings */
.global-stats-section {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.global-stats-section h5 {
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-stats-section h5 i {
    color: #3b82f6;
    font-size: 16px;
}

.global-stats-section .section-description {
    color: #a1a1aa;
    font-size: 14px;
    margin: 0 0 16px 0;
    line-height: 1.4;
}

.global-stats-section .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.global-stats-section .btn:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.global-stats-section .dev-feature-indicator {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
    border: 1px solid #fbbf24;
}

@media (max-width: 768px) {
    .global-stats-section {
        margin-top: 20px;
        padding-top: 20px;
    }

    .global-stats-section .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* Analytics Dashboard Styles */
.analytics-modal .modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.analytics-dashboard-content .modal-header {
    background: linear-gradient(135deg, #3b82f6, #1e40af);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: between;
    align-items: center;
}

.analytics-dashboard-content .modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.analytics-dashboard-content .modal-header .modal-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s;
}

.analytics-dashboard-content .modal-header .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.analytics-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.analytics-loading i {
    font-size: 32px;
    margin-bottom: 16px;
    color: #3b82f6;
}

.analytics-loading p {
    font-size: 18px;
    margin: 0;
}

.analytics-section {
    margin-bottom: 32px;
}

.analytics-section h4 {
    color: #1f2937;
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.analytics-section h4 i {
    color: #3b82f6;
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.analytics-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.analytics-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.analytics-card-icon {
    font-size: 24px;
    color: #3b82f6;
    margin-bottom: 8px;
}

.analytics-card-value {
    font-size: 32px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 4px;
}

.analytics-card-label {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.analytics-events-list {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    max-height: 400px;
    overflow-y: auto;
}

.analytics-event {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.analytics-event:last-child {
    border-bottom: none;
}

.analytics-event .event-icon {
    color: #10b981;
    font-size: 8px;
}

.analytics-event .event-content {
    flex: 1;
}

.analytics-event .event-title {
    font-weight: 500;
    color: #1f2937;
    font-size: 14px;
}

.analytics-event .event-time {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.analytics-card-updated {
    text-align: center;
    font-size: 12px;
    color: #6b7280;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.analytics-error {
    text-align: center;
    padding: 40px 20px;
    color: #dc2626;
}

.analytics-error i {
    font-size: 48px;
    margin-bottom: 16px;
}

.analytics-error h4 {
    color: #dc2626;
    margin: 0 0 8px 0;
}

.analytics-error p {
    color: #6b7280;
    margin: 0 0 20px 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .analytics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }

    .analytics-card {
        padding: 16px;
    }

    .analytics-card-value {
        font-size: 24px;
    }

    .analytics-dashboard-content .modal-header {
        padding: 16px;
    }

    .analytics-dashboard-content .modal-header h3 {
        font-size: 20px;
    }
}

/* Header buttons styling - ensure consistent appearance */
.header-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #3a3a3a;
    border: 1px solid #444;
    color: #fff;
    box-shadow: none;
    transform: none;
}

.header-buttons .btn:hover:not(:disabled) {
    background: #4a4a4a;
    border-color: #555;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

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

.header-buttons .btn.primary-btn:hover:not(:disabled) {
    background: #3b92ff;
    border-color: #3b92ff;
}

.header-buttons .btn.danger-btn {
    background: var(--danger-color);
    border-color: var(--danger-color);
}

.header-buttons .btn.danger-btn:hover:not(:disabled) {
    background: #c62828;
    border-color: #c62828;
}

/* Donation Modal Styles */
.donation-modal-content {
    max-width: 600px;
    background: #1a1a1a;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.donation-modal-header {
    background: linear-gradient(135deg, #e91e63, #f06292);
    color: white;
    padding: 24px 32px;
    border-bottom: none;
}

.donation-modal-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.donation-modal-body {
    padding: 32px;
    background: #1a1a1a;
}

.donation-section {
    text-align: center;
    margin-bottom: 32px;
}

.donation-icon {
    background: linear-gradient(135deg, #e91e63, #f06292);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
}

.donation-icon i {
    font-size: 32px;
    color: white;
}

.donation-section h4 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.donation-section p {
    color: #a8a8a8;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 24px;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 24px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.cost-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cost-item i {
    color: #e91e63;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.cost-item span {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.support-benefits {
    list-style: none;
    padding: 0;
    margin: 24px 0;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.support-benefits li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.support-benefits li::before {
    content: '✓';
    color: #4caf50;
    font-weight: bold;
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.donation-note {
    font-style: italic;
    color: #888 !important;
    font-size: 14px !important;
    margin-top: 24px !important;
}

.donation-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
}

.donation-decline-btn {
    background: #2a2a2a;
    border: 1px solid #444;
    color: #888;
    padding: 12px 24px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.donation-decline-btn:hover {
    background: #333;
    border-color: #555;
    color: #fff;
}

.donation-support-btn {
    background: linear-gradient(135deg, #e91e63, #f06292);
    border: none;
    color: white;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.donation-support-btn:hover {
    background: linear-gradient(135deg, #c2185b, #e91e63);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

/* What's New Modal Styles */
.whats-new-modal-content {
    max-width: 800px;
    background: #1a1a1a;
    border: none;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    overflow: hidden;
}

.whats-new-modal-header {
    background: linear-gradient(135deg, #2b7de9, #66c3ff);
    color: white;
    padding: 24px 32px;
    border-bottom: none;
}

.whats-new-modal-header h3 {
    color: white;
    font-size: 24px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whats-new-modal-body {
    padding: 32px;
    background: #1a1a1a;
    max-height: 70vh;
    overflow-y: auto;
}

.notice-section {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 32px;
    text-align: center;
}

.notice-icon {
    background: rgba(255, 193, 7, 0.2);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.notice-icon i {
    font-size: 24px;
    color: #ffc107;
}

.notice-section h4 {
    color: #ffc107;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
}

.notice-section p {
    color: #fff;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.notice-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
    text-align: left;
    display: inline-block;
}

.notice-list li {
    color: #fff;
    font-size: 14px;
    padding: 4px 0;
    position: relative;
    padding-left: 20px;
}

.notice-list li::before {
    content: '•';
    color: #ffc107;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.notice-tip {
    background: rgba(67, 160, 71, 0.1);
    border: 1px solid rgba(67, 160, 71, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-top: 16px;
    color: #a8e6cf !important;
    font-size: 13px !important;
}

.whats-new-section {
    margin-bottom: 32px;
}

.whats-new-section h4 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.whats-new-section h4 i {
    color: #2b7de9;
}

.feature-update {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.update-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    align-self: flex-start;
    display: inline-block;
    width: fit-content;
    margin-bottom: 8px;
}

.update-badge.new {
    background: linear-gradient(135deg, #4caf50, #8bc34a);
    color: white;
}

.update-badge.improved {
    background: linear-gradient(135deg, #2196f3, #64b5f6);
    color: white;
}

.update-content h5 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.update-content p {
    color: #a8a8a8;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
}

.quick-start-section h4 {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.quick-start-section h4 i {
    color: #ff9800;
}

.quick-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.quick-step {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.step-content h6 {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
}

.step-content p {
    color: #a8a8a8;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Modal close button styling for new modals */
.donation-modal-content .modal-close-btn,
.whats-new-modal-content .modal-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.donation-modal-content .modal-close-btn:hover,
.whats-new-modal-content .modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    color: white;
}

/* Responsive design for new modals */
@media (max-width: 768px) {

    .donation-modal-content,
    .whats-new-modal-content {
        width: 95vw;
        max-width: none;
        margin: 10px;
    }

    .donation-modal-header,
    .whats-new-modal-header,
    .donation-modal-body,
    .whats-new-modal-body {
        padding: 20px;
    }

    .donation-actions {
        flex-direction: column;
        gap: 12px;
    }

    .donation-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .cost-breakdown,
    .support-benefits {
        max-width: none;
    }

    .feature-update {
        flex-direction: column;
        gap: 12px;
    }

    .update-badge {
        align-self: flex-start;
    }
}

/* Animated Mockup Styles */
@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(var(--float-y, -15px)) rotate(var(--float-rotation, 1deg));
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(var(--pulse-scale, 1.05));
    }
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes sway {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(var(--sway-rotation, 2deg));
    }

    75% {
        transform: rotate(calc(-1 * var(--sway-rotation, 2deg)));
    }
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0px) scale(1);
    }

    50% {
        transform: translateY(var(--bounce-y, -10px)) scale(var(--bounce-scale, 1.02));
    }
}

@keyframes fade {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: var(--fade-opacity, 0.7);
    }
}

/* Animation Classes with Intensity Support */
.canvas-animated.float {
    animation: float var(--animation-duration, 3s) var(--animation-easing, ease-in-out) infinite;
    --float-y: calc(-15px * var(--animation-intensity, 1));
    --float-rotation: calc(1deg * var(--animation-intensity, 1));
}

.canvas-animated.pulse {
    animation: pulse var(--animation-duration, 2s) var(--animation-easing, ease-in-out) infinite;
    --pulse-scale: calc(1 + (0.05 * var(--animation-intensity, 1)));
}

.canvas-animated.rotate {
    animation: rotate var(--animation-duration, 4s) var(--animation-easing, linear) infinite;
}

.canvas-animated.sway {
    animation: sway var(--animation-duration, 2.5s) var(--animation-easing, ease-in-out) infinite;
    --sway-rotation: calc(2deg * var(--animation-intensity, 1));
}

.canvas-animated.bounce {
    animation: bounce var(--animation-duration, 1.5s) var(--animation-easing, ease-in-out) infinite;
    --bounce-y: calc(-10px * var(--animation-intensity, 1));
    --bounce-scale: calc(1 + (0.02 * var(--animation-intensity, 1)));
}

.canvas-animated.fade {
    animation: fade var(--animation-duration, 2s) var(--animation-easing, ease-in-out) infinite;
    --fade-opacity: calc(0.7 + (0.3 * (1 - var(--animation-intensity, 1))));
}



/* Remove export progress styles */
.animation-export-progress,
.animation-export-progress.visible,
.progress-spinner,
.progress-text,
.progress-subtext,
.modal-overlay,
.export-progress-content,
.export-progress-content h3,
.progress-container,
.progress-bar,
.progress-fill,
.progress-text,
.progress-percentage,
.recording-progress,
.recording-status {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* Production Animation System Styles */

/* Export Progress Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

/* Remove export progress modal styles */
.export-progress-content,
.export-progress-content h3,
.progress-container,
.progress-bar,
.progress-fill,
.progress-text,
.progress-percentage {
    display: none;
}

/* Animation Quality Selector */
.control-group {
    margin-bottom: var(--space-m);
}

.control-group label {
    display: block;
    color: var(--text-color);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: var(--space-s);
}

/* Enhanced Animation Controls */
.animation-controls {
    display: none;
    margin-top: var(--space-m);
    padding: var(--space-m);
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.animation-controls.visible {
    display: block;
}

.animation-value-display {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 13px;
}

/* Animation Type Selector Enhancement */
#animation-type-select option[value="zoom"] {
    background: var(--panel-bg);
    color: var(--text-color);
}





/* Quality selector removed - animations now always export at high quality (15Mbps) */

/* Background Image Categories */
.image-category {
    margin: var(--space-m) 0;
}

.category-header h7 {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 var(--space-s) 0;
    display: block;
}

.category-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-s);
}

.background-image-item {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    background: var(--panel-bg);
    border: 2px solid transparent;
    transition: all 0.2s ease;
    aspect-ratio: 4/3;
}

.background-image-item:hover {
    border-color: var(--accent-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 146, 255, 0.15);
}

.background-image-item.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 1px var(--accent-color);
}

.background-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.background-image-item .image-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: white;
    padding: var(--space-s);
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.background-image-item:hover .image-name {
    opacity: 1;
}

/* Enhanced Color Swatches - Match gradient dimensions */
.color-swatch {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.color-swatch:hover {
    transform: translateY(-1px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(59, 146, 255, 0.2);
}

.color-swatch.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Gradient Swatches Enhancement */
.gradient-swatch {
    width: 48px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    transition: all 0.2s ease;
    position: relative;
}

.gradient-swatch:hover {
    transform: translateY(-1px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(59, 146, 255, 0.2);
}

.gradient-swatch.selected {
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px var(--accent-color);
}

/* Font Family Select - Show each option in its respective font */
#font-family-select option[value*="Arial"] {
    font-family: Arial, sans-serif;
}

#font-family-select option[value*="Helvetica"] {
    font-family: 'Helvetica Neue', Helvetica, sans-serif;
}

#font-family-select option[value*="Times New Roman"] {
    font-family: 'Times New Roman', serif;
}

#font-family-select option[value*="Georgia"] {
    font-family: Georgia, serif;
}

#font-family-select option[value*="Verdana"] {
    font-family: Verdana, sans-serif;
}

#font-family-select option[value*="Roboto"] {
    font-family: 'Roboto', sans-serif;
}

#font-family-select option[value*="Open Sans"] {
    font-family: 'Open Sans', sans-serif;
}

#font-family-select option[value*="Montserrat"] {
    font-family: 'Montserrat', sans-serif;
}

#font-family-select option[value*="Playfair Display"] {
    font-family: 'Playfair Display', serif;
}

#font-family-select option[value*="Lato"] {
    font-family: 'Lato', sans-serif;
}

#font-family-select option[value*="Source Sans Pro"] {
    font-family: 'Source Sans Pro', sans-serif;
}

#font-family-select option[value*="Nunito"] {
    font-family: 'Nunito', sans-serif;
}

#font-family-select option[value*="Poppins"] {
    font-family: 'Poppins', sans-serif;
}

#font-family-select option[value*="Inter"] {
    font-family: 'Inter', sans-serif;
}

#font-family-select option[value*="Raleway"] {
    font-family: 'Raleway', sans-serif;
}

#font-family-select option[value*="Oswald"] {
    font-family: 'Oswald', sans-serif;
}

#font-family-select option[value*="Merriweather"] {
    font-family: 'Merriweather', serif;
}

#font-family-select option[value*="Lora"] {
    font-family: 'Lora', serif;
}

#font-family-select option[value*="PT Serif"] {
    font-family: 'PT Serif', serif;
}

#font-family-select option[value*="Crimson Text"] {
    font-family: 'Crimson Text', serif;
}

#font-family-select option[value*="Fira Sans"] {
    font-family: 'Fira Sans', sans-serif;
}

#font-family-select option[value*="Ubuntu"] {
    font-family: 'Ubuntu', sans-serif;
}

#font-family-select option[value*="Work Sans"] {
    font-family: 'Work Sans', sans-serif;
}

#font-family-select option[value*="Quicksand"] {
    font-family: 'Quicksand', sans-serif;
}

#font-family-select option[value*="Barlow"] {
    font-family: 'Barlow', sans-serif;
}

#font-family-select option[value*="DM Sans"] {
    font-family: 'DM Sans', sans-serif;
}

#font-family-select option[value*="Space Grotesk"] {
    font-family: 'Space Grotesk', sans-serif;
}

#font-family-select option[value*="JetBrains Mono"] {
    font-family: 'JetBrains Mono', monospace;
}

#font-family-select option[value*="Fira Code"] {
    font-family: 'Fira Code', monospace;
}

#font-family-select option[value*="Source Code Pro"] {
    font-family: 'Source Code Pro', monospace;
}

#font-family-select option[value="monospace"] {
    font-family: monospace;
}

/* Make the dropdown text larger for better font preview */
#font-family-select {
    font-size: 14px;
}

#font-family-select option {
    font-size: 14px;
    padding: 8px;
}