/* MicroCreativity Live View Embed CSS */

.mc-embed-wrapper {
    /* CSS Variables */
    --mc-bg-app: #121212;
    --mc-bg-panel: #1A1A1A;
    --mc-bg-input: #121212;
    --mc-accent-main: #FF3300;
    /* Safety Orange / Maxon-style aggressive accent */
    --mc-text-main: #FFFFFF;
    --mc-text-muted: #A3A3A3;
    --mc-border: rgba(255, 255, 255, 0.15);
    --mc-radius-lg: 0px;
    --mc-radius-md: 0px;
    --mc-spacing: 16px;

    /* Base Styling */
    font-family: 'Inter', sans-serif;
    background-color: var(--mc-bg-app);
    color: var(--mc-text-main);
    width: 100%;
    height: 100%;
    margin: 0;
    display: flex;
    overflow: hidden;
}

/* Main Content Container */
.mc-main-content {
    flex: 1;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    background: var(--mc-bg-app);
    position: relative;
    width: 100%;
    height: 100%;
}

/* Left Column: Slideshow */
.mc-gallery-section {
    flex: 1;
    position: relative;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.mc-slideshow-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mc-slide-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease;
}

.mc-slide-image.hidden {
    display: none;
}

/* Slideshow Navigation overlay */
.mc-slide-overlay {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Space buttons evenly */
    gap: 16px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px 20px;
    border-radius: 30px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 10;
    width: 450px;
    /* Strictly fixed width to prevent any jumping across all packs */
    max-width: 90vw;
}

.mc-slide-overlay.hidden {
    display: none;
}

.mc-slide-nav {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 5px 10px;
    transition: color 0.2s;
}

.mc-slide-nav:hover {
    color: var(--mc-accent-main);
}

.mc-caption-text {
    flex: 1;
    /* Take up remaining space */
    text-align: center;
    /* Center the text */
    color: white;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#panel-search {
    display: flex;
    flex-direction: column;
    height: 100%;
}

#pack-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 20px;
}

.sidebar-cta {
    padding: 24px 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    border-top: 1px solid var(--mc-border);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cta-text {
    font-size: 13px;
    color: var(--mc-text-muted);
    margin: 0;
    font-weight: 500;
}

.cta-button {
    width: 100%;
    padding: 12px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

/* Right Column: Floating UI */
.mc-interactive-section {
    width: 380px;
    background: var(--mc-bg-panel);
    border-left: 1px solid var(--mc-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    z-index: 20;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.5);
    flex-shrink: 0;
}

/* Pack Selector block */
.mc-pack-selector {
    padding: var(--mc-spacing);
    border-bottom: 1px solid var(--mc-border);
    background: #000;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.mc-pack-selector.hidden {
    display: none;
}


.mc-pack-selector h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.mc-pack-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    font-family: 'JetBrains Mono', monospace;
}

/* Custom Scrollbar for list */
.mc-pack-list::-webkit-scrollbar {
    width: 6px;
}

.mc-pack-list::-webkit-scrollbar-thumb {
    background: var(--mc-border);
    border-radius: 3px;
}

.mc-pack-card {
    background: #111;
    border: 1px solid var(--mc-border);
    border-radius: var(--mc-radius-md);
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mc-pack-card:hover {
    border-color: var(--mc-accent-main);
    background: rgba(255, 51, 0, 0.05);
    /* Accent Hover Match */
}

.mc-pack-card.active {
    border-color: var(--mc-accent-main);
    background: rgba(255, 51, 0, 0.1);
}

.mc-pack-card h4 {
    margin: 0 0 4px 0;
    font-size: 13px;
}

.mc-pack-card p {
    margin: 0;
    font-size: 11px;
    color: var(--mc-text-muted);
}

/* Active View (Controls) */
.mc-active-view {
    padding: 24px;
    flex: 1;
}

.mc-active-view.hidden {
    display: none;
}

/* Back Button */
.mc-back-button {
    background: none;
    border: 1px solid var(--mc-border);
    color: var(--mc-text-muted);
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    width: fit-content;
}

.mc-back-button:hover {
    color: var(--mc-accent-main);
    border-color: var(--mc-accent-main);
    background: rgba(255, 51, 0, 0.05);
}

.mc-back-icon {
    font-size: 10px;
}

.mc-pack-header {
    margin-bottom: 24px;
    border-bottom: 1px solid var(--mc-border);
    padding-bottom: 16px;
}

.mc-pack-header h1 {
    font-size: 22px;
    margin: 0 0 8px 0;
}

.mc-pack-header p {
    font-size: 13px;
    color: var(--mc-text-muted);
    margin: 0;
    line-height: 1.4;
}

/* Sections */
.mc-editor-section h3 {
    font-size: 16px;
    margin: 0 0 16px 0;
}

.mc-editor-container {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

/* Group Styling */
.mc-control-group {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--mc-border);
    background: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    border-radius: 0;
    padding: 0;
}

.mc-group-title {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--mc-accent-main);
    margin: 0;
    padding: 12px 16px;
    font-family: 'JetBrains Mono', monospace;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    transition: background 0.2s;
}

.mc-group-title:hover {
    background: rgba(255, 255, 255, 0.06);
}

.mc-group-title::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
    opacity: 0.5;
}

.mc-control-group.collapsed .mc-group-title::after {
    transform: rotate(-90deg);
}

.mc-group-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px 16px;
}

.mc-control-group.collapsed .mc-group-controls {
    display: none;
}

/* Controls */
.mc-control-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mc-control-item label {
    font-size: 11px;
    font-weight: 500;
    color: var(--mc-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Inputs in the right column */
.mc-control-item select,
.mc-control-item input[type="text"],
.mc-control-item input[type="number"] {
    box-sizing: border-box;
    /* Fix overflow */
    background: var(--mc-bg-input);
    border: 1px solid var(--mc-border);
    color: var(--mc-text-main);
    padding: 10px 12px;
    border-radius: 4px;
    font-size: 13px;
    width: 100%;
    pointer-events: none;
    /* Read only purely for demo */
    opacity: 0.8;
}

.mc-empty-state {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--mc-text-muted);
    font-size: 16px;
    text-align: center;
}

:root {
    --bg-app: #0a0a0a;
    --bg-panel: rgba(28, 28, 28, 0.95);
    --bg-input: #252525;
    --accent-main: #bc1b28;
    /* Magenta Red */
    --accent-glow: rgba(188, 27, 40, 0.3);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --border: rgba(255, 255, 255, 0.15);
    --radius-lg: 20px;
    --radius-md: 10px;
    --spacing: 16px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.ext-body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-app);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ext-header {
    padding: 16px 20px;
    background: #000000;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    z-index: 100;
}

/* Update Banner */
.update-banner {
    background: linear-gradient(135deg, #bc1b28 0%, #610c1f 100%);
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    z-index: 200;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.update-banner a {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    margin-left: auto;
    margin-right: 12px;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.update-banner a:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.update-banner .close-banner {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
    margin-left: 12px;
    transition: color 0.2s;
}

.update-banner .close-banner:hover {
    color: #fff;
}

.user-type-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: linear-gradient(135deg, #666666 0%, #444444 100%);
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-icon-btn {
    width: 28px;
    height: 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #bbb;
}

.header-icon-btn:active {
    transform: scale(0.95);
}

.spinning svg {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Settings List (inside modal) */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
}

.settings-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* Toggle Switch */
.switch {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.switch-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #333;
    border-radius: 20px;
    transition: background 0.2s;
}

.switch-slider::before {
    content: '';
    position: absolute;
    width: 14px;
    height: 14px;
    left: 3px;
    bottom: 3px;
    background: #888;
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}

.switch input:checked+.switch-slider {
    background: var(--accent-main);
}

.switch input:checked+.switch-slider::before {
    transform: translateX(16px);
    background: #fff;
}

/* Main Area */
.ext-main {
    flex: 1;
    overflow: hidden;
    position: relative;
    min-height: 0;
    overflow-y: overlay;
}

/* Two-Panel Navigation */
.panel-track {
    display: flex;
    width: 200%;
    height: 100%;
    transition: transform 0.25s ease-out;
    transform: translateX(0);
    will-change: transform;
}

.panel-track.show-editor {
    transform: translateX(-50%);
}

.panel {
    width: 50%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    padding: var(--spacing);
}

#panel-editor {
    overflow-y: hidden;
    padding-bottom: 0;
}

/* Search */
.search-container {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-shrink: 0;
}

#pack-search {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    padding: 4px 0;
    outline: none;
    width: 100%;
}



#pack-search::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

#pack-search:focus::placeholder {
    color: transparent;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon {
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.clear-search-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    padding: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    margin-right: -4px;
    transition: color 0.2s, background 0.2s;
}

.clear-search-btn:hover {
    color: rgba(255, 255, 255, 0.8);
}

.clear-search-btn.hidden {
    display: none;
}

.search-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    width: 100%;
}

.sort-dropdown {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 6px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    min-width: 110px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.sort-dropdown.hidden {
    display: none;
}

.sort-option {
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 8px 12px;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s, color 0.15s;
}

.sort-option:hover {
    background: var(--bg-hover);
}

.sort-option.active {
    color: var(--accent-main);
    font-weight: 600;
}

.sort-btn.active {
    color: var(--accent-main);
}

/* Pack Sections */
#pack-list {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.pack-section-header {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 0 6px 0;
}

.pack-section-header:first-child {
    padding-top: 0;
}

/* Pack Folders */
.pack-folder {
    margin-bottom: 4px;
}

.pack-folder-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    border-radius: 6px;
    transition: background 0.15s;
}

.pack-folder-header:hover {
    background: rgba(255, 255, 255, 0.04);
}

.folder-icon {
    font-size: 14px;
    color: #888;
    width: 14px;
}

.folder-count {
    margin-left: auto;
    font-size: 10px;
    color: #888;
    font-weight: 400;
}

.pack-folder-content {
    padding-left: 8px;
}

/* Pack Cards */
.pack-card {
    position: relative;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.15s;
    margin-bottom: 8px;
    overflow: hidden;
}

.pack-card:hover {
    background: rgba(255, 255, 255, 0.04);
}

.pack-card-top {
    display: flex;
    align-items: center;
}

/* Full-card hover overlay */
.pack-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: stretch;
    justify-content: flex-end;
    background: linear-gradient(to left, transparent 50%, rgba(255, 255, 255, 0.07) 100%);
    opacity: 0;
    transition: opacity 0.15s;
    pointer-events: none;
}

.pack-card:hover .pack-card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.pack-card-overlay-right {
    position: relative;
    width: 36px;
    flex-shrink: 0;
}

/* Star — top right corner */
.pack-star-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    color: #999;
    padding: 2px;
    transition: color 0.15s;
}

.pack-star-btn:hover {
    color: #f0c040;
}

/* Chevron — center right */
.pack-card-chevron {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    font-size: 20px;
    font-weight: 300;
    color: #888;
    line-height: 1;
}

.pack-card-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 4px;
}

/* BETA badge — outline pill, no fill, pastel lavender */
.pack-beta-badge {
    display: inline-flex;
    align-items: center;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #c4b5fd;
    border: 1px solid rgba(196, 181, 253, 0.45);
    border-radius: 20px;
    padding: 2px 7px;
    margin-left: 7px;
    line-height: 1.4;
    vertical-align: middle;
    white-space: nowrap;
    flex-shrink: 0;
}

.pack-card-desc {
    font-size: 11px;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Editor Header Row */
.editor-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    flex-shrink: 0;
}

/* Unlock Button */
.btn-unlock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
    cursor: pointer;
}

.btn-unlock:hover {
    background: #ddd;
}

.btn-unlock:active {
    transform: scale(0.98);
}

.btn-unlock svg {
    flex-shrink: 0;
}

/* Settings Divider */
.settings-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* Settings Verification */
.settings-auth-info {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

.btn-verify {
    font-size: 11px;
    font-weight: 400;
    padding: 5px 10px;
    background: none;
    color: #aaa;
    border: 1px solid #666;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-verify:hover {
    color: #ddd;
    border-color: #888;
}

.loading-state {
    text-align: center;
    color: #666;
    padding: 20px;
}

/* Devices Modal */
.devices-count {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.devices-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.device-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 8px;
}

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

.device-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-main);
}

.device-date {
    font-size: 10px;
    color: #666;
}

.device-badge {
    font-size: 9px;
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.device-remove {
    font-size: 10px;
    padding: 4px 8px;
    background: none;
    color: #888;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.device-remove:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* Back Button (Panel 2) */
.back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 4px 0;
    margin-bottom: 12px;
    transition: color 0.15s;
    flex-shrink: 0;
}

.back-btn:hover {
    color: var(--text-main);
}

/* Editor Header */
#editor-header {
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 8px;
    color: var(--text-main);
    flex-shrink: 0;
}

.learn-more-link {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--border);
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
    background: transparent;
    margin-left: auto;
}

.learn-more-link:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Editor Container */
#editor-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Editor Actions (sticky bottom bar) */
.editor-actions {
    display: flex;
    gap: 10px;
    padding: var(--spacing);
    background: var(--bg-app);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

/* Section Labels / Group Headers */
.section-label {
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: default;
    user-select: none;
    flex-shrink: 0;
}

.section-label.foldable {
    cursor: pointer;
    transition: color 0.15s;
}

.section-label.foldable:hover {
    color: var(--text-main);
}

.section-label .fold-arrow {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.25s ease;
    width: 11px;
}

.section-label.collapsed .fold-arrow {
    transform: rotate(-90deg);
}

/* Group Content & Dividers */
.group-content {
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 1;
    flex-shrink: 0;
}

.group-content.collapsed {
    grid-template-rows: 0fr;
    opacity: 0;
    margin-bottom: 0;
}

.group-content-inner {
    overflow: hidden;
}

.group-divider {
    height: 2px;
    background: transparent;
    border-top: 2px solid var(--border);
}

/* Control Items */
.control-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
    flex-shrink: 0;
}

#editor-container>.control-item:last-child {
    margin-bottom: 0;
}

label {
    font-size: 11px;
    color: var(--text-muted);
    font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea,
select {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
}

input[disabled],
textarea[disabled],
select[disabled] {
    opacity: 0.8;
    /* Slightly less opaque for better readability of placeholders */
    cursor: not-allowed;
    background: var(--bg-input);
}

select {
    -webkit-appearance: none;
    appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

input[type="text"]:not(#pack-search):focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
    border-color: var(--accent-main);
    box-shadow: 0 0 10px var(--accent-glow);
}

input[type="text"]::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

textarea {
    resize: vertical;
    font-family: inherit;
    min-height: 80px;
    line-height: 1.5;
}

/* Slider */
.slider-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

input[type=range] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    outline: none;
}

input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.slider-val {
    font-size: 12px;
    font-weight: 700;
    color: var(--accent-main);
    width: 24px;
    text-align: right;
}

/* Toggle Buttons */
.toggle-group {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    width: 100%;
}

.toggle-btn {
    flex: 1;
    padding: 10px 12px;
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}

.toggle-btn.active {
    color: #fff;
}

.toggle-btn:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08);
}

/* Buttons */
.btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.2s, background 0.2s;
}

.btn:disabled {
    opacity: 0.3;
    filter: grayscale(1);
    cursor: not-allowed;
    transform: none !important;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: #fff;
    color: #000;
}

.btn-primary:hover {
    background: #eee;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid var(--border);
}

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

.hidden {
    display: none !important;
}

/* Workflow Description */
.workflow-description {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.workflow-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.workflow-heading {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.workflow-body {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-content {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    width: 100%;
    max-width: 320px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8);
}

.modal-content h2 {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.modal-content p {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
}

.modal-inputs {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.modal-actions .btn {
    flex: 1;
}

/* Announcement Modal Specifics */
.announcement-content {
    max-width: 360px;
    padding: 0;
    overflow: hidden;
    gap: 0;
}

.announcement-header {
    background: linear-gradient(135deg, #bc1b28 0%, #610c1f 100%);
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.announcement-header h2 {
    margin: 0;
    font-size: 14px;
    color: #fff;
}

.announcement-header svg {
    margin-top: 4px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.announcement-.ext-body {
    padding: 24px;
}

.announcement-text {
    font-size: 14px;
    color: var(--text-main);
    line-height: 1.6;
    margin-bottom: 16px;
}

.announcement-link-btn {
    display: block;
    width: 100%;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-main);
    text-decoration: none;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}

.announcement-link-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-main);
}

.announcement-footer {
    padding: 20px 24px;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.announcement-footer .checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 11px;
}

#announcement-close {
    width: auto;
    flex: none;
    padding: 8px 24px;
    font-size: 13px;
    border-radius: 6px;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

/* Only show scrollbar when actively scrolling */
*::-webkit-scrollbar-thumb {
    background: transparent;
}

.is-scrolling::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.lock-icon {
    font-size: 14px;
    margin-right: 4px;
}

/* Custom CSS Tooltips */
[data-tooltip] {
    position: relative;
    cursor: pointer;
}

[data-tooltip]::before,
[data-tooltip]::after {
    position: absolute;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.2s;
    pointer-events: none;
    z-index: 9999;
}

/* Tooltip Body */
[data-tooltip]::before {
    content: attr(data-tooltip);
    background: rgba(10, 10, 10, 0.95);
    color: #fff;
    font-size: 11px;
    font-weight: 500;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--border);
    white-space: pre-line;
    min-width: max-content;
    max-width: 220px;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 8px);
    margin-bottom: 8px;
    /* Spacing from element */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.3px;
}

/* Tooltip Arrow */
[data-tooltip]::after {
    content: '';
    border-width: 5px;
    border-style: solid;
    border-color: var(--border) transparent transparent transparent;
    bottom: 100%;
    left: 50%;
    transform: translate(-50%, 8px);
    margin-bottom: 3px;
}

/* Hover Animation */
[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

/* Optional: Different placements (e.g. data-tooltip-pos="bottom") */
[data-tooltip-pos="bottom"]::before {
    bottom: auto;
    top: 100%;
    transform: translate(-50%, -8px);
    margin-bottom: 0;
    margin-top: 8px;
}

[data-tooltip-pos="bottom"]::after {
    bottom: auto;
    top: 100%;
    border-color: transparent transparent var(--border) transparent;
    transform: translate(-50%, -8px);
    margin-bottom: 0;
    margin-top: 3px;
}

[data-tooltip-pos="bottom"]:hover::before,
[data-tooltip-pos="bottom"]:hover::after {
    transform: translate(-50%, 0);
}