/**
 * Sport Trading Cards - Designer CSS
 * Dark theme with orange accent colors
 */

/* ------------------- */
/* CSS Variables      */
/* ------------------ */
:root {
    /* Primary colors */
    --stc-primary: #D88126;
    /* Main orange */
    --stc-primary-hover: #F09339;
    /* Lighter orange for hover */
    --stc-primary-active: #B66B1F;
    /* Darker orange for active states */
    --stc-primary-light: rgba(216, 129, 38, 0.15);
    /* Transparent orange for backgrounds */

    /* Background colors */
    --stc-bg-dark: #121212;
    /* Main background */
    --stc-bg-darker: #0A0A0A;
    /* Darker sections */
    --stc-bg-lighter: #1E1E1E;
    /* Lighter sections */
    --stc-bg-card: #252525;
    /* Card/panel backgrounds */
    --stc-bg-elevated: #2D2D2D;
    /* Elevated elements */

    /* Border colors */
    --stc-border-light: rgba(255, 255, 255, 0.1);
    /* Light borders */
    --stc-border-medium: rgba(255, 255, 255, 0.15);
    /* Medium borders */
    --stc-border-strong: rgba(255, 255, 255, 0.25);
    /* Strong borders */

    /* Status colors */
    --stc-success: #4CAF50;
    /* Green */
    --stc-warning: #FFC107;
    /* Yellow */
    --stc-danger: #F44336;
    /* Red */

    /* Text colors */
    --stc-text-primary: rgba(255, 255, 255, 0.9);
    /* Main text */
    --stc-text-secondary: rgba(255, 255, 255, 0.7);
    /* Secondary text */
    --stc-text-muted: #475569;
    /* Muted text */

    /* Neutrals */
    --stc-white: #ffffff;
    --stc-gray-50: rgba(255, 255, 255, 0.05);
    --stc-gray-100: rgba(255, 255, 255, 0.1);
    --stc-gray-200: rgba(255, 255, 255, 0.15);
    --stc-gray-300: rgba(255, 255, 255, 0.2);
    --stc-gray-400: rgba(255, 255, 255, 0.3);
    --stc-gray-500: rgba(255, 255, 255, 0.5);

    /* Spacing - unchanged */
    --stc-space-1: 0.25rem;
    --stc-space-2: 0.5rem;
    --stc-space-3: 0.75rem;
    --stc-space-4: 1rem;
    --stc-space-5: 1.25rem;
    --stc-space-6: 1.5rem;
    --stc-space-8: 2rem;
    --stc-space-10: 2.5rem;
    --stc-space-12: 3rem;

    /* Fonts - unchanged */
    --stc-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* Shadows */
    --stc-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 1px 2px rgba(0, 0, 0, 0.2);
    --stc-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --stc-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);

    /* Border Radius - unchanged */
    --stc-radius-sm: 0.25rem;
    --stc-radius-md: 0.375rem;
    --stc-radius-lg: 0.5rem;
    --stc-radius-xl: 0.75rem;
    --stc-radius-full: 9999px;

    /* Transitions - unchanged */
    --stc-transition-fast: 150ms ease;
    --stc-transition-normal: 250ms ease;
    --stc-transition-slow: 350ms ease;

    /* Z-index layers - unchanged */
    --stc-z-modal: 1000;
    --stc-z-dropdown: 10;
    --stc-z-tooltip: 20;
}

/* Font faces - unchanged */
@font-face {
    font-family: 'STC_Mistral';
    src: url('/wp-content/plugins/octo-stc/public/assets/signature/MISTRAL.woff2');
}

@font-face {
    font-family: 'STC_ArialMS';
    src: url('/wp-content/plugins/octo-stc/public/assets/signature/ArialMS.woff2');
}

@font-face {
    font-family: 'STC_Birthstone';
    src: url('/wp-content/plugins/octo-stc/public/assets/signature/Birthstone.woff2');
}

@font-face {
    font-family: 'STC_Rage';
    src: url('/wp-content/plugins/octo-stc/public/assets/signature/Rage.woff2');
}

@font-face {
    font-family: 'STC_Ballet';
    src: url('/wp-content/plugins/octo-stc/public/assets/signature/Ballet.woff2');
}

@font-face {
    font-family: "AgencyFB-Bold";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/AgencyFB-Bold.woff2');
}

@font-face {
    font-family: "AgencyFB-Reg";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/AgencyFB-Reg.woff2');
}

@font-face {
    font-family: "Anton";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/Anton.woff2');
}

@font-face {
    font-family: "ArchivoNarrow-Regular";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/ArchivoNarrow-Regular.woff2');
}

@font-face {
    font-family: "EdwardianScriptITC";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/EdwardianScriptITC.woff2');
}

@font-face {
    font-family: "Freshman";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/Freshman.woff2');
}

@font-face {
    font-family: "GOODBRUSH";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/GOODBRUSH.woff2');
}

@font-face {
    font-family: "Impact";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/Impact.woff2');
}

@font-face {
    font-family: "KristenITC-Regular";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/KristenITC-Regular.woff2');
}

@font-face {
    font-family: "MyriadPro-BoldCondIt";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/MyriadPro-BoldCondIt.woff2');
}

@font-face {
    font-family: "MyriadPro-Regular";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/MyriadPro-Regular.woff2');
}

@font-face {
    font-family: "OrdinaryGuyDEMO";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/OrdinaryGuyDEMO.woff2');
}

@font-face {
    font-family: "OswaldStencil-Bold";
    src: url('/wp-content/plugins/octo-stc/public/assets/fonts/OswaldStencil-Bold.woff2');
}

/* ------------------- */
/* Base Styles        */
/* ------------------ */
.stc-customization-container {
    font-family: var(--stc-font-sans);
    color: var(--stc-text-primary);
    line-height: 1.5;
    margin: 2em 0;
    max-width: 100%;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* ------------------- */
/* Modal Base         */
/* ------------------ */
.stc-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--stc-bg-dark);
    z-index: var(--stc-z-modal);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--stc-transition-normal), visibility var(--stc-transition-normal);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stc-modal.is-active {
    opacity: 1;
    visibility: visible;
}

/* Modal Header */
.stc-modal-header {
    height: 60px;
    background-color: var(--stc-bg-darker);
    border-bottom: 1px solid var(--stc-border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--stc-space-6);
    box-shadow: var(--stc-shadow-sm);
    position: relative;
    z-index: 5;
}

.stc-modal-close {
    background: none;
    border: none;
    padding: var(--stc-space-2) var(--stc-space-3);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--stc-space-2);
    color: var(--stc-text-secondary);
    font-size: 0.875rem;
    border-radius: var(--stc-radius-md);
    transition: all var(--stc-transition-fast);
}

.stc-modal-close:hover {
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-lighter);
}

.stc-modal-close span {
    font-size: 1.25rem;
    line-height: 1;
}

.stc-modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: var(--stc-text-primary);
}

/* Side Switch */
.stc-side-switch {
    display: flex;
    gap: var(--stc-space-2);
    background-color: var(--stc-bg-lighter);
    padding: var(--stc-space-1);
    border-radius: var(--stc-radius-lg);
}

.stc-side-switch button {
    padding: var(--stc-space-2) var(--stc-space-4);
    border: none;
    background: transparent;
    border-radius: var(--stc-radius-md);
    cursor: pointer;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    transition: all var(--stc-transition-fast);
}

.stc-side-switch button.is-active {
    background-color: var(--stc-bg-dark);
    color: var(--stc-primary);
    box-shadow: var(--stc-shadow-sm);
}

.stc-side-switch button:hover:not(.is-active) {
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-card);
}

/* Modal Main Container */
.stc-modal-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ------------------- */
/* Steps Navigation    */
/* ------------------ */
.stc-steps {
    width: 380px;
    background-color: var(--stc-bg-lighter);
    border-right: 1px solid var(--stc-border-light);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.stc-steps-list {
    flex: 1;
    overflow-y: auto;
    padding: var(--stc-space-4);
    scrollbar-width: thin;
    scrollbar-color: var(--stc-gray-300) transparent;
}

.stc-steps-list::-webkit-scrollbar {
    width: 6px;
}

.stc-steps-list::-webkit-scrollbar-track {
    background: transparent;
}

.stc-steps-list::-webkit-scrollbar-thumb {
    background-color: var(--stc-gray-300);
    border-radius: var(--stc-radius-full);
}

.stc-step {
    margin-bottom: var(--stc-space-3);
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-lg);
    overflow: hidden;
    transition: all var(--stc-transition-normal);
    box-shadow: var(--stc-shadow-sm);
    background-color: var(--stc-bg-card);
}

.stc-step.is-active {
    box-shadow: var(--stc-shadow-md);
    border-color: var(--stc-primary);
}

.stc-step-header {
    padding: var(--stc-space-4);
    background-color: var(--stc-bg-card);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: var(--stc-space-3);
    width: 100%;
    text-align: left;
    border: none;
    transition: background-color var(--stc-transition-fast);
    position: relative;
}

/* Add a toggle indicator to step headers */
.stc-step-header::after {
    content: "";
    position: absolute;
    right: var(--stc-space-4);
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--stc-gray-400);
    border-bottom: 2px solid var(--stc-gray-400);
    transition: transform var(--stc-transition-fast);
}

.stc-step.is-active .stc-step-header::after {
    transform: translateY(-50%) rotate(45deg);
}

.stc-step-header:hover {
    background-color: var(--stc-bg-elevated);
}

.stc-step.is-active .stc-step-header {
    background-color: var(--stc-primary-light);
}

.stc-step-indicator {
    width: 28px;
    height: 28px;
    border-radius: var(--stc-radius-full);
    background-color: var(--stc-gray-300);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--stc-text-primary);
    font-size: 0.875rem;
    transition: background-color var(--stc-transition-normal);
}

.stc-step.is-complete .stc-step-indicator {
    background-color: var(--stc-success);
}

.stc-step.is-active .stc-step-indicator {
    background-color: var(--stc-primary);
}

.stc-step-content {
    flex: 1;
    min-width: 0;
}

.stc-step-title {
    font-weight: 600;
    margin-bottom: var(--stc-space-1);
    display: flex;
    align-items: center;
    gap: var(--stc-space-1);
    color: var(--stc-text-primary);
}

.stc-step-required {
    color: var(--stc-danger);
}

.stc-price {
    font-size: 0.875rem;
    color: var(--stc-primary);
    font-weight: normal;
}

.stc-step-description {
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
}

.stc-step-panel-container {
    overflow: hidden;
    max-height: 0;
    transition: max-height var(--stc-transition-normal);
}

.stc-step.is-active .stc-step-panel-container {
    max-height: 1000px;
    /* Large enough to accommodate various content heights */
}

.stc-step-panel {
    padding: var(--stc-space-4);
    border-top: 1px solid var(--stc-border-light);
    background-color: var(--stc-bg-elevated);
}

/* ------------------- */
/* Canvas Container    */
/* ------------------ */
.stc-canvas-container {
    flex: 1;
    background-color: var(--stc-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--stc-space-6);
    overflow: hidden;
    position: relative;
}

.stc-canvas-wrapper {
    background-color: var(--stc-bg-card);
    box-shadow: var(--stc-shadow-lg);
    border-radius: var(--stc-radius-lg);
    padding: var(--stc-space-5);
    transition: transform var(--stc-transition-normal);
    will-change: transform;
    box-sizing: content-box;
}

/* ------------------- */
/* Form Controls       */
/* ------------------ */
.stc-text-field,
.stc-image-field,
.stc-signature-field,
.stc-color-field,
.stc-select-field,
.stc-multi-text-field {
    margin-bottom: var(--stc-space-4);
}

/* Text Input */
.stc-input {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    transition: border-color var(--stc-transition-fast), box-shadow var(--stc-transition-fast);
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-card);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stc-input:focus {
    border-color: var(--stc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-input::placeholder {
    color: var(--stc-text-muted);
}

/* Text Controls */
.stc-text-controls {
    display: flex;
    gap: var(--stc-space-2);
    margin-top: var(--stc-space-2);
    align-items: center;
}

.stc-multi-text-item .stc-text-controls {
    display: flex;
    gap: var(--stc-space-2);
    margin-top: var(--stc-space-2);
    align-items: center;
    flex-wrap: wrap;
}

.stc-multi-text-item .stc-font-select {
    min-width: 120px;
    flex: 1;
}

.stc-multi-text-item .stc-color-picker {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.stc-font-size-control {
    display: flex;
    align-items: center;
    gap: var(--stc-space-1);
    white-space: nowrap;
}

.stc-font-size-control label {
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin: 0;
}

.stc-font-size-input {
    width: 60px !important;
    padding: var(--stc-space-1) var(--stc-space-2) !important;
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
    font-size: 0.875rem;
}

.stc-color-picker {
    width: 36px;
    height: 36px;
    padding: 0;
    border: 2px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    cursor: pointer;
    background-color: transparent;
    transition: border-color var(--stc-transition-fast);
    overflow: hidden;
}

.stc-image-actions {
    display: flex;
    gap: var(--stc-space-2);
    margin-top: var(--stc-space-3);
}

.stc-remove-image-btn {
    padding: var(--stc-space-2) var(--stc-space-3);
    background-color: var(--stc-bg-lighter);
    color: var(--stc-danger);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: var(--stc-space-2);
    transition: all var(--stc-transition-fast);
}

.stc-remove-image-btn:hover {
    background-color: rgba(244, 67, 54, 0.1);
    border-color: var(--stc-danger);
}

.stc-remove-image-btn svg {
    width: 16px;
    height: 16px;
}

/* Make border color picker full width when it's the only input */
.stc-color-field .stc-color-picker {
    width: 100%;
    height: 40px;
}

.stc-color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

.stc-color-picker::-webkit-color-swatch {
    border: none;
}

.stc-color-picker:focus {
    border-color: var(--stc-primary);
    outline: none;
}

.stc-font-select {
    flex: 1;
    padding: var(--stc-space-2) var(--stc-space-3) !important;
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    background-color: var(--stc-bg-card);
    color: var(--stc-text-muted);
    cursor: pointer;
    transition: border-color var(--stc-transition-fast), box-shadow var(--stc-transition-fast);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.stc-font-select:focus {
    border-color: var(--stc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-font-select {
    -webkit-appearance: menulist;
    appearance: menulist;
}

.stc-font-select option {
    font-size: 14px;
    padding: 8px;
    min-height: 24px;
    display: block;
    line-height: 1.5;
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
}


/* Text Advanced Options Styles */

/* Advanced Toggle Button */
.stc-advanced-toggle {
    margin-top: var(--stc-space-3);
    text-align: right;
}

.stc-toggle-advanced {
    background: none;
    border: none;
    font-size: 0.875rem;
    color: var(--stc-primary);
    cursor: pointer;
    padding: var(--stc-space-1) var(--stc-space-2);
    border-radius: var(--stc-radius-md);
    transition: all var(--stc-transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background-color: var(--stc-bg-card);
    border: 1px solid var(--stc-border-light);
}

.stc-toggle-advanced:hover {
    background-color: var(--stc-primary-light);
}

.stc-toggle-icon {
    margin-left: var(--stc-space-1);
    font-size: 0.75rem;
}

/* Advanced Options Panel */
.stc-advanced-options {
    margin-top: var(--stc-space-3);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--stc-transition-normal),
        opacity var(--stc-transition-normal),
        margin var(--stc-transition-normal);
    opacity: 0;
    border: 0 solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
}

.stc-advanced-options.is-expanded {
    max-height: 600px;
    /* Large enough to accommodate all controls */
    opacity: 1;
    border-width: 1px;
    padding: var(--stc-space-3);
    margin-bottom: var(--stc-space-3);
    background-color: var(--stc-bg-card);
}

/* Option Section */
.stc-option-section {
    margin-bottom: var(--stc-space-4);
}

.stc-option-section:last-child {
    margin-bottom: 0;
}

.stc-option-header {
    display: flex;
    align-items: center;
    gap: var(--stc-space-3);
    margin-bottom: var(--stc-space-2);
}

.stc-option-controls {
    padding-left: var(--stc-space-5);
    opacity: 0.5;
    pointer-events: none;
    transition: opacity var(--stc-transition-fast);
}

.stc-option-controls.is-enabled {
    opacity: 1;
    pointer-events: auto;
}

/* Slider and Control Styles */
.stc-control-row {
    display: flex;
    gap: var(--stc-space-3);
    margin-bottom: var(--stc-space-3);
}

.stc-control-row:last-child {
    margin-bottom: 0;
}

.stc-control-column {
    flex: 1;
    min-width: 0;
}

.stc-control-column label {
    display: block;
    font-size: 0.8125rem;
    margin-bottom: var(--stc-space-1);
    color: var(--stc-text-secondary);
}

.stc-slider-container {
    display: flex;
    align-items: center;
    gap: var(--stc-space-2);
}

.stc-slider-container input[type="range"] {
    flex: 1;
    -webkit-appearance: none;
    width: 100%;
    height: 6px;
    border-radius: var(--stc-radius-full);
    background: var(--stc-gray-300);
    outline: none;
}

.stc-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--stc-primary);
    cursor: pointer;
    transition: background var(--stc-transition-fast);
}

.stc-slider-container input[type="range"]::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: var(--stc-primary);
    cursor: pointer;
    transition: background var(--stc-transition-fast);
}

.stc-slider-container input[type="range"]::-webkit-slider-runnable-track {
    box-shadow: unset !important;
}

.stc-slider-container input[type=range]::-webkit-slider-thumb {
    margin-top: -3.7px !important;
}

.stc-slider-container .stc-slider-value {
    min-width: 2.5em;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--stc-text-secondary);
    background-color: var(--stc-bg-lighter);
    padding: var(--stc-space-1) var(--stc-space-2);
    border-radius: var(--stc-radius-md);
}

/* For Firefox which doesn't support styling option elements directly */
@-moz-document url-prefix() {
    .stc-font-select {
        font-family: inherit !important;
    }
}

/* For Safari which doesn't support styling option elements directly */
@media screen and (-webkit-min-device-pixel-ratio:0) {

    /* Safari specific styles */
    _::-webkit-full-page-media,
    _:future,
    :root .stc-font-select {
        font-family: inherit !important;
    }
}

/* Ensure the select itself has the currently selected font */
.stc-font-select {
    font-family: inherit;
}

/* Image Upload */
.stc-image-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    background-color: var(--stc-bg-card);
    margin-bottom: var(--stc-space-3);
    overflow: hidden;
    position: relative;
}

.stc-image-preview:hover,
.stc-image-preview.is-dragover {
    border-color: var(--stc-primary);
    background-color: var(--stc-primary-light);
}

.stc-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stc-image-preview span {
    color: var(--stc-text-secondary);
    font-size: 0.875rem;
    text-align: center;
    padding: var(--stc-space-3);
}

/* Toggle Field - Horizontal layout */
.stc-toggle-field {
    display: flex;
    align-items: center;
    gap: var(--stc-space-3);
    margin-bottom: var(--stc-space-3);
}

/* Toggle Switch */
.stc-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 24px;
    flex-shrink: 0;
}

.stc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--stc-gray-400);
    transition: var(--stc-transition-fast);
    border-radius: var(--stc-radius-full);
}

.stc-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: var(--stc-white);
    transition: var(--stc-transition-fast);
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stc-switch input:checked+.stc-slider {
    background-color: var(--stc-primary);
}

.stc-switch input:checked+.stc-slider:before {
    transform: translateX(24px);
}

.stc-toggle-label {
    font-weight: 500;
    font-size: 0.9375rem;
    color: var(--stc-text-primary);
    display: flex;
    align-items: center;
    gap: var(--stc-space-2);
}

/* ------------------- */
/* Signature Field     */
/* ------------------ */
.stc-signature-field {
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    box-shadow: var(--stc-shadow-sm);
}

.stc-signature-preview {
    margin-top: var(--stc-space-4);
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-3);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stc-signature-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stc-signature-placeholder {
    color: var(--stc-text-secondary);
    font-size: 0.875rem;
    text-align: center;
}

.stc-signature-configure-btn {
    margin-top: var(--stc-space-3);
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-4);
    background-color: var(--stc-bg-dark);
    color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
}

.stc-signature-configure-btn:hover:not(:disabled) {
    background-color: var(--stc-primary-light);
}

.stc-signature-configure-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--stc-gray-300);
    color: var(--stc-text-secondary);
}

.stc-signature-scale-control {
    margin-top: var(--stc-space-3);
}

.stc-signature-scale-control label {
    display: block;
    margin-bottom: var(--stc-space-2);
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
}

.stc-signature-scale-slider {
    width: 100%;
    height: 6px;
    background-color: var(--stc-gray-200);
    border-radius: var(--stc-radius-full);
    -webkit-appearance: none;
    appearance: none;
    outline: none;
}

.stc-signature-scale-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--stc-primary);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.stc-signature-scale-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--stc-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ------------------- */
/* Select Field        */
/* ------------------ */
.stc-select-field {
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    box-shadow: var(--stc-shadow-sm);
}

.stc-select-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--stc-space-3);
}

.stc-select-options {
    display: none;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--stc-space-3);
    margin-top: var(--stc-space-4);
}

.stc-select-options.is-enabled {
    display: block;
}

.stc-select-option {
    border: 2px solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-3);
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    background-color: var(--stc-bg-lighter);
}

.stc-select-option:hover {
    border-color: var(--stc-gray-400);
    transform: translateY(-2px);
    box-shadow: var(--stc-shadow-sm);
}

.stc-select-option.is-selected {
    border-color: var(--stc-primary);
    background-color: var(--stc-primary-light);
    transform: translateY(-3px);
    box-shadow: var(--stc-shadow-md);
}

.stc-select-option-image {
    width: 100%;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--stc-bg-dark);
    border-radius: var(--stc-radius-sm);
    overflow: hidden;
    margin-bottom: var(--stc-space-2);
}

.stc-select-option-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stc-select-option-title {
    text-align: center;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--stc-text-primary);
}

.stc-shape-title,
.stc-texture-title,
.stc-texture-category-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--stc-text-primary);
    margin-top: var(--stc-space-3);
    margin-bottom: var(--stc-space-2);
}

.stc-shape-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--stc-space-3);
    margin-bottom: var(--stc-space-3);
}

.stc-shape-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--stc-bg-dark);
}

.stc-shape-rect {
    background-color: var(--stc-white);
    border-radius: 2px;
}

.stc-shape-circle {
    background-color: var(--stc-white);
    border-radius: 50%;
}

.stc-shape-texture-divider {
    height: 1px;
    background-color: var(--stc-border-light);
    margin: var(--stc-space-4) 0;
}

/* Group selector styling */
.stc-option-group-selector {
    margin-bottom: var(--stc-space-4);
}

.stc-option-group-select {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    cursor: pointer;
    transition: border-color var(--stc-transition-fast), box-shadow var(--stc-transition-fast);
}

.stc-option-group-select:focus {
    border-color: var(--stc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-option-group-select option {
    background-color: var(--stc-bg-darker);
    color: var(--stc-text-primary);
}

/* Texture options grid */
.stc-texture-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--stc-space-3);
    overflow-y: scroll;
    max-height: 500px;
}

.stc-texture-group {
    display: none;
    /* Hidden by default, will be shown based on group selection */
}

/* ------------------- */
/* Multi Text Field    */
/* ------------------ */
.stc-multi-text-item {
    margin-bottom: var(--stc-space-3);
    padding: var(--stc-space-3);
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    box-shadow: var(--stc-shadow-sm);
}

.stc-multi-text-item:last-child {
    margin-bottom: 0;
}

.stc-remove-text-field {
    background: none;
    border: none;
    color: var(--stc-danger);
    cursor: pointer;
    padding: var(--stc-space-1);
    border-radius: var(--stc-radius-sm);
    line-height: 1;
    transition: background-color var(--stc-transition-fast);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-left: auto;
}

.stc-remove-text-field:hover {
    background-color: rgba(244, 67, 54, 0.1);
}

.stc-add-text-field {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--stc-space-2);
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-4);
    background-color: var(--stc-bg-lighter);
    border: 1px dashed var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    color: var(--stc-text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    margin: var(--stc-space-3) 0;
}

.stc-add-text-field:hover {
    background-color: var(--stc-primary-light);
    border-color: var(--stc-primary);
    color: var(--stc-primary);
}

/* ------------------- */
/* Controls           */
/* ------------------ */
.stc-step-controls {
    margin-top: var(--stc-space-4);
    display: flex;
    justify-content: flex-end;
}

.stc-clear-step {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-medium);
    color: var(--stc-text-secondary);
    padding: var(--stc-space-2) var(--stc-space-4);
    border-radius: var(--stc-radius-md);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all var(--stc-transition-fast);
}

.stc-clear-step:hover:not(:disabled) {
    background-color: var(--stc-bg-elevated);
    color: var(--stc-text-primary);
}

.stc-clear-step:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ------------------- */
/* Price Summary       */
/* ------------------ */
.stc-steps-footer {
    border-top: 1px solid var(--stc-border-light);
    padding: var(--stc-space-4);
    background-color: var(--stc-bg-darker);
}

.stc-price-summary {
    margin-bottom: var(--stc-space-4);
    padding: var(--stc-space-3);
    background-color: var(--stc-bg-lighter);
    border-radius: var(--stc-radius-md);
    border: 1px solid var(--stc-border-light);
}

.stc-price-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--stc-space-2);
    font-size: 0.9375rem;
    color: var(--stc-text-secondary);
}

.stc-price-total {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--stc-text-primary);
    margin-top: var(--stc-space-2);
    padding-top: var(--stc-space-2);
    border-top: 1px solid var(--stc-border-light);
}

/* Add to Cart Button */
.stc-add-to-cart {
    width: 100%;
    padding: var(--stc-space-3);
    background-color: var(--stc-primary);
    color: var(--stc-white);
    border: none;
    border-radius: var(--stc-radius-md);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color var(--stc-transition-fast);
    box-shadow: var(--stc-shadow-sm);
}

.stc-add-to-cart:hover {
    background-color: var(--stc-primary-hover);
    box-shadow: var(--stc-shadow-md);
}

.stc-add-to-cart:active {
    background-color: var(--stc-primary-active);
    transform: translateY(1px);
}

/* ------------------- */
/* Template Selection  */
/* ------------------ */
.stc-template-grid {
    position: absolute;
    inset: 0;
    background-color: var(--stc-bg-dark);
    z-index: 5;
    padding: var(--stc-space-6);
    overflow-y: auto;
}

.stc-template-grid-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--stc-space-5);
    max-width: 1200px;
    margin: 0 auto;
}

.stc-template-item {
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-lg);
    overflow: hidden;
    background-color: var(--stc-bg-card);
    transition: all var(--stc-transition-normal);
    box-shadow: var(--stc-shadow-sm);
    cursor: pointer;
}

.stc-template-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--stc-shadow-md);
    border-color: var(--stc-primary);
}

.stc-template-preview {
    aspect-ratio: 63/88;
    background-color: var(--stc-bg-lighter);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.stc-template-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.stc-template-info {
    padding: var(--stc-space-4);
    text-align: center;
}

.stc-template-title {
    font-weight: 600;
    margin-bottom: var(--stc-space-3);
    color: var(--stc-text-primary);
}

.stc-template-select {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    background-color: var(--stc-primary);
    color: var(--stc-white);
    border: none;
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: background-color var(--stc-transition-fast);
}

.stc-template-select:hover {
    background-color: var(--stc-primary-hover);
}

/* ------------------- */
/* Signature Modal     */
/* ------------------ */
.stc-signature-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.stc-signature-modal.is-active {
    display: flex;
}

.stc-signature-modal-content {
    width: 95%;
    max-width: 600px;
    background-color: var(--stc-bg-dark);
    border-radius: var(--stc-radius-lg);
    box-shadow: var(--stc-shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    opacity: 0;
    transform: translateY(20px);
    animation: modal-in 0.3s forwards;
}

@keyframes modal-in {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stc-signature-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stc-space-4) var(--stc-space-5);
    border-bottom: 1px solid var(--stc-border-light);
}

.stc-signature-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--stc-text-primary);
    font-weight: 600;
}

.stc-signature-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--stc-text-secondary);
    transition: color var(--stc-transition-fast);
}

.stc-signature-modal-close:hover {
    color: var(--stc-text-primary);
}

.stc-signature-modal-body {
    padding: var(--stc-space-5);
    overflow-y: auto;
    flex: 1;
}

/* Signature Tabs */
.stc-signature-tabs {
    display: flex;
    border-bottom: 1px solid var(--stc-border-light);
    margin-bottom: var(--stc-space-5);
}

.stc-signature-tab {
    padding: var(--stc-space-3) var(--stc-space-5);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--stc-text-secondary);
    cursor: pointer;
    transition: all var(--stc-transition-fast);
}

.stc-signature-tab.active {
    color: var(--stc-primary);
    border-bottom-color: var(--stc-primary);
    background-color: transparent;
}

/* Fix for selected tab color */
.stc-signature-tab:not(.active) {
    background-color: transparent;
}

.stc-signature-tab:hover:not(.active) {
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-lighter);
}

.stc-signature-panel {
    display: none;
}

.stc-signature-panel.active {
    display: block;
}

/* Text signature panel */
.stc-signature-form {
    margin-bottom: var(--stc-space-5);
}

.stc-signature-input-group {
    margin-bottom: var(--stc-space-4);
}

.stc-signature-input-group label {
    display: block;
    margin-bottom: var(--stc-space-2);
    font-weight: 500;
    color: var(--stc-text-primary);
}

.stc-signature-text-input {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-card);
    transition: border-color var(--stc-transition-fast), box-shadow var(--stc-transition-fast);
}

.stc-signature-text-input:focus {
    border-color: var(--stc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-signature-font-select {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
    cursor: pointer;
}

.stc-signature-preview {
    position: relative;
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    background-color: var(--stc-bg-lighter);
}

/* Fix the preview text positioning */
.stc-signature-preview-text {
    position: absolute;
    top: var(--stc-space-2);
    left: var(--stc-space-3);
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin: 0;
    padding: 0;
}

.stc-signature-preview-container {
    background-color: var(--stc-white);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--stc-space-5);
    border: 1px dashed var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    overflow: hidden;
    line-height: 1.2;
    margin-top: var(--stc-space-4);
    color: #000;
    /* Default to black text for signature preview */
}

/* Drawing signature panel */
.stc-signature-draw-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--stc-space-4);
}

.stc-signature-clear-btn {
    padding: var(--stc-space-2) var(--stc-space-3);
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    color: var(--stc-text-primary);
    cursor: pointer;
    transition: all var(--stc-transition-fast);
}

.stc-signature-clear-btn:hover {
    background-color: var(--stc-bg-elevated);
    border-color: var(--stc-border-strong);
}

.stc-signature-line-width {
    display: flex;
    align-items: center;
    gap: var(--stc-space-3);
}

.stc-signature-canvas-container {
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    background-color: var(--stc-white);
    position: relative;
    height: 200px;
    overflow: hidden;
}

#signature-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.stc-signature-canvas-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #999;
    /* Keep visible on white background */
    font-style: italic;
    pointer-events: none;
}

/* Modal footer */
.stc-signature-modal-footer {
    padding: var(--stc-space-4) var(--stc-space-5);
    border-top: 1px solid var(--stc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--stc-space-3);
}

.stc-signature-cancel-btn,
.stc-signature-apply-btn {
    padding: var(--stc-space-2) var(--stc-space-4);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
}

.stc-signature-cancel-btn {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-medium);
    color: var(--stc-text-secondary);
}

.stc-signature-cancel-btn:hover {
    background-color: var(--stc-bg-elevated);
    color: var(--stc-text-primary);
}

.stc-signature-apply-btn {
    background-color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
    color: var(--stc-white);
}

.stc-signature-apply-btn:hover {
    background-color: var(--stc-primary-hover);
    border-color: var(--stc-primary-hover);
}

/* ------------------- */
/* Slab Field          */
/* ------------------- */
.stc-slab-field {
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    box-shadow: var(--stc-shadow-sm);
}

.stc-slab-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--stc-space-3);
}

.stc-slab-summary {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    margin-bottom: var(--stc-space-3);
    min-height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--stc-transition-fast);
}

.stc-slab-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.stc-slab-info {
    text-align: center;
    width: 100%;
}

.stc-slab-name {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: var(--stc-space-1);
    color: var(--stc-text-primary);
}

.stc-slab-company {
    font-weight: 500;
    margin-bottom: var(--stc-space-2);
    color: var(--stc-text-primary);
}

.stc-slab-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin-top: var(--stc-space-2);
}

.stc-slab-serial {
    font-weight: 500;
}

.stc-slab-grade {
    font-weight: 500;
}

.stc-slab-grade-value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--stc-primary);
    margin-left: var(--stc-space-2);
}

.stc-slab-placeholder {
    color: var(--stc-text-secondary);
    font-style: italic;
    text-align: center;
}

.stc-slab-configure-btn {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-4);
    background-color: var(--stc-bg-dark);
    color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    margin-bottom: var(--stc-space-3);
}

.stc-slab-configure-btn:hover:not(:disabled) {
    background-color: var(--stc-primary-light);
}

.stc-slab-configure-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--stc-gray-300);
    color: var(--stc-text-secondary);
}

/* ------------------- */
/* Slab Preview Container          
/* ------------------- */
.stc-canvas-main-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: fit-content;
    height: auto;
    margin: 0 auto;
    position: relative;
    will-change: transform;
    transform-origin: center center;
    font-size: 80px;
}

.stc-slab-preview-container {
    width: 100%;
    transition: all 0.3s ease;
    z-index: 10;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.stc-slab-preview-content {
    background-color: var(--stc-white);
    border: 2px solid var(--stc-primary);
    border-radius: var(--stc-radius-md);
    padding: 12px;
    box-shadow: var(--stc-shadow-md);
    width: 100%;
    /* Match the width */
    max-width: 3099px;
    /* Match canvas width (63mm at 300dpi) */
}

.stc-slab-preview-header {
    border-bottom: 1px solid var(--stc-border-light);
    margin-bottom: 10px;
    padding-bottom: 5px;
    text-align: center;
}

.stc-slab-preview-side-indicator {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--stc-primary);
}

.stc-slab-preview-body {
    color: #000;
    /* Black text for contrast on white background */
}

.stc-slab-preview-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.stc-slab-preview-field {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Back side specific styles */
.stc-slab-back-preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
}

.stc-slab-back-preview-left {
    display: flex;
    flex-direction: column;
}

.stc-slab-back-preview-text {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    margin-bottom: 4px;
}

.stc-slab-back-preview-middle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stc-slab-back-preview-middle img,
.stc-slab-back-preview-right img {
    max-width: 100%;
    max-height: 80px;
    object-fit: contain;
    height: 80px;
}

.stc-slab-back-preview-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stc-canvas-wrapper {
    background-color: var(--stc-bg-card);
    box-shadow: var(--stc-shadow-lg);
    border-radius: var(--stc-radius-lg);
    padding: var(--stc-space-5);
    box-sizing: content-box;
    z-index: 5;
}

/* Slab Barcode Styles */
.stc-slab-preview-barcode {
    margin-top: 8px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Better spacing within the slab */
.stc-slab-preview-body {
    padding: 0 5px;
}

/* Card Number Styling */
.stc-card-number-field {
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    box-shadow: var(--stc-shadow-sm);
}

.stc-card-number-preview {
    background-color: var(--stc-bg-lighter);
    padding: var(--stc-space-3);
    border-radius: var(--stc-radius-md);
    margin-bottom: var(--stc-space-4);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--stc-space-2);
}

.stc-card-number-label {
    color: var(--stc-text-secondary);
    font-size: 0.875rem;
}

.stc-card-number-formatted {
    font-size: 1.25rem;
    font-weight: bold;
}

.stc-card-number-inputs {
    display: flex;
    gap: var(--stc-space-4);
    margin-bottom: var(--stc-space-4);
}

.stc-card-number-input-group {
    flex: 1;
}

.stc-card-number-input-group label {
    display: block;
    margin-bottom: var(--stc-space-2);
    color: var(--stc-text-secondary);
    font-size: 0.875rem;
}

.stc-card-number-input {
    width: 100%;
    padding: var(--stc-space-2);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .stc-slab-preview-container {
        max-width: 95%;
    }

    .stc-slab-preview-body {
        font-size: 0.8rem;
    }

    .stc-slab-back-preview-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

/* ------------------- */
/* Slab Modal          */
/* ------------------- */
.stc-slab-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.7);
    overflow-y: auto;
}

.stc-slab-modal.is-active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stc-slab-modal-content {
    background-color: var(--stc-bg-dark);
    border-radius: var(--stc-radius-lg);
    box-shadow: var(--stc-shadow-lg);
    width: 90%;
    max-width: 900px;
    padding: 0;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.stc-slab-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--stc-border-light);
    background-color: var(--stc-bg-darker);
}

.stc-slab-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--stc-text-primary);
}

.stc-slab-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--stc-text-secondary);
}

.stc-slab-modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.stc-slab-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--stc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background-color: var(--stc-bg-darker);
}

/* Tab System */
.stc-slab-tabs {
    display: flex;
    border-bottom: 1px solid var(--stc-border-light);
    background-color: var(--stc-bg-lighter);
}

.stc-slab-tab {
    padding: 10px 20px;
    border: none;
    background: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-weight: 500;
    color: var(--stc-text-secondary);
    transition: all 0.2s;
}

.stc-slab-tab.active {
    border-bottom-color: var(--stc-primary);
    color: var(--stc-primary);
    background-color: var(--stc-bg-dark);
}

.stc-slab-tab:hover:not(.active) {
    background-color: var(--stc-bg-elevated);
    color: var(--stc-text-primary);
}

/* Panels */
.stc-slab-panel {
    display: none;
}

.stc-slab-panel.active {
    display: block;
}

/* Form Elements */
.stc-slab-form {
    margin-bottom: 20px;
}

.stc-slab-input-group {
    margin-bottom: 15px;
}

.stc-slab-input-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--stc-text-primary);
    font-size: 0.9rem;
}

.stc-slab-input,
.stc-slab-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--stc-border-medium);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--stc-bg-card);
    color: var(--stc-text-primary);
}

.stc-slab-select {
    height: 36px;
}

.stc-slab-row {
    display: flex;
    gap: 15px;
}

.stc-slab-input-half {
    flex: 1;
}

/* Back Side Layout */
.stc-slab-back-layout {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.stc-slab-back-section {
    border: 1px solid var(--stc-border-light);
    padding: 15px;
    border-radius: 5px;
    background-color: var(--stc-bg-lighter);
}

.stc-slab-back-section h4 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--stc-border-light);
    font-size: 1rem;
    color: var(--stc-text-primary);
}

.stc-slab-hint {
    font-size: 0.8rem;
    color: var(--stc-text-secondary);
    margin-top: 5px;
}

/* Image Upload */
.stc-slab-image-upload {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stc-slab-image-preview {
    width: 100%;
    height: 150px;
    border: 2px dashed var(--stc-border-medium);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s;
    background-color: var(--stc-bg-card);
}

.stc-slab-image-preview:hover,
.stc-slab-image-preview.dragover {
    border-color: var(--stc-primary);
    background-color: var(--stc-primary-light);
}

.stc-slab-image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.stc-slab-image-placeholder {
    color: var(--stc-text-secondary);
    text-align: center;
    padding: 20px;
}

.stc-slab-image-actions {
    display: flex;
    gap: 10px;
}

/* QR Code */
.stc-slab-qr-preview {
    margin-top: 15px;
}

.stc-slab-qr-image {
    width: 128px;
    height: 128px;
    border: 1px solid var(--stc-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background-color: var(--stc-white);
}

.stc-slab-qr-image img {
    max-width: 100%;
    max-height: 100%;
}

.stc-slab-qr-placeholder {
    color: var(--stc-text-secondary);
    font-size: 0.8rem;
    text-align: center;
}

/* Front Preview Styling */
.stc-slab-preview {
    margin-top: 20px;
}

.stc-slab-preview-text {
    margin-bottom: 10px;
    font-weight: 500;
    color: var(--stc-text-primary);
}

.stc-slab-preview-container {
    border: 1px solid var(--stc-border-medium);
    border-radius: 5px;
    padding: 20px;
    background-color: var(--stc-bg-lighter);
    margin: auto;
}

.stc-slab-preview-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.stc-slab-preview-row:last-child {
    margin-bottom: 0;
}

.stc-slab-preview-name,
.stc-slab-preview-company {
    font-weight: bold;
    color: var(--stc-text-primary);
}

.stc-slab-preview-grade {
    color: var(--stc-primary);
    font-weight: bold;
}

.stc-slab-preview-grade-value {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--stc-primary);
}

.stc-barcode-container {
    display: flex;
    margin-top: 10px;
    height: 30px;
    align-items: flex-end;
}

.stc-barcode-line {
    height: 100%;
    width: 1px;
    background-color: black;
    margin-right: 1px;
}

/* Back Preview Styling */
.stc-slab-back-preview {
    margin-top: 20px;
}

.stc-slab-back-preview-content {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 15px;
    background-color: #fff;
    border: 1px solid var(--stc-border-light);
    border-radius: 3px;
}

.stc-slab-back-image-placeholder {
    color: var(--stc-text-secondary);
    font-size: 0.8rem;
    text-align: center;
}

.stc-slab-back-preview-right {
    display: flex;
    align-items: center;
    justify-content: center;
}

.stc-slab-back-preview-qr {
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--stc-white);
}

.stc-slab-back-preview-qr img {
    max-width: 100%;
    max-height: 100%;
}

.stc-slab-back-preview-barcode {
    margin-top: auto;
}

.stc-slab-back-preview-static {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-light);
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 15px;
    text-align: center;
}

.stc-slab-static-text {
    margin-bottom: 15px;
}

.stc-slab-static-text p {
    margin: 5px 0;
    font-weight: bold;
    font-size: 14px;
    color: var(--stc-text-primary);
}

.stc-slab-static-barcode {
    margin: 10px auto;
    width: 80%;
    max-width: 200px;
}

.stc-slab-static-logo {
    margin: 15px auto;
    width: 120px;
    height: 120px;
}

.stc-slab-static-logo img {
    max-width: 100%;
    height: auto;
}

/* QR toggle styling */
.stc-slab-qr-toggle {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.stc-toggle-label {
    margin-left: 10px;
    font-weight: normal;
}

/* Price breakdown section */
.stc-slab-price-breakdown {
    margin-top: 15px;
    padding: 10px;
    background: var(--stc-bg-lighter);
    border-radius: 4px;
    font-size: 14px;
}

.stc-slab-total-price {
    margin-top: 5px;
    font-weight: bold;
    font-size: 16px;
    color: var(--stc-text-primary);
}

.stc-qr-price {
    font-size: 12px;
    color: var(--stc-primary);
    margin-left: 5px;
}

/* Updated back preview styling */
#preview-back-image img {
    object-fit: contain;
}

/* Make sure we're showing the QR preview properly */
.stc-slab-back-preview-qr {
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stc-slab-back-preview-qr img {
    max-width: 100%;
    max-height: 100px;
}

/* Disabled state for the slab content */
.stc-slab-disabled {
    opacity: 0.6;
    pointer-events: none;
}

/* Highlight price display */
.stc-price {
    color: var(--stc-primary);
    font-weight: bold;
}

/* Buttons */
.stc-slab-btn,
.stc-slab-cancel-btn,
.stc-slab-apply-btn {
    padding: 8px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.stc-slab-btn {
    background-color: var(--stc-bg-lighter);
    color: var(--stc-text-primary);
}

.stc-slab-btn:hover {
    background-color: var(--stc-bg-elevated);
}

.stc-slab-cancel-btn {
    background-color: var(--stc-bg-lighter);
    color: var(--stc-text-primary);
}

.stc-slab-cancel-btn:hover {
    background-color: var(--stc-bg-elevated);
}

.stc-slab-apply-btn {
    background-color: var(--stc-primary);
    color: var(--stc-white);
}

.stc-slab-apply-btn:hover {
    background-color: var(--stc-primary-hover);
}

.stc-slab-apply-btn:disabled {
    background-color: var(--stc-gray-300);
    cursor: not-allowed;
}

/* Summary Panel in StepHandler */
.stc-slab-field {
    margin-bottom: 20px;
}

.stc-slab-summary {
    margin: 15px 0;
    padding: 15px;
    border: 1px solid var(--stc-border-light);
    border-radius: 5px;
    background-color: var(--stc-bg-lighter);
}

.stc-slab-summary.stc-slab-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.stc-slab-front-back {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.stc-slab-info {
    background-color: var(--stc-bg-card);
    padding: 12px;
    border: 1px solid var(--stc-border-light);
    border-radius: 4px;
}

.stc-slab-side-label {
    font-weight: bold;
    color: var(--stc-primary);
    border-bottom: 1px solid var(--stc-border-light);
    padding-bottom: 5px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.stc-slab-name,
.stc-slab-company {
    margin-bottom: 5px;
    font-weight: 500;
    color: var(--stc-text-primary);
}

.stc-slab-details {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.stc-slab-back-summary>div {
    margin-bottom: 5px;
}

.stc-slab-placeholder {
    color: var(--stc-text-secondary);
    text-align: center;
    padding: 20px;
}

.stc-slab-configure-btn {
    width: 100%;
    padding: 10px;
    background-color: var(--stc-primary);
    color: var(--stc-white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

.stc-slab-configure-btn:hover {
    background-color: var(--stc-primary-hover);
}

.stc-slab-configure-btn:disabled {
    background-color: var(--stc-gray-300);
    cursor: not-allowed;
}

/* Switch Toggle */
.stc-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.stc-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.stc-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--stc-gray-300);
    transition: .4s;
    border-radius: 20px;
}

.stc-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: var(--stc-white);
    transition: .4s;
    border-radius: 50%;
}

.stc-switch input:checked+.stc-slider {
    background-color: var(--stc-primary);
}

.stc-switch input:checked+.stc-slider:before {
    transform: translateX(20px);
}

/* ------------------- */
/* QR Code Field       */
/* ------------------ */
.stc-qrcode-field {
    background-color: var(--stc-bg-card);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    box-shadow: var(--stc-shadow-sm);
}

.stc-qrcode-header {
    display: flex;
    align-items: center;
    margin-bottom: var(--stc-space-3);
}

.stc-qrcode-summary {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    margin-bottom: var(--stc-space-3);
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--stc-transition-fast);
}

.stc-qrcode-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.stc-qrcode-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.stc-qrcode-preview {
    margin-bottom: var(--stc-space-3);
}

.stc-qrcode-image-preview {
    width: 100%;
    display: flex;
    justify-content: center;
}

.stc-qrcode-content {
    text-align: center;
    width: 100%;
    word-break: break-all;
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin-top: var(--stc-space-2);
}

.stc-qrcode-text {
    max-height: 3em;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.stc-qrcode-placeholder {
    color: var(--stc-text-secondary);
    font-style: italic;
    text-align: center;
}

.stc-qrcode-configure-btn {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-4);
    background-color: var(--stc-bg-dark);
    color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    margin-bottom: var(--stc-space-3);
}

.stc-qrcode-configure-btn:hover:not(:disabled) {
    background-color: var(--stc-primary-light);
}

.stc-qrcode-configure-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    border-color: var(--stc-gray-300);
    color: var(--stc-text-secondary);
}

/* QR Code Grid (simplified visualization) */
.stc-qrcode-grid {
    --qrcode-color: #000000;
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    grid-template-rows: repeat(21, 1fr);
    gap: 1px;
    aspect-ratio: 1;
    padding: 10px;
    background-color: var(--stc-white);
    border: 1px solid var(--stc-border-light);
    margin: 0 auto;
    width: 100%;
    max-width: 120px;
}

.stc-qrcode-cell {
    width: 100%;
    aspect-ratio: 1;
    background-color: transparent;
}

.stc-qrcode-cell.black {
    background-color: var(--qrcode-color, #000);
}

/* ------------------- */
/* Notification Popup Styles      */
/* ------------------ */

.stc-notification-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(3px);
}

.stc-notification-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

.stc-notification-popup {
    width: 90%;
    max-width: 450px;
    background-color: var(--stc-bg-dark);
    border-radius: var(--stc-radius-lg);
    box-shadow: var(--stc-shadow-lg);
    border: 1px solid var(--stc-border-medium);
    padding: var(--stc-space-5);
    transform: translateY(20px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.stc-notification-overlay.is-active .stc-notification-popup {
    transform: translateY(0);
    opacity: 1;
}

.stc-notification-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--stc-text-primary);
    margin-bottom: var(--stc-space-3);
    text-align: center;
}

.stc-notification-message {
    font-size: 1rem;
    color: var(--stc-text-secondary);
    margin-bottom: var(--stc-space-4);
    text-align: center;
    line-height: 1.5;
}

.stc-notification-actions {
    display: flex;
    justify-content: center;
    gap: var(--stc-space-3);
    margin-top: var(--stc-space-4);
}

.stc-notification-button {
    padding: var(--stc-space-2) var(--stc-space-4);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
    font-size: 0.9375rem;
    min-width: 120px;
    text-align: center;
}

.stc-notification-primary {
    background-color: var(--stc-primary);
    color: var(--stc-white);
    border: 1px solid var(--stc-primary);
}

.stc-notification-primary:hover {
    background-color: var(--stc-primary-hover);
    border-color: var(--stc-primary-hover);
}

.stc-notification-secondary {
    background-color: var(--stc-bg-lighter);
    color: var(--stc-text-secondary);
    border: 1px solid var(--stc-border-medium);
}

.stc-notification-secondary:hover {
    background-color: var(--stc-bg-elevated);
    color: var(--stc-text-primary);
}

/* Back Side Notification Specific Styles */
.stc-back-notification-popup {
    border: 1px solid var(--stc-primary);
}

.stc-back-notification-icon {
    display: flex;
    justify-content: center;
    margin-bottom: var(--stc-space-4);
}

.stc-back-notification-icon svg {
    width: 48px;
    height: 48px;
    color: var(--stc-primary);
}

.stc-back-notification-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--stc-space-2);
}

.stc-back-notification-primary svg {
    width: 16px;
    height: 16px;
}

/* ------------------- */
/* Info Icon Styles      */
/* ------------------ */

.stc-step-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #0d6efd;
    color: white;
    font-size: 11px;
    font-weight: bold;
    margin-left: 8px;
    cursor: help;
    transition: all 0.2s ease;
    user-select: none;
}

.stc-step-info-icon:hover,
.stc-info-icon-active {
    background-color: #0b5ed7;
    transform: scale(1.05);
}

/* Info Popup Styles */
.stc-info-popup {
    position: absolute;
    z-index: 10000;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.15);
    padding: 16px;
    max-width: 300px;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.stc-info-popup[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

/* Popup Content Styling */
.stc-info-popup-content {
    display: flex;
    flex-direction: column;
}

.stc-info-popup-image {
    margin-bottom: 12px;
}

.stc-info-popup-image img {
    max-width: 100%;
    border-radius: 4px;
    display: block;
}

.stc-info-popup-text h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.stc-info-popup-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

/* ------------------- */
/* Background removal toggle       */
/* ------------------ */

.stc-background-removal-toggle {
    margin-top: 15px;
    padding-top: 12px;
    border-top: 1px solid #eee;
}

.stc-toggle-header {
    display: flex;
    align-items: center;
}

.stc-toggle-label {
    margin-left: 10px;
    font-weight: 500;
}

.stc-toggle-description {
    font-size: 13px;
    color: #666;
    margin-top: 5px;
    margin-left: 45px;
    line-height: 1.4;
}

/* Image processing visual indicator */
.stc-image-will-be-processed {
    opacity: 0.85;
    position: relative;
}

.stc-image-will-be-processed::after {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(45deg,
            rgba(13, 110, 253, 0.1),
            rgba(13, 110, 253, 0.1) 10px,
            rgba(13, 110, 253, 0.2) 10px,
            rgba(13, 110, 253, 0.2) 20px);
    pointer-events: none;
    border: 2px dashed rgba(13, 110, 253, 0.4);
}

/* Notification popup styles */
.stc-background-removal-info {
    text-align: center;
}

.stc-background-removal-examples {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.stc-example {
    flex: 1;
    max-width: 40%;
}

.stc-example img {
    width: 100%;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.stc-example span {
    display: block;
    margin-top: 5px;
    font-size: 13px;
}

.stc-example-arrow {
    font-size: 24px;
    color: #666;
}

/* ------------------- */
/* QR Code Modal       */
/* ------------------ */
.stc-qrcode-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1001;
    background-color: rgba(0, 0, 0, 0.7);
    overflow: auto;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(3px);
}

.stc-qrcode-modal.is-active {
    display: flex;
}

.stc-qrcode-modal-content {
    width: 95%;
    max-width: 600px;
    background-color: var(--stc-bg-dark);
    border-radius: var(--stc-radius-lg);
    box-shadow: var(--stc-shadow-lg);
    display: flex;
    flex-direction: column;
    max-height: 90vh;
    opacity: 0;
    transform: translateY(20px);
    animation: modal-in 0.3s forwards;
}

.stc-qrcode-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--stc-space-4) var(--stc-space-5);
    border-bottom: 1px solid var(--stc-border-light);
    background-color: var(--stc-bg-darker);
}

.stc-qrcode-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--stc-text-primary);
    font-weight: 600;
}

.stc-qrcode-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--stc-text-secondary);
    transition: color var(--stc-transition-fast);
}

.stc-qrcode-modal-close:hover {
    color: var(--stc-text-primary);
}

.stc-qrcode-modal-body {
    padding: var(--stc-space-5);
    overflow-y: auto;
    flex: 1;
}

.stc-qrcode-form {
    margin-bottom: var(--stc-space-5);
}

.stc-qrcode-input-group {
    margin-bottom: var(--stc-space-4);
}

.stc-qrcode-input-group:last-child {
    margin-bottom: 0;
}

.stc-qrcode-row {
    display: flex;
    gap: var(--stc-space-4);
}

.stc-qrcode-input-half {
    flex: 1;
}

.stc-qrcode-helper {
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin-top: var(--stc-space-1);
}

.stc-qrcode-input-group label {
    display: block;
    margin-bottom: var(--stc-space-2);
    font-weight: 500;
    color: var(--stc-text-primary);
}

.stc-qrcode-textarea,
.stc-qrcode-select {
    width: 100%;
    padding: var(--stc-space-2) var(--stc-space-3);
    border: 1px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    font-size: 0.9375rem;
    color: var(--stc-text-primary);
    background-color: var(--stc-bg-card);
    transition: border-color var(--stc-transition-fast), box-shadow var(--stc-transition-fast);
    resize: vertical;
}

.stc-qrcode-textarea:focus,
.stc-qrcode-select:focus {
    border-color: var(--stc-primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 129, 38, 0.25);
}

.stc-qrcode-color {
    width: 100%;
    height: 40px;
    padding: 0;
    border: 2px solid var(--stc-border-medium);
    border-radius: var(--stc-radius-md);
    cursor: pointer;
    background-color: transparent;
    transition: border-color var(--stc-transition-fast);
    overflow: hidden;
}

.stc-qrcode-color::-webkit-color-swatch-wrapper {
    padding: 0;
}

.stc-qrcode-color::-webkit-color-swatch {
    border: none;
}

.stc-qrcode-color:focus {
    border-color: var(--stc-primary);
    outline: none;
}

/* QR Code Preview Section */
.stc-qrcode-preview {
    position: relative;
    border: 1px solid var(--stc-border-light);
    border-radius: var(--stc-radius-md);
    padding: var(--stc-space-4);
    background-color: var(--stc-bg-lighter);
}

.stc-qrcode-preview-text {
    position: absolute;
    top: var(--stc-space-2);
    left: var(--stc-space-3);
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    margin: 0;
    padding: 0;
}

.stc-qrcode-preview-container {
    margin-top: var(--stc-space-4);
    border: 1px solid var(--stc-border-light);
    background-color: var(--stc-bg-card);
    padding: var(--stc-space-3);
    border-radius: var(--stc-radius-md);
}

.stc-qrcode-preview-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--stc-space-3);
}

.stc-qrcode-preview-image {
    margin: 0 auto;
    display: flex;
    justify-content: center;
    background-color: var(--stc-white);
    padding: 10px;
    border-radius: var(--stc-radius-sm);
}

/* QR Code Size Options */
.stc-qrcode-size-small .stc-qrcode-grid {
    max-width: 100px;
}

.stc-qrcode-size-medium .stc-qrcode-grid {
    max-width: 150px;
}

.stc-qrcode-size-large .stc-qrcode-grid {
    max-width: 200px;
}

#qrcode-preview-text {
    text-align: center;
    font-size: 0.875rem;
    color: var(--stc-text-secondary);
    max-width: 100%;
    word-break: break-all;
}

/* Modal footer */
.stc-qrcode-modal-footer {
    padding: var(--stc-space-4) var(--stc-space-5);
    border-top: 1px solid var(--stc-border-light);
    display: flex;
    justify-content: flex-end;
    gap: var(--stc-space-3);
    background-color: var(--stc-bg-darker);
}

.stc-qrcode-cancel-btn,
.stc-qrcode-apply-btn {
    padding: var(--stc-space-2) var(--stc-space-4);
    border-radius: var(--stc-radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--stc-transition-fast);
}

.stc-qrcode-cancel-btn {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-medium);
    color: var(--stc-text-secondary);
}

.stc-qrcode-cancel-btn:hover {
    background-color: var(--stc-bg-elevated);
    color: var(--stc-text-primary);
}

.stc-qrcode-apply-btn {
    background-color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
    color: var(--stc-white);
}

.stc-qrcode-apply-btn:hover:not(:disabled) {
    background-color: var(--stc-primary-hover);
    border-color: var(--stc-primary-hover);
}

.stc-qrcode-apply-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Price display styles */
.stc-price-summary {
    background-color: var(--stc-bg-lighter);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: var(--stc-shadow-sm);
}

.stc-price-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
    color: var(--stc-text-secondary);
    border-bottom: 1px solid var(--stc-border-light);
}

.stc-price-row:last-child {
    border-bottom: none;
}

.stc-price-total {
    font-weight: 600;
    color: var(--stc-text-primary);
    font-size: 16px;
    margin-top: 5px;
    padding-top: 8px;
    border-top: 2px solid var(--stc-border-medium) !important;
    border-bottom: none !important;
}

.stc-price-breakdown-toggle {
    font-size: 12px;
    color: var(--stc-primary);
    text-align: center;
    margin-top: 5px;
    cursor: pointer;
    padding: 4px;
}

.stc-price-breakdown-toggle:hover {
    text-decoration: underline;
}

.stc-price-breakdown-details {
    display: none;
    padding: 10px;
    background-color: var(--stc-bg-darker);
    border-radius: 4px;
    margin-top: 10px;
    font-size: 13px;
}

.stc-price-breakdown-details.is-visible {
    display: block;
}

.stc-price-breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
    color: var(--stc-text-secondary);
}

.stc-price-breakdown-side {
    padding-left: 15px;
    font-size: 12px;
    color: var(--stc-text-muted);
}

.stc-price-front-badge,
.stc-price-back-badge {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    margin-left: 5px;
    font-weight: 600;
}

.stc-price-front-badge {
    background-color: rgba(216, 129, 38, 0.2);
    color: var(--stc-primary);
    border: 1px solid var(--stc-primary);
}

.stc-price-back-badge {
    background-color: rgba(216, 129, 38, 0.1);
    color: var(--stc-primary-hover);
    border: 1px solid var(--stc-primary-hover);
}

/* Animation for price changes */
@keyframes highlight-price {
    0% {
        background-color: transparent;
    }

    20% {
        background-color: rgba(216, 129, 38, 0.2);
    }

    100% {
        background-color: transparent;
    }
}

.stc-price-highlight {
    animation: highlight-price 1.5s ease;
}

/* Enhanced Step Indicators */
.stc-step {
    position: relative;
}

.stc-step-header {
    position: relative;
    transition: all 0.3s ease;
}

.stc-step-indicator {
    position: relative;
}

.stc-step.is-complete .stc-step-indicator:after {
    content: attr(data-price);
    position: absolute;
    right: -5px;
    top: -5px;
    background-color: var(--stc-success);
    color: var(--stc-white);
    font-size: 10px;
    border-radius: 10px;
    padding: 1px 4px;
    opacity: 0.9;
}

.stc-step.has-price .stc-step-title .stc-price {
    font-size: 12px;
    opacity: 0.8;
    margin-left: 5px;
}

/* Side Indicator */
.stc-side-indicator {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-left: 10px;
    font-weight: 500;
}

.stc-side-front {
    background-color: rgba(216, 129, 38, 0.2);
    color: var(--stc-primary);
}

.stc-side-back {
    background-color: rgba(216, 129, 38, 0.1);
    color: var(--stc-primary-hover);
}

/* Cross-side toggle button */
.stc-cross-side-toggle {
    background-color: var(--stc-bg-lighter);
    border: 1px solid var(--stc-border-medium);
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    cursor: pointer;
    margin-left: 10px;
    color: var(--stc-text-secondary);
    transition: all 0.2s ease;
}

.stc-cross-side-toggle:hover {
    background-color: var(--stc-primary-light);
    color: var(--stc-primary);
}

/* Step Panel Enhancements */
.stc-step-panel {
    border-top: 1px solid var(--stc-border-light);
    padding-top: 10px;
}

.stc-step.is-active .stc-step-panel {
    animation: fade-in 0.3s ease;
}

@keyframes fade-in {
    0% {
        opacity: 0;
        transform: translateY(-10px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Cross-Side Step Indicator */
.stc-cross-side-steps {
    display: flex;
    justify-content: space-between;
    background-color: var(--stc-bg-darker);
    border-radius: 4px;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid var(--stc-border-light);
}

.stc-cross-side-column {
    flex: 1;
}

.stc-cross-side-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    padding-bottom: 3px;
    border-bottom: 1px solid var(--stc-border-light);
    display: flex;
    align-items: center;
    color: var(--stc-text-primary);
}

.stc-cross-side-steps-list {
    font-size: 12px;
}

.stc-cross-side-step {
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    color: var(--stc-text-secondary);
}

.stc-cross-side-step-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 5px;
}

.stc-cross-side-step-status.completed {
    background-color: var(--stc-success);
}

.stc-cross-side-step-status.incomplete {
    background-color: var(--stc-gray-300);
}

/* ------------------- */
/* Responsive Design   */
/* ------------------ */
@media (max-width: 992px) {
    .stc-modal-container {
        flex-direction: column;
        overflow: auto;
    }

    .stc-steps {
        width: 100%;
        height: auto;
        max-height: 50vh;
        flex-shrink: 0;
        overflow: auto;
    }

    .stc-canvas-container {
        flex: 1;
        min-height: 400px;
    }

    .stc-template-grid-content {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 768px) {

    .stc-price-row{
        display: none;
    }

    .stc-price-row.stc-price-total{
        display: flex;
    }
    
    .stc-modal-header {
        flex-wrap: wrap;
        height: auto;
        padding: var(--stc-space-3);
    }

    .stc-side-switch {
        margin-top: var(--stc-space-2);
        order: 3;
        width: 100%;
    }

    .stc-side-switch button {
        flex: 1;
        text-align: center;
    }

    .stc-template-grid-content {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .stc-select-options {
        grid-template-columns: 1fr;
    }

    /* Adjust toggle field for small screens */
    .stc-toggle-field {
        flex-wrap: wrap;
    }

    /* Adjust signature modal for small screens */
    .stc-signature-tabs {
        flex-direction: row;
        overflow-x: auto;
        white-space: nowrap;
    }

    .stc-signature-tab {
        padding: var(--stc-space-2) var(--stc-space-3);
    }

    .stc-slab-row {
        flex-direction: column;
        gap: var(--stc-space-3);
    }

    .stc-slab-details {
        flex-direction: column;
        gap: var(--stc-space-2);
    }

    .stc-slab-back-layout {
        grid-template-columns: 1fr;
    }

    .stc-slab-back-preview-content {
        grid-template-columns: 1fr;
    }

    .stc-slab-front-back {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .stc-modal-header {
        padding: var(--stc-space-2);
    }

    .stc-modal-title {
        font-size: 1rem;
    }

    .stc-steps-list,
    .stc-steps-footer {
        padding: var(--stc-space-3);
    }

    .stc-step-header {
        padding: var(--stc-space-3);
    }

    .stc-step-panel {
        padding: var(--stc-space-3);
    }

    .stc-canvas-container {
        padding: var(--stc-space-3);
    }

    .stc-template-grid {
        padding: var(--stc-space-3);
    }

    .stc-template-grid-content {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: var(--stc-space-3);
    }

    .stc-template-info {
        padding: var(--stc-space-2);
    }

    .stc-template-title {
        font-size: 0.875rem;
        margin-bottom: var(--stc-space-2);
    }

    .stc-template-select {
        font-size: 0.75rem;
        padding: var(--stc-space-1) var(--stc-space-2);
    }

    .stc-shape-options {
        grid-template-columns: repeat(3, 1fr);
    }

    .stc-texture-options {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mobile adjustments for signature modal */
    .stc-signature-modal-content,
    .stc-qrcode-modal-content,
    .stc-slab-modal-content {
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

    .stc-signature-modal-body,
    .stc-qrcode-modal-body,
    .stc-slab-modal-body {
        padding: var(--stc-space-3);
    }

    .stc-signature-draw-controls {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--stc-space-3);
    }

    .stc-signature-line-width {
        width: 100%;
    }

    .stc-slab-preview-container {
        padding: var(--stc-space-2);
    }

    .stc-slab-preview-name,
    .stc-slab-preview-company,
    .stc-slab-preview-date,
    .stc-slab-preview-serial,
    .stc-slab-preview-grade {
        font-size: 0.75rem;
    }

    .stc-slab-preview-grade-value {
        font-size: 1rem;
    }

    .stc-control-row {
        flex-direction: column;
        gap: var(--stc-space-2);
    }

    .stc-advanced-options.is-expanded {
        max-height: 900px;
        /* Increase for mobile stacked layout */
    }

    .stc-notification-popup {
        padding: var(--stc-space-4);
        max-width: 95%;
    }

    .stc-notification-actions {
        flex-direction: column-reverse;
    }

    .stc-notification-button {
        width: 100%;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .stc-step-header::after {
        content: none;
        /* Remove toggle indicator on touch devices to save space */
    }

    .stc-step-header {
        padding-right: var(--stc-space-3);
        /* Reduce padding since no indicator */
    }

    .stc-select-option:hover {
        transform: none;
        /* Disable hover effects on touch devices */
        box-shadow: none;
    }

    .stc-canvas-wrapper {
        transform: scale(0.95);
        /* Slightly smaller canvas on touch devices */
    }

    .stc-signature-canvas-container {
        height: 180px;
        /* Slightly smaller signature canvas on mobile */
    }
}