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

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    padding: 20px;
    background-color: #f0f0f0;
}

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

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.editor {
    display: flex;
    gap: 20px;
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    align-items: stretch;
}

.canvas-container {
    flex: 1;
    min-width: 0;
    width: 100%;
    background-color: #ddd;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    touch-action: none;
    align-self: center;
}

.make-zach-preview-section {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 420px;
    padding: 20px 0;
}

.make-zach-preview-section .container {
    width: 100%;
}

.make-zach-preview-section .editor {
    width: 100%;
    padding: 0;
    box-shadow: none;
    background: transparent;
}

.make-zach-preview-section .controls {
    display: none;
}

.controls {
    width: 300px;
    padding: 20px;
    background-color: #f8f8f8;
    border-radius: 4px;
}

.control-group {
    margin-bottom: 20px;
}

.control-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px 16px;
    align-items: end;
}

.control-item {
    min-width: 0;
}

.color-item {
    flex: 0 0 auto;
    width: 120px;
    min-width: 120px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #555;
}

input[type="text"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

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

input[type="color"] {
    width: 50px;
    height: 30px;
    padding: 0;
}

.zimage-carousel {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.zimage-carousel-track-wrapper {
    flex: 1;
    overflow: hidden;
    min-height: 220px;
}

.zimage-carousel-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 8px 0;
}

.zimage-carousel-track::-webkit-scrollbar {
    height: 10px;
}

.zimage-carousel-track::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 999px;
}

.zimage-card {
    cursor: pointer;
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 280px;
    overflow: hidden;
    border: 1px solid #ddd;
    border-radius: 12px;
    background: #fff;
    transition: border-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

.zimage-card:hover,
.zimage-card.selected {
    border-color: #007bff;
    transform: translateY(-2px);
}

.zimage-card img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    object-position: center;
}

.carousel-arrow {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(150, 150, 150, 0.7);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    color: #333;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s, transform 0.2s;
}

.carousel-arrow:hover {
    background-color: rgba(240, 240, 240, 0.95);
    border-color: rgba(120, 120, 120, 0.85);
    transform: scale(1.03);
}

button {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

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

/* File input styling */
.control-group input[type="file"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

.control-group small {
    display: block;
    margin-top: 6px;
    color: #666;
}

canvas {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    touch-action: none;
}

.quote-page-body {
    background: linear-gradient(180deg, #f6f6f6 0%, #ececec 100%);
}

.quote-page-container {
    max-width: 900px;
}

.quote-shell,
.quote-form-section {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.quote-form-section {
    margin-top: 20px;
}

.quote-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 20px;
}

.quote-card {
    position: relative;
    padding: 28px 24px 20px;
    border: 1px solid #e4e4e4;
    border-radius: 14px;
    background: #fafafa;
}

.quote-mark {
    position: absolute;
    top: 8px;
    left: 14px;
    font-size: 3rem;
    line-height: 1;
    color: #c7c7c7;
}

.quote-text {
    font-size: 1.5rem;
    line-height: 1.5;
    color: #222;
    margin-bottom: 14px;
    padding-left: 10px;
}

.quote-context {
    color: #555;
    margin-bottom: 10px;
}

.quote-meta,
.quote-status {
    color: #777;
    font-size: 0.95rem;
}

.quote-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin: 20px 0 14px;
}

.quote-actions button,
.quote-actions .secondary-action {
    width: auto;
    min-width: 180px;
}

.secondary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 4px;
    background: #e8e8e8;
    color: #222;
    text-decoration: none;
    transition: background-color 0.3s;
}

.secondary-action:hover {
    background: #dcdcdc;
}

.secondary-action.is-disabled {
    pointer-events: none;
    opacity: 0.55;
}

#quoteFormFrame {
    width: 100%;
    min-height: 720px;
    border: 0;
    border-radius: 12px;
    background: #fff;
}

@media (max-width: 900px) {
    body {
        padding: 12px;
    }

    .editor {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
    }

    .canvas-container,
    .controls {
        width: 100%;
    }

    .canvas-container {
        order: -1;
    }

    .controls {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.6rem;
        margin-bottom: 20px;
    }

    .container {
        padding: 0 8px;
    }

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

    .control-row {
        grid-template-columns: 1fr auto;
        gap: 10px 12px;
    }

    .color-item {
        width: 100px;
        min-width: 100px;
    }

    input[type="color"] {
        width: 40px;
        height: 28px;
    }

    button {
        padding: 12px;
        font-size: 1rem;
    }
}
