/* ==========================================================================
   Label Jar Plugin — Styles
   ========================================================================== */

/* ---------- Launcher Button ---------- */

.ljp-launcher-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    line-height: 1.4;
}

.ljp-launcher-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0.92;
}

.ljp-launcher-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.ljp-launcher-btn svg {
    flex-shrink: 0;
}

/* ---------- Modal Overlay ---------- */

.ljp-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 16px;
    box-sizing: border-box;
}

.ljp-modal-overlay.ljp-active {
    opacity: 1;
    visibility: visible;
}

/* ---------- Modal Container ---------- */

.ljp-modal-container {
    background: #ffffff;
    border-radius: 12px;
    width: 100%;
    max-width: 1200px;
    height: 85vh;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
    position: relative;
    animation: ljp-modal-enter 0.3s ease;
}

@keyframes ljp-modal-enter {
    from {
        transform: scale(0.95) translateY(10px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* ---------- Close Button ---------- */

.ljp-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 10;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.06);
    border: none;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    color: #666;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.ljp-modal-close:hover {
    background: rgba(0, 0, 0, 0.12);
    color: #333;
}

/* ---------- Modal Body (Canvas + Controls) ---------- */

.ljp-modal-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ---------- Canvas Wrapper ---------- */

.ljp-canvas-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf0 100%);
    overflow: hidden;
}

.ljp-canvas-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

/* ---------- Interaction Hint Overlay ---------- */

.ljp-interaction-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 24px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    pointer-events: none;
    z-index: 5;
    opacity: 1;
    transition: opacity 0.5s ease;
    animation: ljp-hint-pulse 2s ease-in-out infinite;
}

.ljp-interaction-hint svg {
    flex-shrink: 0;
}

.ljp-interaction-hint.ljp-hint-fade-out {
    opacity: 0;
}

@keyframes ljp-hint-pulse {
    0%, 100% { opacity: 0.85; }
    50% { opacity: 1; }
}

/* ---------- Controls Panel ---------- */

.ljp-controls-panel {
    width: 340px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid #e5e7eb;
    background: #fafbfc;
    box-sizing: border-box;
}

.ljp-controls-panel::-webkit-scrollbar {
    width: 6px;
}

.ljp-controls-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* --- Section Headers --- */

.ljp-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin: 0 0 10px 0;
    padding: 0;
}

.ljp-section-title:not(:first-child) {
    margin-top: 20px;
}

/* --- Category Tabs (inside carousel track) --- */

.ljp-category-tab {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    white-space: nowrap;
    flex-shrink: 0;
    scroll-snap-align: start;
}

.ljp-category-tab:hover {
    border-color: #aaa;
    color: #333;
}

.ljp-category-tab.ljp-active {
    background: #e22944;
    border-color: #e22944;
    color: #fff;
}

/* --- Preset Cards Carousel --- */

.ljp-preset-carousel {
    position: relative;
    margin-bottom: 12px;
}

.ljp-preset-track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
}

.ljp-preset-track::-webkit-scrollbar {
    display: none;
}

.ljp-preset-card {
    min-width: 130px;
    max-width: 150px;
    flex-shrink: 0;
    padding: 8px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-align: left;
    scroll-snap-align: start;
}

.ljp-preset-card:hover {
    border-color: #e22944;
    background: #fef2f3;
}

.ljp-preset-card.ljp-active {
    border-color: #e22944;
    background: #fef2f3;
    box-shadow: 0 0 0 1px #e22944;
}

.ljp-preset-card-name {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ljp-preset-card-detail {
    font-size: 10px;
    color: #888;
    margin-top: 2px;
    display: block;
    white-space: nowrap;
}

/* Carousel nav arrows */

.ljp-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    z-index: 2;
    font-size: 14px;
    color: #555;
    padding: 0;
    line-height: 1;
    transition: opacity 0.15s;
}

.ljp-carousel-btn:hover {
    background: #fff;
    color: #333;
}

.ljp-carousel-btn--prev {
    left: -4px;
}

.ljp-carousel-btn--next {
    right: -4px;
}

.ljp-carousel-btn[disabled] {
    opacity: 0;
    pointer-events: none;
}

/* --- Background Cards (in carousel) --- */

.ljp-bg-card {
    min-width: 90px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 6px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    scroll-snap-align: start;
}

.ljp-bg-card:hover {
    border-color: #e22944;
    background: #fef2f3;
}

.ljp-bg-card.ljp-active {
    border-color: #e22944;
    background: #fef2f3;
    box-shadow: 0 0 0 1px #e22944;
}

.ljp-bg-card-swatch {
    display: block;
    width: 100%;
    height: 28px;
    border-radius: 4px;
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.ljp-bg-card-label {
    font-size: 10px;
    font-weight: 500;
    color: #666;
    white-space: nowrap;
}

.ljp-bg-card.ljp-active .ljp-bg-card-label {
    color: #333;
    font-weight: 600;
}

/* --- Custom Dimensions --- */

.ljp-custom-form {
    display: none;
}

.ljp-custom-form.ljp-visible {
    display: block;
}

.ljp-custom-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.ljp-custom-field {
    flex: 1;
}

.ljp-custom-field label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
}

.ljp-custom-field input,
.ljp-custom-field select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}

.ljp-custom-field input:focus,
.ljp-custom-field select:focus {
    outline: none;
    border-color: #e22944;
    box-shadow: 0 0 0 2px rgba(226, 41, 68, 0.15);
}

.ljp-custom-generate-btn {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 6px;
    background: #e22944;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.15s;
    margin-top: 4px;
}

.ljp-custom-generate-btn:hover {
    opacity: 0.9;
}

/* --- Slider Controls --- */

.ljp-slider-group {
    margin-bottom: 14px;
}

.ljp-slider-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 4px;
}

.ljp-slider-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ljp-slider-range {
    flex: 1;
    min-width: 0;
    height: 6px;
    -webkit-appearance: none;
    appearance: none;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}

.ljp-slider-value-input {
    width: 62px;
    flex-shrink: 0;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    font-family: inherit;
    text-align: right;
    box-sizing: border-box;
}

.ljp-slider-value-input:focus {
    outline: none;
    border-color: #e22944;
    box-shadow: 0 0 0 2px rgba(226, 41, 68, 0.15);
}

.ljp-slider-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e22944;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    transition: transform 0.1s ease;
}

.ljp-slider-range::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.ljp-slider-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #e22944;
    border: none;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* --- Label Material Picker --- */

.ljp-material-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.ljp-material-swatch {
    width: 40px;
    height: 40px;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    overflow: hidden;
}

.ljp-material-swatch:hover {
    border-color: #999;
    transform: scale(1.05);
}

.ljp-material-swatch.ljp-active {
    border-color: #e22944;
    box-shadow: 0 0 0 2px rgba(226, 41, 68, 0.3);
}

.ljp-material-swatch-label {
    font-size: 9px;
    text-align: center;
    color: #888;
    margin-top: 2px;
    line-height: 1.2;
}

/* --- Wax Controls --- */

.ljp-controls-panel input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    background: none;
}

.ljp-controls-panel input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 2px;
}

.ljp-controls-panel input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 3px;
}

.ljp-controls-panel input[type="checkbox"] {
    accent-color: #e22944;
}

/* --- Units Toggle --- */

.ljp-units-toggle {
    display: flex;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 14px;
}

.ljp-units-btn {
    flex: 1;
    padding: 6px;
    border: none;
    background: #fff;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.ljp-units-btn.ljp-active {
    background: #e22944;
    color: #fff;
}

/* --- Reset Button --- */

.ljp-reset-btn {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: #fff;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    margin-top: 8px;
}

.ljp-reset-btn:hover {
    border-color: #aaa;
    color: #333;
}

/* ---------- Modal Footer / Dimension Readout ---------- */

.ljp-modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e5e7eb;
    background: #1a1a2e;
    flex-shrink: 0;
}

.ljp-dimension-readout {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ljp-dimension-label {
    font-size: 14px;
    font-weight: 500;
    color: #a0a0b8;
}

.ljp-dimension-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.ljp-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e8;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    margin-left: auto;
}

.ljp-copy-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.ljp-copy-btn.ljp-copied {
    border-color: #22c55e;
    color: #22c55e;
}

/* ---------- Responsive (Mobile < 768px) ---------- */

@media (max-width: 767px) {
    .ljp-modal-overlay {
        padding: 0;
    }

    .ljp-modal-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }

    .ljp-modal-body {
        flex-direction: column;
    }

    .ljp-canvas-wrapper {
        height: 40vh;
        flex: none;
    }

    .ljp-controls-panel {
        width: 100%;
        flex: 1;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ljp-dimension-value {
        font-size: 18px;
    }

    .ljp-slider-range::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
    }

    .ljp-slider-range::-moz-range-thumb {
        width: 24px;
        height: 24px;
    }

    .ljp-preset-card {
        min-width: 120px;
    }
}

/* ---------- Tablet (768–1024px) ---------- */

@media (min-width: 768px) and (max-width: 1024px) {
    .ljp-controls-panel {
        width: 280px;
    }
}

/* ==========================================================================
   Inline Embed Mode
   ========================================================================== */

/* ---------- Inline Embed Container ---------- */

.ljp-inline-embed {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    box-sizing: border-box;
}

.ljp-inline-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.ljp-inline-embed .ljp-canvas-wrapper {
    flex: 1;
    min-width: 0;
    position: relative;
    background: linear-gradient(135deg, #f0f2f5 0%, #e8ecf0 100%);
    overflow: hidden;
}

.ljp-inline-embed .ljp-canvas-wrapper canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.ljp-inline-embed .ljp-controls-panel {
    width: 340px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid #e5e7eb;
    background: #fafbfc;
    box-sizing: border-box;
}

.ljp-inline-embed .ljp-controls-panel::-webkit-scrollbar {
    width: 6px;
}

.ljp-inline-embed .ljp-controls-panel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* ---------- Inline Footer ---------- */

.ljp-inline-footer {
    padding: 14px 24px;
    border-top: 1px solid #e5e7eb;
    background: #1a1a2e;
    flex-shrink: 0;
    border-radius: 0 0 12px 12px;
}

.ljp-inline-footer .ljp-dimension-readout {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.ljp-inline-footer .ljp-dimension-label {
    font-size: 14px;
    font-weight: 500;
    color: #a0a0b8;
}

.ljp-inline-footer .ljp-dimension-value {
    font-size: 22px;
    font-weight: 700;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.ljp-inline-footer .ljp-copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 12px;
    font-weight: 500;
    color: #e0e0e8;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    margin-left: auto;
}

.ljp-inline-footer .ljp-copy-btn:hover {
    border-color: rgba(255, 255, 255, 0.4);
    color: #fff;
    background: rgba(255, 255, 255, 0.15);
}

.ljp-inline-footer .ljp-copy-btn.ljp-copied {
    border-color: #22c55e;
    color: #22c55e;
}

/* ---------- No-Controls Variant ---------- */

.ljp-inline-embed--no-controls .ljp-canvas-wrapper {
    width: 100%;
}

/* ---------- Inline Fallback ---------- */

.ljp-inline-fallback {
    padding: 40px;
    text-align: center;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    color: #888;
    font-size: 14px;
}

/* ---------- Inline Responsive (Mobile < 768px) ---------- */

@media (max-width: 767px) {
    .ljp-inline-embed {
        border-radius: 8px;
    }

    .ljp-inline-body {
        flex-direction: column;
    }

    .ljp-inline-embed .ljp-canvas-wrapper {
        height: 50%;
        flex: none;
    }

    .ljp-inline-embed .ljp-controls-panel {
        width: 100%;
        flex: 1;
        border-left: none;
        border-top: 1px solid #e5e7eb;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .ljp-inline-footer .ljp-dimension-value {
        font-size: 18px;
    }

    .ljp-inline-footer {
        border-radius: 0 0 8px 8px;
    }
}

/* ---------- Inline Tablet (768–1024px) ---------- */

@media (min-width: 768px) and (max-width: 1024px) {
    .ljp-inline-embed .ljp-controls-panel {
        width: 280px;
    }
}
