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

body {
    font-family: Arial, sans-serif;
    background-color: #f5f5f5;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.generation-section {
    margin-bottom: 20px;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.input-group {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #0056b3;
}

.loading {
    margin-top: 10px;
    color: #666;
}

.editor-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.main-content {
    display: flex;
    gap: 1rem;
}

.canvas-container {
    flex: 1;
    min-height: 500px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: white;
}

.sidebar {
    width: 250px;
    background-color: #f8f9fa;
    border-radius: 5px;
    padding: 1rem;
}

.toolbar {
    width: 250px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 5px;
}

.tool-group {
    padding: 1rem;
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    margin-bottom: 1rem;
}

.tool-group h3 {
    margin-bottom: 0.75rem;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 600;
}

.tool-group .btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.slider-control {
    margin-bottom: 10px;
}

.slider-control label {
    display: block;
    margin-bottom: 5px;
    color: #666;
}

input[type="range"] {
    width: 100%;
}

select, input[type="color"] {
    width: 100%;
    margin-bottom: 10px;
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}

#canvas {
    width: 100%;
    height: 100%;
}

#layerList {
    max-height: 150px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 3px;
    margin-bottom: 10px;
}

.layer-item {
    padding: 8px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    background-color: white;
    transition: background-color 0.2s;
}

.layer-item:hover {
    background-color: #f0f0f0;
}

.layer-item:last-child {
    border-bottom: none;
}

.upload-control {
    margin-bottom: 10px;
}

.upload-control label.button {
    display: block;
    padding: 10px;
    background-color: #007bff;
    color: white;
    text-align: center;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-control label.button:hover {
    background-color: #0056b3;
}

#imageControls button {
    width: 100%;
    margin-bottom: 5px;
}

#imageControls .slider-control {
    margin: 10px 0;
}

#cropMode.active {
    background-color: #dc3545;
}

/* Text Controls */
.font-size-control {
    margin: 10px 0;
}

.size-inputs {
    display: flex;
    gap: 10px;
    align-items: center;
}

.size-inputs input[type="number"] {
    width: 60px;
}

.text-style-controls {
    display: flex;
    gap: 5px;
    margin: 10px 0;
}

.style-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    font-weight: bold;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
}

.style-btn.active {
    background-color: #007bff;
    color: white;
    border-color: #0056b3;
}

.color-control, .background-control {
    margin: 10px 0;
}

.background-options {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin: 5px 0;
}

.color-presets {
    display: flex;
    gap: 5px;
    margin: 5px 0;
}

.color-preset {
    width: 25px;
    height: 25px;
    border-radius: 50%;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: transform 0.2s;
}

.color-preset:hover {
    transform: scale(1.1);
}

.color-preset[data-color="#ffffff"] {
    border: 1px solid #ccc;
}

#backgroundStyle {
    margin-bottom: 5px;
}

/* Style the number input */
input[type="number"] {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 14px;
}

/* Hide number input arrows */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Shadcn Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid transparent;
}

.btn i {
    width: 1rem;
    height: 1rem;
}

.btn-primary {
    background-color: #0284c7;
    color: white;
}

.btn-primary:hover {
    background-color: #0369a1;
}

.btn-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.btn-secondary:hover {
    background-color: #d1d5db;
}

/* Icon Button Styles */
.btn-icon {
    padding: 0.5rem;
    border-radius: 0.375rem;
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon .material-icons {
    font-size: 1.25rem;
}

.btn-icon:hover {
    background-color: #e5e7eb;
    color: #1f2937;
    border-color: #d1d5db;
}

.btn-icon:active {
    background-color: #d1d5db;
}

/* Input Styles */
.input {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
}

.input:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

.input-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Select Styles */
.select {
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #d1d5db;
    background-color: white;
    color: #374151;
    cursor: pointer;
}

.select:focus {
    outline: none;
    border-color: #0284c7;
    box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.1);
}

/* Range Input Styles */
.range {
    -webkit-appearance: none;
    width: 100%;
    height: 0.25rem;
    border-radius: 0.125rem;
    background-color: #e5e7eb;
    cursor: pointer;
}

.range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #0284c7;
    cursor: pointer;
}

.range::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    background-color: #0284c7;
    cursor: pointer;
    border: none;
}

/* Button Groups */
.btn-group {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Color Input Styles */
.color-input {
    -webkit-appearance: none;
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
}

.color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input::-webkit-color-swatch {
    border: none;
    border-radius: 0.375rem;
}

/* Horizontal Toolbar */
.horizontal-toolbar {
    background-color: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.75rem;
    margin-bottom: 1rem;
}

.horizontal-toolbar .btn-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.horizontal-toolbar .divider {
    width: 1px;
    height: 2rem;
    background-color: #e5e7eb;
    margin: 0 0.5rem;
}

.horizontal-toolbar .select {
    min-width: 120px;
}

.horizontal-toolbar .size-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.horizontal-toolbar .input-sm {
    width: 4rem;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: 1rem;
}

.canvas-container {
    flex: 1;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 1rem;
    min-height: 400px;
}

.sidebar {
    width: 280px;
}

/* Update existing tool group styles */
.tool-group {
    background-color: white;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    padding: 1rem;
    margin-bottom: 1rem;
}

.tool-group h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.75rem;
}

/* Slider Controls */
.slider-control {
    margin-bottom: 1rem;
}

.slider-control label {
    display: block;
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.25rem;
}

.slider-control .range-input {
    width: 100%;
    height: 0.5rem;
    background-color: #e5e7eb;
    border-radius: 9999px;
    appearance: none;
    cursor: pointer;
}

.slider-control .range-input::-webkit-slider-thumb {
    appearance: none;
    width: 1rem;
    height: 1rem;
    background-color: #3b82f6;
    border-radius: 50%;
    cursor: pointer;
}

.slider-control .range-input::-moz-range-thumb {
    width: 1rem;
    height: 1rem;
    background-color: #3b82f6;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

/* Image Controls */
.tool-group .btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Select Styles */
.select {
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid #e5e7eb;
    background-color: white;
    color: #374151;
}

.select:focus {
    outline: none;
    border-color: #3b82f6;
    ring: 2px solid #93c5fd;
}

/* Navigation */
.top-nav {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.logo-wrapper {
    height: 40px;
    display: flex;
    align-items: center;
}

.nav-logo {
    height: 100%;
    width: auto;
    object-fit: contain;
}

.nav-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #333;
    margin: 0;
}

/* Footer */
.site-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    padding: 1.5rem 0;
    margin-top: 2rem;
    text-align: center;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.footer-link {
    color: #3b82f6;
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

/* Base styles */
:root {
    --container-padding: 1rem;
}

body {
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

/* Responsive layout */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .canvas-container {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .sidebar {
        width: 100%;
        max-width: none;
    }
}

@media (max-width: 768px) {
    :root {
        --container-padding: 0.5rem;
    }

    .horizontal-toolbar {
        overflow-x: auto;
        padding-bottom: 0.5rem;
    }

    .tool-group {
        flex-wrap: nowrap;
        min-width: max-content;
    }

    .btn-group {
        flex-wrap: nowrap;
    }

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

    .input-group .input {
        width: 100%;
    }

    .input-group .btn {
        width: 100%;
    }

    .size-inputs {
        flex-direction: column;
    }

    .slider-control {
        flex-direction: column;
        align-items: stretch;
    }

    .slider-control label {
        margin-bottom: 0.25rem;
    }
}

@media (max-width: 480px) {
    .nav-content {
        flex-direction: column;
        text-align: center;
        padding: 0.5rem;
    }

    .logo-wrapper {
        margin-bottom: 0.5rem;
    }

    .nav-title {
        font-size: 1.25rem;
    }

    .generation-section h2 {
        font-size: 1.5rem;
        text-align: center;
    }
}

/* Editor Toolbar */
.editor-toolbar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: #e9ecef;
    margin: 0 0.5rem;
}

.text-style-controls {
    display: flex;
    gap: 0.25rem;
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }

    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .toolbar-section {
        flex-direction: column;
        align-items: stretch;
    }

    .toolbar-group {
        justify-content: center;
    }

    .toolbar-divider {
        width: 100%;
        height: 1px;
        margin: 0.25rem 0;
    }

    .text-style-controls {
        justify-content: center;
    }

    .select,
    .input-sm {
        width: 100%;
    }
}

/* Editor Toolbar */
.editor-toolbar {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 0.5rem;
    padding: 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.toolbar-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toolbar-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.text-properties {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.toolbar-divider {
    width: 1px;
    height: 24px;
    background-color: #e9ecef;
    margin: 0 0.5rem;
}

.text-style-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Compact form controls */
.select-sm {
    padding: 0.25rem;
    font-size: 0.875rem;
    height: 2rem;
    width: 90px;
}

.btn-sm {
    padding: 0.25rem;
    width: 2rem;
    height: 2rem;
}

.btn-sm .material-icons {
    font-size: 1rem;
}

.color-input-sm {
    width: 2rem;
    height: 2rem;
    padding: 0.125rem;
}

/* Responsive toolbar */
@media (max-width: 768px) {
    .editor-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.5rem;
    }

    .toolbar-section {
        flex-direction: row;
        justify-content: center;
        flex-wrap: wrap;
    }

    .text-properties {
        flex-wrap: wrap;
        justify-content: center;
    }

    .toolbar-divider {
        width: 100%;
        height: 1px;
        margin: 0.25rem 0;
    }

    .text-style-controls {
        justify-content: center;
    }
}

.share-dropdown {
    position: relative;
    display: none;
}

@media (max-width: 768px) {
    .share-dropdown {
        display: inline-block;
    }
    
    .share-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}

.share-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0.5rem;
    z-index: 1000;
    min-width: 160px;
}

.share-dropdown:hover .share-menu {
    display: block;
}

.share-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    color: #374151;
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0.25rem;
    transition: background-color 0.2s;
    cursor: pointer;
}

.share-item:hover {
    background-color: #f3f4f6;
}

.share-item .material-icons {
    font-size: 1.25rem;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .share-menu {
        right: auto;
        left: 50%;
        transform: translateX(-50%);
    }
}