/**
 * SliceCart — Public Styles
 *
 * Design system:
 *   Fonts  — Bebas Neue (titles), Outfit (body)
 *   Blue   — #00A8E8 (primary), #0077B6 (hover)
 *   Dark   — #0D1B2A
 *   Gray   — #6B7A8D (text), #A0AEC0 (muted)
 *   Light  — #F8FAFC (dropzone bg), #F0F4F8 (badges)
 *   Border — #CBD5E1
 */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Outfit:wght@400;500;600;700&display=swap');

/* ----------------------------------------------------------------
   Container
   ---------------------------------------------------------------- */
.sc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 50px 20px 40px;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #0D1B2A !important;
    background: #ffffff;
}

.sc-container *,
.sc-container *::before,
.sc-container *::after {
    box-sizing: border-box;
}

.sc-container h2,
.sc-container h3,
.sc-container h4,
.sc-container p,
.sc-container label,
.sc-container span,
.sc-container div,
.sc-container a:not(.sc-btn) {
    color: #0D1B2A !important;
}

.sc-container .sc-btn--primary,
.sc-container .sc-btn--primary span {
    color: #fff !important;
}

/* ----------------------------------------------------------------
   State management
   ---------------------------------------------------------------- */
.sc-state[hidden] {
    display: none !important;
}

/* ----------------------------------------------------------------
   Login notice
   ---------------------------------------------------------------- */
.sc-login-notice {
    text-align: center;
    padding: 40px 20px;
    background: #F8FAFC;
    border-radius: 12px;
    border: 1px solid #CBD5E1;
}

.sc-login-notice a {
    color: #00A8E8 !important;
    font-weight: 600;
}

/* ----------------------------------------------------------------
   Upload state — Title + Subtitle
   ---------------------------------------------------------------- */
.sc-upload-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 2em;
    color: #0D1B2A !important;
    text-align: center;
    letter-spacing: 1.5px;
    margin: 0 0 8px 0;
}

.sc-upload-subtitle {
    font-size: 14px;
    color: #6B7A8D !important;
    text-align: center;
    margin: 0 0 28px 0;
}

/* ----------------------------------------------------------------
   Dropzone
   ---------------------------------------------------------------- */
.sc-upload-zone {
    background: #F8FAFC;
    border: 2px dashed #CBD5E1;
    border-radius: 16px;
    padding: 60px 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sc-upload-zone:hover,
.sc-upload-zone.sc-upload-zone--dragover {
    border-color: #00A8E8 !important;
    background: #F0F8FF !important;
}

.sc-upload-zone__icon {
    color: #CBD5E1;
    margin-bottom: 16px;
}

.sc-upload-zone__icon svg {
    display: inline-block;
}

.sc-upload-zone__text {
    font-size: 16px;
    color: #6B7A8D !important;
    margin: 0 0 6px;
}

.sc-upload-zone__text strong {
    color: #00A8E8 !important;
}

.sc-upload-zone__or {
    font-size: 13px;
    color: #A0AEC0 !important;
    margin: 6px 0 16px;
}

.sc-upload-zone__button {
    display: inline-block;
    padding: 14px 32px;
    background: #00A8E8;
    color: #fff !important;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sc-upload-zone__button:hover {
    background: #0077B6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 168, 232, 0.25);
}

.sc-upload-zone__note {
    font-size: 12px;
    color: #A0AEC0 !important;
    margin-top: 16px;
}

/* ----------------------------------------------------------------
   Format badges
   ---------------------------------------------------------------- */
.sc-format-badges {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.sc-format-badge {
    background: #F0F4F8;
    border: 1px solid #E8EDF2;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 700;
    color: #6B7A8D !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sc-format-badge--recommended {
    background: rgba(0, 168, 232, 0.1);
    border-color: rgba(0, 168, 232, 0.3);
    color: #0077B6 !important;
}

/* ----------------------------------------------------------------
   Upload progress
   ---------------------------------------------------------------- */
.sc-upload-progress {
    margin-top: 24px;
    text-align: center;
}

.sc-progress-bar {
    height: 6px;
    background: #E8EDF2;
    border-radius: 3px;
    overflow: hidden;
}

.sc-progress-bar__fill {
    height: 100%;
    background: #00A8E8;
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0;
}

.sc-upload-progress__text {
    font-size: 13px;
    color: #6B7A8D !important;
    margin-top: 8px;
}

/* ----------------------------------------------------------------
   Configure layout
   ---------------------------------------------------------------- */
.sc-configure-layout {
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: 24px;
    align-items: start;
}

/* ----------------------------------------------------------------
   3D Preview
   ---------------------------------------------------------------- */
.sc-preview-panel {
    position: relative;
    background: #0D1B2A;
    border-radius: 12px;
    overflow: hidden;
    min-height: 400px;
}

#sc-preview-canvas {
    display: block;
    width: 100%;
    height: 400px;
}

.sc-preview-controls {
    position: absolute;
    bottom: 10px;
    right: 10px;
}

/* ----------------------------------------------------------------
   Settings panel
   ---------------------------------------------------------------- */
.sc-settings-panel {
    background: #fff;
    border: 1px solid #CBD5E1;
    border-radius: 12px;
    padding: 24px;
}

.sc-settings-panel__title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4em;
    letter-spacing: 1px;
    margin: 0 0 4px;
    color: #0D1B2A !important;
}

.sc-settings-panel__filename {
    font-size: 13px;
    color: #6B7A8D !important;
    margin: 0 0 16px;
    word-break: break-all;
}

/* ----------------------------------------------------------------
   Form fields
   ---------------------------------------------------------------- */
.sc-field {
    margin-bottom: 16px;
}

.sc-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0D1B2A !important;
    margin-bottom: 6px;
}

.sc-field__note {
    font-size: 12px;
    color: #A0AEC0 !important;
    margin-top: 4px;
    font-style: italic;
}

/* ----------------------------------------------------------------
   Label row + info tooltips
   ---------------------------------------------------------------- */
.sc-label-row {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.sc-field .sc-label-row label {
    margin-bottom: 0;
}

.sc-info {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Touch-friendly ~28px hit area, icon itself is smaller. */
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}

.sc-info__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #00A8E8;
    color: #fff !important;
    font-family: 'Outfit', sans-serif;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
}

.sc-info__bubble {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
    width: 240px;
    max-width: 70vw;
    padding: 10px 12px;
    background: #0D1B2A;
    color: #fff !important;
    font-family: 'Outfit', sans-serif;
    font-size: 12.5px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(13, 27, 42, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.sc-info__bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-bottom-color: #0D1B2A;
}

.sc-info--open .sc-info__bubble {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* Desktop pointers: also reveal on hover/focus. Touch devices rely on tap. */
@media (hover: hover) {
    .sc-info:hover .sc-info__bubble,
    .sc-info:focus-visible .sc-info__bubble {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
}

.sc-select,
.sc-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #CBD5E1;
    border-radius: 8px;
    font-size: 14px;
    /* Explicit line-height + height so the control isn't squeezed by a theme's
       fixed/short `select { height }` rule, which clipped the option label. */
    line-height: 1.4 !important;
    height: auto !important;
    min-height: 44px; /* touch-friendly, and guarantees room for the full label */
    font-family: 'Outfit', sans-serif;
    background: #fff;
    color: #0D1B2A;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Custom-styled selects: normalize native appearance, leave room for a chevron
   so long labels (e.g. "Black/Gold/Purple TriColor Shift") aren't crowded. */
.sc-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%236B7A8D' stroke-width='2' d='M1 1.5L6 6.5L11 1.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.sc-select:focus,
.sc-input:focus {
    border-color: #00A8E8 !important;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.15);
}

/* ----------------------------------------------------------------
   Checkbox
   ---------------------------------------------------------------- */
.sc-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

.sc-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00A8E8;
}

/* ----------------------------------------------------------------
   Range slider
   ---------------------------------------------------------------- */
.sc-range-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sc-range-group input[type="range"] {
    flex: 1;
    cursor: pointer;
    accent-color: #00A8E8;
}

.sc-range-group span {
    min-width: 40px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    color: #0D1B2A !important;
}

/* ----------------------------------------------------------------
   Color swatches
   ---------------------------------------------------------------- */
.sc-color-swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sc-color-swatch {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}

.sc-color-swatch:hover {
    transform: scale(1.15);
}

.sc-color-swatch.sc-color-swatch--selected {
    border-color: #00A8E8 !important;
    box-shadow: 0 0 0 3px rgba(0, 168, 232, 0.25);
}

.sc-color-swatch[title]::after {
    content: attr(title);
    position: absolute;
    bottom: -24px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    white-space: nowrap;
    color: #6B7A8D !important;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.sc-color-swatch:hover[title]::after {
    opacity: 1;
}

/* ----------------------------------------------------------------
   Buttons
   ---------------------------------------------------------------- */
.sc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: 'Outfit', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.sc-btn--primary {
    background: #00A8E8;
    color: #fff !important;
}

.sc-btn--primary:hover {
    background: #0077B6;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 168, 232, 0.25);
}

.sc-btn--primary:disabled {
    background: #A0AEC0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sc-btn--secondary {
    background: #fff;
    color: #0D1B2A !important;
    border: 1px solid #CBD5E1 !important;
}

.sc-btn--secondary:hover {
    background: #F8FAFC;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sc-btn--small {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 6px;
}

.sc-btn--full {
    width: 100%;
}

/* ----------------------------------------------------------------
   Queue status / spinner
   ---------------------------------------------------------------- */
.sc-queue-status {
    text-align: center;
    padding: 60px 20px;
}

.sc-queue-status h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.4em;
    letter-spacing: 1px;
    margin: 20px 0 12px;
    color: #0D1B2A !important;
}

.sc-queue-status p {
    margin: 4px 0;
    color: #6B7A8D !important;
}

.sc-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #E8EDF2;
    border-top-color: #00A8E8 !important;
    border-radius: 50%;
    animation: sc-spin 0.8s linear infinite;
    margin: 0 auto;
}

@keyframes sc-spin {
    to { transform: rotate(360deg); }
}

/* ----------------------------------------------------------------
   Price result
   ---------------------------------------------------------------- */
.sc-price-result {
    text-align: center;
    padding: 40px 20px;
}

.sc-price-result h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6em;
    letter-spacing: 1px;
    margin: 0 0 24px;
    color: #0D1B2A !important;
}

.sc-price-result__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.sc-price-result__item {
    background: #F8FAFC;
    border: 1px solid #E8EDF2;
    border-radius: 12px;
    padding: 20px 16px;
}

.sc-price-result__item--price {
    background: rgba(0, 168, 232, 0.06);
    border-color: rgba(0, 168, 232, 0.25);
}

.sc-price-result__label {
    display: block;
    font-size: 12px;
    color: #6B7A8D !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: 6px;
}

.sc-price-result__value {
    display: block;
    font-size: 24px;
    font-weight: 700;
    color: #0D1B2A !important;
}

.sc-price-result__item--price .sc-price-result__value {
    color: #00A8E8 !important;
}

/* ----------------------------------------------------------------
   Cart confirmation
   ---------------------------------------------------------------- */
.sc-cart-confirmation {
    text-align: center;
    padding: 40px 20px;
}

.sc-check-icon {
    color: #22C55E !important;
    margin-bottom: 12px;
}

.sc-cart-confirmation h3 {
    font-family: 'Bebas Neue', sans-serif;
    font-size: 1.6em;
    letter-spacing: 1px;
    color: #22C55E !important;
    margin: 0 0 8px;
}

.sc-cart-confirmation p {
    color: #6B7A8D !important;
    margin: 0 0 24px;
}

.sc-cart-confirmation__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* ----------------------------------------------------------------
   Error
   ---------------------------------------------------------------- */
.sc-error {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 10px;
    padding: 14px 18px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.sc-error[hidden] {
    display: none;
}

.sc-error p {
    margin: 0;
    color: #DC2626 !important;
    font-size: 14px;
    font-weight: 500;
}

/* ----------------------------------------------------------------
   Responsive
   ---------------------------------------------------------------- */
@media (max-width: 768px) {
    .sc-container {
        padding: 30px 16px;
    }

    .sc-upload-title {
        font-size: 1.6em;
    }

    .sc-upload-zone {
        padding: 40px 20px;
    }

    .sc-configure-layout {
        grid-template-columns: 1fr;
    }

    #sc-preview-canvas {
        height: 300px;
    }

    .sc-price-result__grid {
        grid-template-columns: 1fr;
    }

    .sc-cart-confirmation__actions {
        flex-direction: column;
    }
}
