/* C-S-A Pallet Constructor Styles (Mobile Optimized & Fully Customizable) */
.csa-pallet-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    background: #ffffff;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 8px;
    width: 100%;
}

.csa-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #1d2327;
}

.csa-layout {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.csa-canvas-wrap {
    flex: 2;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.csa-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.csa-canvas-container {
    position: relative;
    width: 100%;
}

.csa-canvas {
    width: 100%;
    height: 600px;
    background: #f0f2f5;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    position: relative;
    overflow: hidden;
    touch-action: none;
}

.csa-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    border: 1px solid #dcdcde;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    max-width: 70%;
    text-align: right;
}

.csa-sidebar {
    flex: 1;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.csa-panel {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 15px;
    box-sizing: border-box;
}

.csa-panel h3 {
    font-size: 16px;
    font-weight: 600;
    margin-top: 0;
    margin-bottom: 12px;
    color: #1d2327;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.csa-panel h4 {
    font-size: 14px;
    margin: 10px 0 6px 0;
    color: #444;
}

.csa-panel label {
    display: flex;
    flex-direction: column;
    font-size: 13px;
    margin-bottom: 8px;
    color: #555;
}

.csa-panel input[type="number"],
.csa-panel input[type="text"],
.csa-panel input[type="email"],
.csa-panel select,
.csa-panel textarea {
    margin-top: 4px;
    padding: 8px;
    border: 1px solid #ccd0d7;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    width: 100%;
    background-color: #fff;
    color: #333;
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

.csa-panel input:focus,
.csa-panel select:focus,
.csa-panel textarea:focus {
    border-color: #0073aa;
    outline: none;
}

.csa-panel textarea {
    resize: vertical;
    min-height: 80px;
}

.csa-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
    background: #f1f1f1;
    color: #333;
    min-height: 40px;
}

.csa-btn:hover {
    opacity: 0.9;
}

.csa-btn-clear {
    background-color: #d9534f;
    color: #ffffff;
}

.csa-btn-clear:hover {
    background-color: #c9302c;
    color: #ffffff;
}

.csa-btn-reset-view {
    background-color: #5bc0de;
    color: #ffffff;
}

.csa-btn-reset-view:hover {
    background-color: #31b0d5;
    color: #ffffff;
}

.csa-btn-share {
    background-color: #f0ad4e;
    color: #ffffff;
}

.csa-btn-share:hover {
    background-color: #ec971f;
    color: #ffffff;
}

.add-board {
    background-color: #0073aa;
    color: #ffffff;
}

.add-board:hover {
    background-color: #005177;
    color: #ffffff;
}

.add-block {
    background-color: #28a745;
    color: #ffffff;
}

.add-block:hover {
    background-color: #218838;
    color: #ffffff;
}

.csa-btn-primary {
    background-color: #0073aa;
    color: #ffffff;
    width: 100%;
    margin-top: 10px;
}

.csa-btn-primary:hover {
    background-color: #005177;
    color: #ffffff;
}

.csa-btn-danger {
    background-color: #d9534f;
    color: #ffffff;
}

.csa-btn-danger:hover {
    background-color: #c9302c;
    color: #ffffff;
}

.csa-btn-action {
    background-color: #f0f0f1;
    color: #2c3338;
    border: 1px solid #8c8f94;
}

.csa-btn-action:hover {
    background-color: #e0e0e1;
    color: #1d2327;
}

.csa-results {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 4px;
    margin-top: 10px;
}

.csa-results p {
    margin: 6px 0;
    font-size: 13px;
}

.csa-results .csa-total {
    font-size: 15px;
    border-top: 1px solid #ddd;
    padding-top: 6px;
    margin-top: 8px;
}

.csa-hidden {
    display: none !important;
}

.csa-btn i, .csa-btn svg {
    margin-right: 6px;
    width: 1em;
    height: 1em;
    display: inline-block;
    vertical-align: middle;
    fill: currentColor;
}

@media screen and (max-width: 768px) {
    .csa-pallet-app {
        padding: 10px;
    }
    .csa-layout {
        flex-direction: column;
    }
    .csa-canvas-wrap {
        width: 100%;
    }
    .csa-canvas {
        height: 45vh !important;
        min-height: 300px;
    }
    .csa-toolbar {
        gap: 6px;
        padding: 8px;
    }
    .csa-toolbar .csa-btn {
        flex: 1 1 calc(50% - 6px);
        font-size: 13px;
        padding: 10px 8px;
        min-height: 44px;
    }
    .csa-hint {
        position: static;
        max-width: 100%;
        text-align: center;
        margin-top: 6px;
        box-shadow: none;
    }
    .csa-sidebar {
        width: 100%;
    }
    .csa-panel {
        padding: 12px;
    }
    .csa-panel h3 {
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        padding-bottom: 10px;
    }
    .csa-panel h3::after {
        content: '+';
        font-size: 18px;
        font-weight: bold;
    }
    .csa-panel.csa-mobile-open h3::after {
        content: '-',
    }
    .csa-panel > *:not(h3) {
        /*display: none;*/
        margin-top: 12px;
    }
    .csa-panel.csa-mobile-open > *:not(h3) {
        display: block;
    }
    .csa-panel input[type="number"],
    .csa-panel input[type="text"],
    .csa-panel input[type="email"],
    .csa-panel select,
    .csa-panel textarea,
    .csa-panel button {
        min-height: 44px;
        font-size: 16px !important;
    }
}


.csa-hint {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: transparent;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 12px;
    color: #444;
    border: none;
    pointer-events: none;
    z-index: 10;
    box-shadow: none;
    max-width: 70%;
    text-align: right;
}

.csa-watermark {
    position: absolute;
    top: 15px;
    left: 15px;
    pointer-events: none;
    z-index: 5;
    max-width: 160px;
    opacity: 0.8;
}

.csa-watermark img {
    max-width: 100%;
    height: auto;
    display: block;
}

.csa-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    padding: 10px 15px;
    font-size: 13px;
    color: #444;
    border: none;
    pointer-events: none;
    z-index: 10;
    box-shadow: none;
    text-align: center;
}

.csa-watermark-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 5;
    max-width: 80%;
    max-height: 80%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.csa-watermark-center img {
    height: auto;
    display: block;
    object-fit: contain;
}

.csa-watermark-repeat {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    background-repeat: repeat;
    background-position: center;
}


.csa-hint {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    box-sizing: border-box;
    background: transparent;
    padding: 10px 15px;
    font-size: 13px;
    color: #444;
    border: none;
    pointer-events: none;
    z-index: 10;
    box-shadow: none;
    text-align: center;
}
