/* ============================================================
   STORYWEAVER AI — kursy.dawidmazur.pl/narzedzia/storyweaver/
   Intelligent Instagram Story Generator for Photographers
   Dark theme, Sora font, cyan accent — consistent with Sun Calculator
   v2 — 3-step wizard layout (Upload, Edytuj, Eksport)
   ============================================================ */

/* --- Hide Publigo page elements --- */
.contenter > h1,
.contenter > .breadcrumbs {
    display: none !important;
}

/* --- Remove container constraints (only on StoryWeaver page) --- */
.contenter,
.contenter_tresci,
#primary,
.site-main,
.content-area,
.entry-content,
article {
    max-width: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
}

/* ============================================================
   HEADER BAR (mirrors .sc-header)
   ============================================================ */
.sw-header {
    background: #13111C;
    border-bottom: 1px solid rgba(6, 182, 212, 0.1);
    padding: 14px 20px;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.sw-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 14px;
}

.sw-header-icon {
    width: 28px;
    height: 28px;
    color: #06B6D4;
    flex-shrink: 0;
}

.sw-header-title {
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    margin: 0;
    line-height: 1.3;
    font-family: 'Sora', sans-serif;
    -webkit-text-fill-color: #fff;
    background: none;
}

.sw-header-desc {
    font-size: 12px;
    color: #565e78;
    margin: 2px 0 0;
    line-height: 1.5;
    font-family: 'Sora', sans-serif;
}

/* ============================================================
   STEP PROGRESS BAR (3 steps)
   ============================================================ */
.sw-steps {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    background: #0E0C15;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 16px 20px;
}

.sw-steps-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.sw-step {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 8px;
}

.sw-step:hover {
    background: rgba(255, 255, 255, 0.03);
}

.sw-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    font-family: 'Sora', sans-serif;
    border: 2px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.sw-step-label {
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Sora', sans-serif;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.sw-step-line {
    width: 32px;
    height: 2px;
    background: rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    transition: background 0.3s ease;
}

/* Active step */
.sw-step--active .sw-step-num {
    background: #06B6D4;
    border-color: #06B6D4;
    color: #0E0C15;
}

.sw-step--active .sw-step-label {
    color: #fff;
}

/* Completed step */
.sw-step--done .sw-step-num {
    background: rgba(6, 182, 212, 0.15);
    border-color: #06B6D4;
    color: #06B6D4;
}

.sw-step--done .sw-step-label {
    color: rgba(255, 255, 255, 0.6);
}

.sw-step-line--done {
    background: #06B6D4;
}

/* ============================================================
   MAIN WORKSPACE
   ============================================================ */
.sw-workspace {
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    min-height: calc(100vh - 64px - 60px - 130px);
    padding: 24px 20px 60px;
    background: #0E0C15;
}

.sw-workspace-inner {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================================
   STEP 1: UPLOAD
   ============================================================ */
.sw-upload-section {
    max-width: 800px;
    margin: 0 auto;
}

/* Drop zone */
.sw-dropzone {
    border: 2px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(19, 17, 28, 0.6);
    position: relative;
}

.sw-dropzone:hover,
.sw-dropzone--active {
    border-color: #06B6D4;
    background: rgba(6, 182, 212, 0.04);
}

.sw-dropzone--active {
    box-shadow: 0 0 40px rgba(6, 182, 212, 0.1);
}

.sw-dropzone-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    color: #06B6D4;
    opacity: 0.6;
}

.sw-dropzone-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 6px;
    font-family: 'Sora', sans-serif;
}

.sw-dropzone-hint {
    font-size: 13px;
    color: #565e78;
    margin: 0;
    font-family: 'Sora', sans-serif;
}

.sw-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

/* Thumbnails row */
.sw-thumbs {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.sw-thumb {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.08);
    transition: border-color 0.3s ease;
    flex-shrink: 0;
}

.sw-thumb:hover {
    border-color: rgba(6, 182, 212, 0.4);
}

.sw-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sw-thumb-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.sw-thumb:hover .sw-thumb-remove {
    opacity: 1;
}

.sw-thumb-add {
    width: 100px;
    height: 100px;
    border-radius: 10px;
    border: 2px dashed rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.3);
    font-size: 28px;
    transition: all 0.3s ease;
    background: transparent;
    flex-shrink: 0;
}

.sw-thumb-add:hover {
    border-color: #06B6D4;
    color: #06B6D4;
}

/* ============================================================
   ANALYSIS PANEL (glassmorphism, like .sc-panel)
   ============================================================ */
.sw-analysis {
    margin-top: 24px;
    background: rgba(19, 17, 28, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 24px;
    display: none;
}

.sw-analysis--visible {
    display: block;
    animation: sw-fadeIn 0.4s ease;
}

@keyframes sw-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.sw-analysis-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 16px;
    font-family: 'Sora', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sw-analysis-title svg {
    width: 16px;
    height: 16px;
    color: #06B6D4;
}

/* Palette swatches */
.sw-palette {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.sw-palette-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    transition: transform 0.2s ease;
    cursor: default;
    position: relative;
}

.sw-palette-swatch:hover {
    transform: scale(1.15);
}

.sw-palette-swatch::after {
    content: attr(data-hex);
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: #565e78;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.2s;
    font-family: 'Sora', sans-serif;
}

.sw-palette-swatch:hover::after {
    opacity: 1;
}

/* Analysis grid */
.sw-analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

.sw-analysis-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
}

.sw-analysis-icon {
    width: 18px;
    height: 18px;
    color: #06B6D4;
    flex-shrink: 0;
    opacity: 0.7;
}

.sw-analysis-label {
    font-size: 11px;
    color: #565e78;
    font-family: 'Sora', sans-serif;
    line-height: 1.2;
}

.sw-analysis-value {
    font-size: 13px;
    color: #fff;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
}

/* Brightness badge */
.sw-brightness-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
}

.sw-brightness-badge--dark {
    background: rgba(99, 102, 241, 0.15);
    color: #818cf8;
}

.sw-brightness-badge--light {
    background: rgba(250, 204, 21, 0.15);
    color: #facc15;
}

.sw-brightness-badge--neutral {
    background: rgba(6, 182, 212, 0.15);
    color: #06B6D4;
}

/* ============================================================
   STEP NAVIGATION BUTTONS
   ============================================================ */
.sw-nav-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
    gap: 12px;
}

.sw-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 28px;
    height: 48px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    white-space: nowrap;
}

.sw-btn--primary {
    background: linear-gradient(135deg, #06B6D4, #22D3EE);
    color: #0E0C15;
}

.sw-btn--primary:hover {
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.sw-btn--primary:disabled,
.sw-btn--primary[disabled] {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sw-btn--secondary {
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    border: 2px solid rgba(255, 255, 255, 0.08);
}

.sw-btn--secondary:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================================
   STEP 2: EDIT (merged template gallery + canvas + controls)
   ============================================================ */
.sw-edit-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* --- Template gallery strip (horizontal, top) --- */
.sw-edit-gallery-strip {
    background: rgba(19, 17, 28, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 18px;
}

.sw-edit-gallery-label {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Sora', sans-serif;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sw-edit-gallery {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Scrollbar for gallery */
.sw-edit-gallery::-webkit-scrollbar {
    height: 4px;
}

.sw-edit-gallery::-webkit-scrollbar-track {
    background: transparent;
}

.sw-edit-gallery::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

.sw-edit-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Template cards (inside horizontal gallery) */
.sw-template-card {
    width: 90px;
    height: 160px;
    border-radius: 8px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    background: #16181E;
    flex-shrink: 0;
}

.sw-template-card:hover {
    border-color: rgba(6, 182, 212, 0.3);
    transform: scale(1.05);
}

.sw-template-card--active {
    border-color: #06B6D4;
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.2);
}

.sw-template-card canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.sw-template-card-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    font-size: 9px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    font-family: 'Sora', sans-serif;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Main editing area (canvas left + controls right) --- */
.sw-edit-main {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
}

/* Canvas area */
.sw-edit-canvas-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.sw-canvas-container {
    position: relative;
    background: #16181E;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.sw-canvas-container canvas {
    display: block;
}

/* Actions row below canvas (shuffle) */
.sw-edit-canvas-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

/* --- Controls panel (right side) --- */
.sw-edit-controls {
    background: rgba(19, 17, 28, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 20px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sw-edit-controls::-webkit-scrollbar {
    width: 4px;
}

.sw-edit-controls::-webkit-scrollbar-track {
    background: transparent;
}

.sw-edit-controls::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
}

/* Controls sections */
.sw-controls-section {
    margin-bottom: 4px;
}

.sw-controls-title {
    font-size: 13px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 14px;
    font-family: 'Sora', sans-serif;
}

/* Slider group */
.sw-slider-group {
    margin-bottom: 16px;
}

.sw-slider-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.sw-slider-name {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Sora', sans-serif;
}

.sw-slider-value {
    font-size: 11px;
    color: #06B6D4;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
}

/* Range slider (matches .sc-slider styling) */
.sw-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    outline: none;
    cursor: pointer;
}

.sw-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #06B6D4;
    cursor: pointer;
    border: 2px solid #0E0C15;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
    transition: transform 0.2s ease;
}

.sw-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.sw-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #06B6D4;
    cursor: pointer;
    border: 2px solid #0E0C15;
    box-shadow: 0 0 8px rgba(6, 182, 212, 0.4);
}

/* Slider hints (left/right labels below slider) */
.sw-slider-hints {
    display: flex;
    justify-content: space-between;
    margin-top: 4px;
}

.sw-slider-hints span {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'Sora', sans-serif;
}

/* Section divider */
.sw-controls-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.06);
    margin: 16px 0;
}

/* Effects toggles */
.sw-toggle-group {
    margin-bottom: 14px;
}

.sw-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.sw-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sw-toggle-label {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Sora', sans-serif;
}

.sw-toggle-switch {
    width: 36px;
    height: 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    position: relative;
    transition: background 0.3s ease;
}

.sw-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.3s ease;
}

.sw-toggle--active .sw-toggle-switch {
    background: #06B6D4;
}

.sw-toggle--active .sw-toggle-switch::after {
    transform: translateX(16px);
}

/* Caption editing */
.sw-caption-input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #fff;
    font-size: 13px;
    font-family: 'Sora', sans-serif;
    outline: none;
    transition: border-color 0.3s ease;
    resize: vertical;
    min-height: 50px;
    box-sizing: border-box;
}

.sw-caption-input:focus {
    border-color: rgba(6, 182, 212, 0.5);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.1);
}

.sw-caption-input::placeholder {
    color: rgba(255, 255, 255, 0.2);
}

/* Caption suggestions */
.sw-caption-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.sw-caption-suggestion {
    padding: 5px 12px;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Sora', sans-serif;
}

.sw-caption-suggestion:hover {
    border-color: #06B6D4;
    color: #06B6D4;
}

/* Logo upload */
.sw-logo-upload {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.sw-logo-upload:hover {
    border-color: rgba(6, 182, 212, 0.3);
}

.sw-logo-upload-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Sora', sans-serif;
}

.sw-logo-preview {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.05);
}

/* Shuffle button */
.sw-btn-shuffle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #06B6D4;
    background: rgba(6, 182, 212, 0.08);
    border: 1px solid rgba(6, 182, 212, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Sora', sans-serif;
}

.sw-btn-shuffle:hover {
    background: rgba(6, 182, 212, 0.15);
    border-color: rgba(6, 182, 212, 0.4);
}

/* ============================================================
   STEP 3: EXPORT
   ============================================================ */
.sw-export-section {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.sw-export-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.sw-export-preview canvas {
    max-height: 60vh;
    width: auto;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Format picker (JPG / PNG) */
.sw-export-format {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
}

.sw-format-btn {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.sw-format-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.7);
}

.sw-format-btn--active {
    background: rgba(6, 182, 212, 0.1);
    border-color: #06B6D4;
    color: #06B6D4;
}

/* Quality toggle */
.sw-export-quality {
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    gap: 8px;
}

.sw-quality-btn {
    padding: 6px 16px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.2s;
}

.sw-quality-btn:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.sw-quality-btn--active {
    background: rgba(6, 182, 212, 0.1);
    border-color: #06B6D4;
    color: #06B6D4;
}

/* Export action buttons */
.sw-export-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.sw-export-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px;
    height: 48px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.sw-export-btn--download {
    background: linear-gradient(135deg, #06B6D4, #22D3EE);
    color: #0E0C15;
}

.sw-export-btn--download:hover {
    box-shadow: 0 8px 30px rgba(6, 182, 212, 0.3);
    transform: translateY(-1px);
}

.sw-export-btn--clipboard {
    background: rgba(6, 182, 212, 0.1);
    color: #06B6D4;
    border: 1px solid rgba(6, 182, 212, 0.2);
}

.sw-export-btn--clipboard:hover {
    background: rgba(6, 182, 212, 0.2);
}

.sw-export-btn--share {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sw-export-btn--share:hover {
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* ============================================================
   MODAL (for share fallback / QR)
   ============================================================ */
.sw-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sw-fadeIn 0.3s ease;
}

.sw-modal {
    background: #16181E;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}

.sw-modal h3 {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    font-family: 'Sora', sans-serif;
}

.sw-modal p {
    font-size: 13px;
    color: #565e78;
    margin: 0 0 20px;
    font-family: 'Sora', sans-serif;
    line-height: 1.6;
}

/* ============================================================
   TOAST NOTIFICATION (matches sun calculator toast)
   ============================================================ */
.sw-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: rgba(19, 17, 28, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Sora', sans-serif;
    border: 1px solid rgba(6, 182, 212, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.sw-toast--show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   LOADING / SPINNER
   ============================================================ */
.sw-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
}

.sw-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid rgba(255, 255, 255, 0.08);
    border-top-color: #06B6D4;
    border-radius: 50%;
    animation: sw-spin 0.8s linear infinite;
}

@keyframes sw-spin {
    to { transform: rotate(360deg); }
}

.sw-loading-text {
    font-size: 13px;
    color: #565e78;
    font-family: 'Sora', sans-serif;
}

/* Progress bar */
.sw-progress {
    width: 100%;
    max-width: 300px;
    height: 4px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 8px;
}

.sw-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #06B6D4, #22D3EE);
    border-radius: 2px;
    transition: width 0.3s ease;
    width: 0;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
    .sw-edit-main {
        grid-template-columns: 1fr;
    }

    .sw-edit-controls {
        max-height: none;
        order: -1;
    }

    .sw-edit-gallery {
        gap: 8px;
    }

    .sw-template-card {
        width: 75px;
        height: 133px;
    }
}

@media (max-width: 680px) {
    .sw-workspace {
        padding: 16px 12px 40px;
    }

    .sw-steps {
        padding: 12px 8px;
    }

    .sw-step-label {
        display: none;
    }

    .sw-step-line {
        width: 20px;
    }

    .sw-dropzone {
        padding: 32px 16px;
    }

    .sw-thumb {
        width: 72px;
        height: 72px;
    }

    .sw-thumb-add {
        width: 72px;
        height: 72px;
    }

    .sw-analysis-grid {
        grid-template-columns: 1fr;
    }

    .sw-template-card {
        width: 65px;
        height: 116px;
    }

    .sw-edit-gallery-strip {
        padding: 10px 12px;
    }

    .sw-edit-controls {
        padding: 16px;
    }

    .sw-export-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .sw-export-btn {
        justify-content: center;
    }

    .sw-nav-buttons {
        flex-direction: column;
    }

    .sw-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .sw-template-card {
        width: 56px;
        height: 100px;
    }

    .sw-template-card-name {
        font-size: 7px;
        padding: 3px 4px;
    }

    .sw-thumb {
        width: 60px;
        height: 60px;
    }

    .sw-thumb-add {
        width: 60px;
        height: 60px;
    }

    .sw-export-format {
        flex-direction: column;
        align-items: stretch;
    }

    .sw-format-btn {
        width: 100%;
    }
}

/* ============================================================
   FRAME PICKER
   ============================================================ */
.sw-frame-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.sw-frame-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 6px;
    min-width: 58px;
    background: rgba(255, 255, 255, 0.03);
    border: 2px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.5);
}

.sw-frame-btn:hover {
    border-color: rgba(6, 182, 212, 0.3);
    background: rgba(6, 182, 212, 0.04);
}

.sw-frame-btn--active {
    border-color: #06B6D4;
    background: rgba(6, 182, 212, 0.08);
    color: #06B6D4;
}

.sw-frame-preview {
    width: 32px;
    height: 42px;
    border-radius: 3px;
    position: relative;
    background: rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* Frame preview mini-icons */
.sw-frame-preview--none {
    background: rgba(255, 255, 255, 0.06);
}

.sw-frame-preview--polaroid {
    background: #ffffff;
    border: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.sw-frame-preview--polaroid::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px; right: 3px; bottom: 10px;
    background: rgba(100, 100, 100, 0.3);
}

.sw-frame-preview--filmstrip {
    background: #111;
}
.sw-frame-preview--filmstrip::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 5px;
    background: repeating-linear-gradient(90deg, #111 0px, #111 3px, #333 3px, #333 5px);
}
.sw-frame-preview--filmstrip::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0; height: 5px;
    background: repeating-linear-gradient(90deg, #111 0px, #111 3px, #333 3px, #333 5px);
}

.sw-frame-preview--vintage {
    background: #e8dcc8;
}
.sw-frame-preview--vintage::after {
    content: '';
    position: absolute;
    inset: 3px;
    background: rgba(120, 90, 40, 0.15);
    border: 1px solid rgba(139, 115, 85, 0.3);
}

.sw-frame-preview--grunge {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 6px rgba(0,0,0,0.6);
}

.sw-frame-preview--minimal {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: none;
}
.sw-frame-preview--minimal::after {
    content: '';
    position: absolute;
    inset: 3px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.sw-frame-preview--neon {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #06B6D4;
    box-shadow: 0 0 6px rgba(6, 182, 212, 0.5), inset 0 0 4px rgba(6, 182, 212, 0.2);
}

.sw-frame-preview--torn {
    background: #f5f0e8;
}
.sw-frame-preview--torn::before {
    content: '';
    position: absolute;
    top: -2px; left: 0; right: 0; height: 4px;
    background: repeating-linear-gradient(90deg, #f5f0e8 0px, #f5f0e8 3px, transparent 3px, transparent 5px);
}
.sw-frame-preview--torn::after {
    content: '';
    position: absolute;
    bottom: -2px; left: 0; right: 0; height: 4px;
    background: repeating-linear-gradient(90deg, #f5f0e8 0px, #f5f0e8 3px, transparent 3px, transparent 5px);
}

.sw-frame-name {
    font-size: 9px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    white-space: nowrap;
}

/* ============================================================
   FONT PICKER
   ============================================================ */
.sw-font-picker-label {
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
    font-family: 'Sora', sans-serif;
    margin-bottom: 8px;
}

.sw-font-picker {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.sw-font-btn {
    padding: 5px 8px;
    font-size: 14px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 36px;
    text-align: center;
}

.sw-font-btn:hover {
    border-color: rgba(6, 182, 212, 0.3);
    color: rgba(255, 255, 255, 0.7);
}

.sw-font-btn--active {
    border-color: #06B6D4;
    background: rgba(6, 182, 212, 0.08);
    color: #06B6D4;
}

/* ============================================================
   TEXT OPTIONS (collapsible)
   ============================================================ */
.sw-text-options {
    margin-top: 12px;
    animation: sw-fadeIn 0.3s ease;
}

/* ============================================================
   CANVAS HINT
   ============================================================ */
.sw-canvas-hint {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.25);
    font-family: 'Sora', sans-serif;
    text-align: center;
    margin: 0;
    padding: 4px 0 0;
}

/* ============================================================
   FABRIC.JS CONTROL OVERRIDES (canvas-level)
   ============================================================ */
.sw-canvas-container .canvas-container {
    border-radius: 12px;
}

/* ============================================================
   RESPONSIVE additions for new controls
   ============================================================ */
@media (max-width: 680px) {
    .sw-frame-picker {
        gap: 4px;
    }

    .sw-frame-btn {
        min-width: 48px;
        padding: 6px 4px;
    }

    .sw-frame-preview {
        width: 26px;
        height: 34px;
    }

    .sw-frame-name {
        font-size: 8px;
    }

    .sw-font-btn {
        padding: 4px 6px;
        font-size: 12px;
        min-width: 30px;
    }
}
