/* New UI Styles */
.wpcb-single-container {
    max-width: 760px;
    /* Reduced from 800px */
    margin: 0 auto;
    font-family: 'Sarabun', sans-serif;
    padding: 0 10px;
}

.wpcb-canvas-wrapper {
    position: relative;
    border: none;
    background: #fff;
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-radius: 16px;
    overflow: hidden;
}

canvas#wpcb-canvas,
canvas#wpcb-modal-canvas {
    max-width: 100%;
    height: auto !important;
    display: block;
    cursor: crosshair;
    touch-action: none;
    /* Prevent scrolling while drawing */
}

/* Floating Tools */
.wpcb-floating-tools {
    position: static;
    top: auto;
    right: auto;
    z-index: 10;
    width: 100%;
}

.wpcb-tool-trigger {
    background: linear-gradient(135deg, #fff8dc 0%, #ffffff 100%);
    border: 2px solid #f2c94c;
    padding: 12px 16px;
    border-radius: 16px 16px 0 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-weight: bold;
    box-shadow: 0 8px 18px rgba(242, 201, 76, 0.18);
}

.wpcb-current-color-indicator,
#wpcb-modal-indicator {
    width: 34px;
    height: 34px;
    background: #333;
    border: 3px solid #fff;
    border-radius: 10px;
    box-shadow: 0 0 0 1px #d5d5d5;
    flex-shrink: 0;
}

.wpcb-tool-trigger-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wpcb-tool-trigger-copy strong {
    font-size: 18px;
    line-height: 1.2;
    color: #7a5200;
}

.wpcb-tool-trigger-copy span {
    font-size: 13px;
    color: #755d1b;
}

.wpcb-palette-popup {
    display: none;
    position: static;
    top: auto;
    right: auto;
    background: #fff;
    border: 2px solid #f2c94c;
    border-top: 0;
    padding: 15px;
    border-radius: 0 0 16px 16px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
}

.wpcb-palette-popup.show {
    display: block;
}

.wpcb-palette-static {
    display: block;
}

.wpcb-palette-popup input[type="color"] {
    width: 100%;
    height: 48px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 12px;
    background: #fff;
    cursor: pointer;
}

.wpcb-palette-grid {
    display: grid;
    grid-template-columns: repeat(10, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

.wpcb-swatch {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 999px;
    cursor: pointer;
    border: 2px solid rgba(0, 0, 0, 0.08);
    box-sizing: border-box;
}

.wpcb-swatch:hover {
    transform: scale(1.1);
}

.wpcb-swatch.active {
    border-color: #222;
    box-shadow: 0 0 0 3px rgba(242, 201, 76, 0.45);
}

.wpcb-tools-row {
    display: flex;
    justify-content: space-between;
    margin-top: 12px;
    gap: 8px;
}

.wpcb-tools-row button {
    flex: 1;
    margin: 0;
    padding: 10px 8px;
    background: #f7f7f7;
    border: 1px solid #ccc;
    cursor: pointer;
    border-radius: 10px;
}

.wpcb-tools-row button.active {
    background: #0073aa;
    color: #fff;
}

/* Action Bar */
.wpcb-action-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.wpcb-btn-action {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: background 0.2s;
}

.wpcb-btn-action:hover {
    background: #eee;
}

/* Social Section */
.wpcb-social-section {
    text-align: center;
    margin-top: 20px;
}

.wpcb-social-section p {
    font-size: 16px;
    margin-bottom: 15px;
    font-weight: bold;
}

.wpcb-social-icons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.wpcb-social-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-decoration: none;
    font-size: 24px;
    transition: transform 0.2s;
}

.wpcb-social-btn:hover {
    transform: scale(1.1);
    color: #fff;
}

.wpcb-social-btn.fb {
    background: #3b5998;
}

.wpcb-social-btn.tw {
    background: #1da1f2;
}

.wpcb-social-btn.line {
    background: #00c300;
}

/* Modal Adjustments */
.wpcb-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.7);
    padding: 20px;
    overflow-y: auto;
}

.wpcb-modal-content.wpcb-new-ui {
    position: relative;
    background: #fff;
    padding: 40px 20px;
    margin: 30px auto;
    max-width: 900px;
    height: auto;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 16px;
}

.wpcb-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 999px;
    background: #f0f0f0;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.wpcb-modal-title {
    margin: 0 0 20px;
    padding-right: 48px;
    text-align: center;
}

@media (max-width: 680px) {
    .wpcb-palette-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .wpcb-tool-trigger {
        align-items: flex-start;
    }

    .wpcb-tool-trigger-copy strong {
        font-size: 16px;
    }
}

/* Gallery Grid (Existing) */
.wpcb-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.wpcb-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.wpcb-item:hover {
    transform: translateY(-5px);
}

.wpcb-item img {
    max-width: 100%;
    height: auto;
}
