@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ===========================
   DESIGN TOKENS
   =========================== */
:root {
    --bm-bg:        #080808;
    --bm-surface:   #121212;
    --bm-card:      rgba(255,255,255,0.03);
    --bm-border:    rgba(255,255,255,0.06);
    --bm-accent:    #ff2d55;
    --bm-accent-glow: rgba(255, 45, 85, 0.4);
    --bm-accent2:   #a855f7;
    --bm-text:      #f5f5f7;
    --bm-muted:     #71717a;
    --bm-glass:     rgba(255,255,255,0.04);
    --bm-radius:    12px;
    --bm-radius-sm: 8px;
    --bm-font:      'Inter', -apple-system, sans-serif;
    --bm-shadow:    0 12px 40px rgba(0,0,0,0.8);
    --bm-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Base Form Elements */
.bm-textarea, .bm-input, .bm-select {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--bm-border);
    border-radius: 8px;
    color: var(--bm-text);
    padding: 10px 14px;
    font-size: 13px;
    font-family: var(--bm-font);
    transition: var(--bm-transition);
}

.bm-textarea:focus, .bm-input:focus, .bm-select:focus {
    outline: none;
    border-color: var(--bm-accent);
    box-shadow: 0 0 12px var(--bm-accent-glow);
    background: rgba(0,0,0,0.5);
}

.bm-textarea {
    resize: vertical;
    border-radius: 12px;
}

.bm-input-sm {
    padding: 6px 10px;
    font-size: 12px;
}

.bm-hex {
    font-family: 'Courier New', Courier, monospace;
    font-weight: 700;
    text-transform: uppercase;
    text-align: center;
    width: 90px;
}

/* Custom Thin Scrollbar */
.bm-app::-webkit-scrollbar {
    width: 6px;
}
.bm-app::-webkit-scrollbar-track {
    background: transparent;
}
.bm-app::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}
.bm-app::-webkit-scrollbar-thumb:hover {
    background: var(--bm-accent);
}
.bm-app {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}


/* Light Theme Overrides */
.bm-app.bm-light {
    --bm-bg:       #f5f5f7;
    --bm-surface:  #ffffff;
    --bm-card:     rgba(0,0,0,0.04);
    --bm-border:   rgba(0,0,0,0.1);
    --bm-text:     #1c1c1e;
    --bm-muted:    #666;
    --bm-glass:    rgba(0,0,0,0.05);
    --bm-shadow:   0 8px 32px rgba(0,0,0,0.15);
}
.bm-app.bm-light .bm-topbar {
    background: rgba(245,245,247,0.9);
}
.bm-app.bm-light .bm-controls-panel {
    background: rgba(255,255,255,0.8);
}
.bm-app.bm-light .bm-preview-panel {
    background: #e8e8ea;
}

/* ===========================
   RESET & BASE
   =========================== */
.bm-app *, .bm-app *::before, .bm-app *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.bm-app {
    font-family: var(--bm-font);
    background: var(--bm-bg);
    color: var(--bm-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ===========================
   TOP BAR
   =========================== */
.bm-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 24px;
    background: rgba(13,13,13,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--bm-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    gap: 16px;
}

.bm-topbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 800;
    color: var(--bm-text);
    letter-spacing: -0.02em;
}

.bm-brand-icon { font-size: 20px; }

.bm-brand-pro {
    background: linear-gradient(135deg, var(--bm-accent), #ff5e62);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    margin-left: 2px;
}

.bm-tabs {
    display: flex;
    background: #000;
    padding: 4px;
    border-radius: 100px;
    border: 1px solid var(--bm-border);
    gap: 2px;
}

.bm-tab-btn {
    background: transparent;
    border: none;
    color: var(--bm-muted);
    font-family: var(--bm-font);
    font-size: 12px;
    font-weight: 600;
    padding: 6px 18px;
    border-radius: 100px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.bm-tab-btn:hover { color: var(--bm-text); background: rgba(255,255,255,0.05); }

.bm-tab-btn.active {
    background: var(--bm-surface);
    color: var(--bm-text);
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
    border: 1px solid var(--bm-border);
}

.bm-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--bm-border);
    color: var(--bm-text);
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--bm-transition);
    font-size: 12px;
}

.bm-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255,255,255,0.2);
}


.bm-btn-text {
    background: transparent;
    border: none;
    color: var(--bm-accent);
    cursor: pointer;
    font-size: 11px;
    font-weight: 600;
    text-decoration: underline;
    opacity: 0.8;
    transition: var(--bm-transition);
}

.bm-btn-text:hover {
    opacity: 1;
}

.bm-btn-ai {
    background: linear-gradient(135deg, #ff2d55, #bf26ff);
    color: #fff;
    border: none;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--bm-transition);
    box-shadow: 0 4px 15px rgba(255, 45, 85, 0.4);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.bm-btn-ai:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 45, 85, 0.6);
    filter: brightness(1.1);
}

.bm-btn-xs {
    padding: 2px 6px;
    font-size: 10px;
}

.bm-credit-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--bm-accent), #ff5e62);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    padding: 6px 16px;
    border-radius: 100px;
    box-shadow: 0 4px 15px var(--bm-accent-glow);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.bm-credit-badge strong {
    font-weight: 900;
}

.bm-credit-badge.bm-unauth {
    background: var(--bm-card);
    border: 1px solid var(--bm-border);
    color: var(--bm-muted);
    box-shadow: none;
    text-shadow: none;
}


/* Theme Toggle Button */
.bm-theme-toggle {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--bm-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.bm-theme-toggle:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 18px rgba(255,45,85,0.35);
}

/* ===========================
   LAYOUT
   =========================== */
.bm-layout {
    display: flex;
    gap: 0;
    min-height: calc(100vh - 60px);
    overflow: hidden;
}

.bm-controls-panel {
    background: var(--bm-bg);
    border-right: 1px solid var(--bm-border);
    padding: 12px;
    overflow-y: auto;
    max-height: calc(100vh - 60px);
    position: sticky;
    top: 60px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 320px; /* Initial width */
    flex-shrink: 0;
    transition: background 0.2s ease;
}

/* Sidebar Resizer */
.bm-resizer {
    width: 4px;
    cursor: col-resize;
    background: transparent;
    position: relative;
    z-index: 100;
    transition: var(--bm-transition);
    flex-shrink: 0;
}

.bm-resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: 100%;
    background: var(--bm-border);
    transition: var(--bm-transition);
}

.bm-resizer:hover::after,
.bm-resizer.active::after {
    width: 2px;
    background: var(--bm-accent);
    box-shadow: 0 0 10px var(--bm-accent-glow);
}

.bm-resizer:hover {
    background: rgba(255, 45, 85, 0.05);
}

.bm-panel-section {
    padding: 12px;
    background: var(--bm-surface);
    border-radius: var(--bm-radius);
    border: 1px solid var(--bm-border);
    transition: var(--bm-transition);
}

.bm-panel-section:hover {
    border-color: rgba(255,255,255,0.12);
}

.bm-section-label {
    font-size: 10px;
    font-weight: 800;
    color: var(--bm-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}


/* ===========================
   PREVIEW PANEL - THE STAGE
   =========================== */
.bm-preview-panel {
    background: #020202;
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 100px rgba(0,0,0,0.8);
    flex: 1;
    min-width: 0; /* Important for flex child to shrink */
}

@keyframes bmPulseBg {
    0% { filter: hue-rotate(0deg) saturate(100%); }
    100% { filter: hue-rotate(5deg) saturate(120%); }
}

.bm-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    background: #000;
    border-bottom: 1px solid var(--bm-border);
}

.bm-preview-title {
    font-size: 10px;
    font-weight: 800;
    color: var(--bm-muted);
    text-transform: uppercase;
    letter-spacing: 0.2em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.bm-preview-title::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}


.bm-preview-stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: 60px;
    background: transparent;
    overflow: auto;
}

.bm-canvas-container {
    position: relative;
    padding: 2px;
}

.bm-canvas-wrap {
    background: #000;
    border-radius: 4px;
    border: 1px solid var(--bm-border);
    overflow: hidden;
    box-shadow: 0 30px 100px rgba(0,0,0,0.9), 0 0 0 1px rgba(255,255,255,0.03);
    position: relative;
    z-index: 1;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}


.bm-canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Dimension Markers Removed in Phase 32 */
.bm-dim { display: none !important; }

/* Platform Presets (Vibrant Accent) */
.bm-platform-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 12px;
}

.bm-platform-btn {
    background: var(--bm-surface);
    border: 1px solid var(--bm-border);
    color: var(--bm-muted);
    padding: 10px 4px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--bm-transition);
    text-align: center;
}

.bm-platform-btn:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.12);
    transform: translateY(-1px);
}

.bm-platform-btn.active {
    background: rgba(255, 45, 85, 0.1) !important;
    border-color: var(--bm-accent) !important;
    color: var(--bm-accent) !important;
    box-shadow: 0 0 15px var(--bm-accent-glow) !important;
}


/* Floating Glass HUD */
.bm-canvas-hud {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(18, 18, 18, 0.6);
    backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 50px;
    padding: 6px;
    display: flex;
    align-items: center;
    z-index: 50;
    box-shadow: 0 20px 50px rgba(0,0,0,0.7), inset 0 0 0 1px rgba(255,255,255,0.05);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.bm-preview-stage:hover .bm-canvas-hud {
    opacity: 1;
    visibility: visible;
    bottom: 34px;
}

.bm-hud-btn {
    background: transparent;
    border: none;
    color: var(--bm-text);
    font-size: 11px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--bm-transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.bm-hud-btn:hover {
    background: rgba(255,255,255,0.08);
}

.bm-hud-sep {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,0.1);
    margin: 0 4px;
}

/* Mockup Overlay (X/Twitter) */
.bm-mockup-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    border-radius: 8px;
    overflow: hidden;
    animation: bmFadeIn 0.3s ease;
}

.bm-mockup-x-profile {
    position: absolute;
    bottom: -15px; /* Half out */
    left: 40px;
    width: 160px;
    height: 160px;
    border-radius: 50%;
    background: #000;
    border: 4px solid #000;
    box-shadow: 0 0 0 4px #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bm-mockup-x-profile::after {
    content: '👤';
    font-size: 60px;
    opacity: 0.3;
}

.bm-mockup-x-status-bar {
    position: absolute;
    top: 15px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.bm-mockup-x-status-bar::after {
    content: '•••';
    color: #fff;
    letter-spacing: 2px;
    background: rgba(0,0,0,0.4);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
}

/* Mockup Toggle Switch */
.bm-mockup-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-switch-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--bm-muted);
}

.bm-switch {
    width: 36px;
    height: 20px;
    background: rgba(255,255,255,0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: var(--bm-transition);
}

.bm-switch-thumb {
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    top: 3px;
    left: 3px;
    transition: var(--bm-transition);
}

.bm-switch.active {
    background: var(--bm-accent);
}

.bm-switch.active .bm-switch-thumb {
    left: 19px;
}


/* ===========================
   PRICING TAB
   =========================== */
.bm-pricing-wrap {
    max-width: 900px;
    margin: 40px auto;
    padding: 0 20px;
    text-align: center;
}

.bm-pricing-title {
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, #fff, var(--bm-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.bm-pricing-sub { color: var(--bm-muted); font-size: 15px; margin-bottom: 24px; }

.bm-billing-toggle {
    display: inline-flex;
    background: rgba(0,0,0,0.4);
    padding: 4px;
    border-radius: 10px;
    border: 1px solid var(--bm-border);
    margin-bottom: 30px;
    gap: 2px;
}

.bm-toggle-btn {
    background: transparent;
    border: none;
    color: var(--bm-muted);
    font-family: var(--bm-font);
    font-size: 13px;
    font-weight: 600;
    padding: 9px 22px;
    border-radius: 7px;
    cursor: pointer;
    transition: var(--bm-transition);
}
.bm-toggle-btn:hover { color: var(--bm-text); }
.bm-toggle-btn.active { background: rgba(255,255,255,0.1); color: var(--bm-text); }

.bm-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    text-align: left;
}

.bm-price-card {
    background: var(--bm-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 24px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    transition: var(--bm-transition);
}
.bm-price-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.bm-price-card.bm-best { border-color: var(--bm-accent); background: rgba(255,45,85,0.06); }

.bm-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bm-accent);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

.bm-price-name { font-size: 14px; font-weight: 700; color: var(--bm-text); }
.bm-price-credits { font-size: 22px; font-weight: 900; color: var(--bm-text); }
.bm-price-credits small { font-size: 13px; color: var(--bm-muted); font-weight: 500; }
.bm-price-amount { font-size: 28px; font-weight: 900; color: var(--bm-accent); }
.bm-price-amount small { font-size: 14px; color: var(--bm-muted); }

.bm-buy-btn {
    width: 100%;
    padding: 11px;
    background: linear-gradient(135deg, var(--bm-accent), #ff5e62);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: var(--bm-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--bm-transition);
}
.bm-buy-btn:hover { opacity: 0.85; }

.bm-paypal-btn {
    width: 100%;
    padding: 11px;
    background: #ffc439;
    border: none;
    border-radius: 8px;
    color: #003087;
    font-family: var(--bm-font);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--bm-transition);
}
.bm-paypal-btn:hover { opacity: 0.85; }

.bm-auth-notice {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 14px;
    font-size: 14px;
    color: var(--bm-muted);
    margin-bottom: 20px;
}

/* ===========================
   DEFAULT BACKGROUND GALLERY
   =========================== */

.bm-gallery-cat-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--bm-accent);
    margin-bottom: 12px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    opacity: 0.9;
}

.bm-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bm-bg-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--bm-transition);
    flex-shrink: 0;
    position: relative;
}

.bm-bg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.bm-bg-thumb:hover {
    border-color: rgba(255,255,255,0.3);
    transform: scale(1.06);
}

.bm-bg-thumb.active {
    border-color: var(--bm-accent);
    box-shadow: 0 0 12px rgba(255,45,85,0.5);
}

/* ===========================
   FX & FILTERS
   =========================== */
.bm-fx-group {
    margin-bottom: 12px;
}

.bm-fx-group small {
    display: block;
    color: var(--bm-muted);
    font-size: 11px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bm-fx-row {
    display: flex;
    gap: 12px;
    margin-bottom: 4px;
}

.bm-fx-row .bm-fx-group {
    flex: 1;
}

.bm-range-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
}

.bm-range-val {
    min-width: 45px;
    font-size: 12px;
    color: var(--bm-accent);
    font-weight: 600;
    text-align: right;
}

/* Range Input Styling */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.08);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: var(--bm-accent);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--bm-accent-glow);
    transition: var(--bm-transition);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    box-shadow: 0 0 12px var(--bm-accent-glow);
}


.bm-gallery-hint {
    font-size: 11px;
    color: var(--bm-muted);
    line-height: 1.5;
}

.bm-gallery-hint code {
    background: rgba(255,255,255,0.06);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    color: var(--bm-accent);
}

/* ===========================
   ACTIVITY LOG
   =========================== */
.bm-credit-activity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
    padding-right: 4px;
}

.bm-activity-item {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    padding: 10px;
    border-radius: 8px;
    animation: bmFadeIn 0.3s ease-out;
}

.bm-activity-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 4px;
}

.bm-activity-reason {
    font-size: 12px;
    color: var(--bm-text);
    font-weight: 500;
    line-height: 1.3;
}

.bm-activity-cost {
    font-size: 12px;
    color: var(--bm-accent);
    font-weight: 700;
    white-space: nowrap;
}

.bm-activity-time {
    display: block;
    font-size: 10px;
    color: var(--bm-muted);
}

/* ===========================
   HUD & MULTI-LAYER (Phase 12)
   =========================== */
.bm-canvas-wrap {
    position: relative;
    border-radius: 12px;
    background: #000;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.bm-preview-hud {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 100;
    display: flex;
    gap: 8px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.bm-canvas-wrap:hover .bm-preview-hud {
    opacity: 1;
    transform: translateY(0);
}

.bm-hud-btn {
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: all 0.2s ease;
}

.bm-hud-btn:hover {
    background: rgba(30, 41, 59, 0.9);
    border-color: var(--bm-accent);
    transform: translateY(-2px);
}

.bm-hud-btn:active {
    transform: scale(0.95);
}

.bm-kit-delete {
    background: #ff4444 !important;
    color: white !important;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.bm-brand-gallery .bm-aura-card:hover {
    border-color: var(--bm-accent);
}

#bm-live-preview {
    transition: cursor 0.1s ease;
}

/* Resolution Toggle (Segmented Control) */
.bm-resolution-toggle {
    display: flex;
    background: rgba(15, 23, 42, 0.5);
    padding: 2px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bm-resolution-toggle input {
    display: none;
}

.bm-resolution-toggle label {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: rgba(255, 255, 255, 0.6);
}

.bm-resolution-toggle input:checked + label {
    background: var(--bm-accent);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 112, 243, 0.3);
}

/* Estimate Badge */
.bm-estimate-badge {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--bm-accent);
    min-width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    font-family: var(--bm-font-mono);
    transition: all 0.3s ease;
}

.bm-estimate-badge.bm-low-credits {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
    animation: bmPulse 2s infinite;
}

@keyframes bmPulse {
    0%   { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
    70%  { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* ===========================
   ANIMATIONS
   =========================== */

@keyframes bmFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ===========================
   PHASE 15: AI GENERATIVE UI
   =========================== */

.bm-btn-ai {
    background: linear-gradient(135deg, #6366f1, #a855f7, #ec4899);
    border: none;
    color: #fff;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.3);
    border-radius: 6px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bm-btn-ai:hover {
    transform: translateY(-2px) scale(1.05);
    filter: brightness(1.2);
    box-shadow: 0 8px 20px rgba(168, 85, 247, 0.5), 0 0 15px rgba(99, 102, 241, 0.4);
}

.bm-btn-ai:active {
    transform: translateY(1px) scale(0.98);
}

.bm-btn-xs {
    padding: 3px 8px;
    font-size: 10px;
}

/* Modals */
.bm-modal-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: bmFadeIn 0.3s ease;
}

.bm-modal-content {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 450px;
    padding: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(168, 85, 247, 0.2);
    position: relative;
    overflow: hidden;
}

.bm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.bm-modal-header h3 {
    margin: 0;
    font-size: 20px;
    background: linear-gradient(135deg, #fff, rgba(255,255,255,0.6));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bm-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.bm-modal-close:hover {
    opacity: 1;
}

/* AI Loader */
.bm-ai-loader {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.98);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    z-index: 10;
}

.bm-shimmer-ring {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 3px solid rgba(168, 85, 247, 0.1);
    border-top-color: #a855f7;
    animation: bmRotate 1s linear infinite;
    margin-bottom: 15px;
    box-shadow: 0 0 20px rgba(168, 85, 247, 0.3);
}

@keyframes bmRotate {
    to { transform: rotate(360deg); }
}

@keyframes rainbowBorder {
    0%   { border-color: #6366f1; }
    33%  { border-color: #a855f7; }
    66%  { border-color: #ec4899; }
    100% { border-color: #6366f1; }
}

/* ===========================
   PHASE 16: VECTOR DECORATIONS
   =========================== */

.bm-shape-preview {
    background-color: #6366f1;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.bm-shape-preview[data-svg="badge.svg"]   { mask-image: url('../images/shapes/badge.svg'); -webkit-mask-image: url('../images/shapes/badge.svg'); }
.bm-shape-preview[data-svg="burst.svg"]   { mask-image: url('../images/shapes/burst.svg'); -webkit-mask-image: url('../images/shapes/burst.svg'); }
.bm-shape-preview[data-svg="circle.svg"]  { mask-image: url('../images/shapes/circle.svg'); -webkit-mask-image: url('../images/shapes/circle.svg'); }
.bm-shape-preview[data-svg="square.svg"]  { mask-image: url('../images/shapes/square.svg'); -webkit-mask-image: url('../images/shapes/square.svg'); }
.bm-shape-preview[data-svg="ribbon.svg"]  { mask-image: url('../images/shapes/ribbon.svg'); -webkit-mask-image: url('../images/shapes/ribbon.svg'); }
.bm-shape-preview[data-svg="wave.svg"]    { mask-image: url('../images/shapes/wave.svg');   -webkit-mask-image: url('../images/shapes/wave.svg');   }

/* Responsive adjustment for new tab */
@media (max-width: 1024px) {
    #bm-tab-shapes .bm-builder-layout {
        flex-direction: column;
    }
}

/* ===========================
   PHASE 19: PROGRESS BAR
   =========================== */
.bm-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--bm-text);
}

.bm-progress-track {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}

.bm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--bm-accent), #a78bfa);
    border-radius: 99px;
    transition: width 0.25s ease;
    position: relative;
    overflow: hidden;
}

/* Animated shimmer on the fill */
.bm-progress-fill::after {
    content: '';
    position: absolute;
    top: 0; left: -60%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    animation: bm-shimmer 1.4s infinite;
}

@keyframes bm-shimmer {
    0%   { left: -60%; }
    100% { left: 110%; }
}

.bm-progress-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bm-btn-cancel {
    background: transparent;
    border: 1px solid rgba(239,68,68,0.4);
    color: #f87171;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--bm-transition);
    font-family: var(--bm-font);
}
.bm-btn-cancel:hover {
    background: rgba(239,68,68,0.12);
    border-color: #f87171;
}


/* ===========================
   RESPONSIVE
   =========================== */
@media (max-width: 900px) {
    .bm-layout { grid-template-columns: 1fr; }
    .bm-controls-panel { position: static; max-height: none; }
    .bm-pricing-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .bm-topbar { padding: 12px 16px; }
    .bm-pricing-grid { grid-template-columns: 1fr; }
    .bm-platform-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===========================
   AI VARIATION GALLERY (Phase 23)
   =========================== */
.bm-ai-variation-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 15px;
}

.bm-variation-card {
    background: var(--bm-glass);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius-sm);
    padding: 10px;
    cursor: pointer;
    transition: var(--bm-transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bm-variation-card:hover {
    border-color: var(--bm-accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    background: rgba(255,255,255,0.08);
}

.bm-variation-thumb {
    width: 100%;
    aspect-ratio: 16/9;
    background: #000;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.bm-variation-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.bm-variation-card:hover .bm-variation-thumb img {
    transform: scale(1.1);
}

.bm-variation-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.bm-variation-name {
    font-size: 11px;
    font-weight: 800;
    color: var(--bm-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bm-variation-prompt {
    font-size: 9px;
    color: var(--bm-muted);
    line-height: 1.2;
    height: 22px;
    overflow: hidden;
}

.bm-variation-status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    background: rgba(0,0,0,0.6);
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--bm-accent);
    backdrop-filter: blur(4px);
}

.bm-shimmer-ring {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255,45,85,0.1);
    border-top-color: var(--bm-accent);
    border-radius: 50%;
    animation: bmSpin 1s linear infinite;
}

@keyframes bmSpin {
    to { transform: rotate(360deg); }
}

/* ===========================
   AURA THEMES & SCROLLBAR (PHASE 32)
   =========================== */
.bm-aura-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}

.bm-aura-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.bm-aura-preview {
    width: 64px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    border: 1px solid var(--bm-border);
    transition: var(--bm-transition);
    background-size: cover;
    background-position: center;
}

.bm-aura-card:hover .bm-aura-preview {
    border-color: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.bm-aura-card.active .bm-aura-preview {
    border-color: var(--bm-accent);
    box-shadow: 0 0 15px var(--bm-accent-glow);
}

.bm-aura-card span {
    font-size: 10px;
    font-weight: 600;
    color: var(--bm-muted);
}

.bm-aura-card.active span {
    color: var(--bm-text);
}


.bm-controls-panel::-webkit-scrollbar {
    width: 5px;
}
.bm-controls-panel::-webkit-scrollbar-track {
    background: transparent;
}
.bm-controls-panel::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
    border-radius: 10px;
}
.bm-controls-panel::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}

/* Updated AI Button Glows */
.bm-btn-ai {
    background: linear-gradient(135deg, #a855f7, var(--bm-accent)) !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 14px !important;
    border-radius: 100px !important;
    font-size: 10px !important;
    font-weight: 800 !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.4);
    transition: var(--bm-transition) !important;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.bm-btn-ai:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.6);
}


/* Re-styled Platform Buttons for Phase 32 */
.bm-platform-btn {
    background: var(--bm-surface);
    border: 1px solid var(--bm-border);
    color: var(--bm-muted);
    padding: 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    transition: var(--bm-transition);
}

.bm-platform-btn:hover {
    border-color: rgba(255,255,255,0.2);
}

.bm-platform-btn.active {
    background: rgba(255, 45, 85, 0.1) !important;
    border-color: var(--bm-accent) !important;
    color: var(--bm-accent) !important;
    font-weight: 700 !important;
    box-shadow: 0 0 12px rgba(255, 45, 85, 0.15) !important;
}

/* ===========================
   COLORS & DESIGN CONTROLS
   =========================== */
.bm-color-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bm-design-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.bm-design-toggle-row small {
    font-size: 11px;
    font-weight: 700;
    color: var(--bm-muted);
}

.bm-design-toggle {
    display: flex;
    background: rgba(0,0,0,0.3);
    padding: 3px;
    border-radius: 8px;
    border: 1px solid var(--bm-border);
}

.bm-design-btn {
    background: transparent;
    border: none;
    color: var(--bm-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--bm-transition);
}

.bm-design-btn:hover {
    color: var(--bm-text);
}

.bm-design-btn.active {
    background: rgba(255, 45, 85, 0.1);
    color: var(--bm-accent);
    box-shadow: 0 0 12px rgba(255, 45, 85, 0.2);
    border: 1px solid var(--bm-accent);
}

/* Color Picker & Hex Row */
.bm-color-row, .bm-grad-row {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.03);
    padding: 6px;
    border-radius: 12px;
    border: 1px solid var(--bm-border);
    transition: var(--bm-transition);
}

.bm-color-row:hover, .bm-grad-row:hover {
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.15);
}

.bm-design-ctrl {
    display: none;
    animation: bmFadeIn 0.3s ease-out;
}

.bm-design-ctrl.active {
    display: block;
}

/* Customizing the Native Color Input */
input[type="color"] {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 38px;
    height: 32px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}


input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: 2px solid var(--bm-border);
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Hex Text Box */
.bm-hex {
    flex: 1;
    background: transparent !important;
    border: none !important;
    font-family: 'Space Grotesk', 'Courier New', monospace !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: var(--bm-text) !important;
    text-align: center;
    padding: 0 !important;
    box-shadow: none !important;
}

/* Gradient Row Adjustment */
.bm-grad-row {
    justify-content: space-between;
}

.bm-grad-row input[type="number"] {
    width: 45px;
    background: transparent;
    border: none;
    color: var(--bm-accent);
    font-weight: 700;
    font-size: 12px;
    text-align: center;
    outline: none;
}

.bm-grad-row-wrap {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Utility for Small Numeric Inputs (Responsive 4-digit support) */
.bm-input-qty {
    min-width: 90px !important;
    flex: 1;
    text-align: center;
}

/* Premium Section Group (Aura System) */
.bm-aura-section {
    background: var(--bm-card);
    border: 1px solid var(--bm-border);
    border-radius: var(--bm-radius);
    padding: 16px;
    margin-bottom: 20px;
    transition: var(--bm-transition);
}

.bm-aura-section:hover {
    border-color: rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.05);
}

.bm-label-row {
    display: block;
    font-size: 10px;
    font-weight: 800;
    color: var(--bm-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

/* Checkered Background for Transparent Mode Preview */
.bm-canvas-wrap.is-transparent {
    background-image: 
        linear-gradient(45deg, #18181b 25%, transparent 25%), 
        linear-gradient(-45deg, #18181b 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #18181b 75%), 
        linear-gradient(-45deg, transparent 75%, #18181b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    background-color: #0c0c0e;
}

/* Improving Input Row Spacing */
.bm-fx-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.bm-fx-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.bm-fx-group small {
    font-size: 9px;
    font-weight: 800;
    color: var(--bm-muted);
    text-transform: uppercase;
    margin-bottom: 4px;
    letter-spacing: 0.05em;
}
