.maker-main {
    max-width: 1400px;
    margin: 0 auto;
    padding: 32px 20px;
    position: relative;
}

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

@media (min-width: 901px) {
    .maker-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

/* ---- Form Section ---- */
.maker-form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.maker-header h1 {
    font-size: 2rem;
    margin-bottom: 8px;
    background: linear-gradient(to right, #ffffff, #a1a1aa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.maker-header p {
    color: var(--text2);
    font-size: 0.95rem;
}

.maker-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.maker-title-row h1 {
    margin-bottom: 0;
}

.showcase-container {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.showcase-video {
    width: 100%;
    height: auto;
    display: block;
}

/* ---- Usage Steps ---- */
.usage-steps {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 24px;
    margin-bottom: 24px;
}

.step {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    gap: 16px;
    align-items: center;
    transition: all 0.3s ease;
}

.step:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.step-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    background: #fff;
    color: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.step-content h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}

.step-content p {
    font-size: 0.85rem;
    color: var(--text3);
    line-height: 1.4;
}

@media (max-width: 600px) {
    .usage-steps {
        grid-template-columns: 1fr;
    }

    .commands-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        text-align: center;
    }

    .ch-left {
        flex-direction: column;
        gap: 12px;
        width: 100%;
        margin-bottom: 8px;
    }

    .ch-actions {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .ch-actions .btn {
        width: 100%;
    }

    .search-mini {
        width: 100%;
    }

    .maker-title-row {
        flex-direction: column;
        gap: 16px;
        align-items: center;
        text-align: center;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.flex-fill {
    flex: 1;
    min-height: 0;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: border-color 0.2s, background 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
}

.field-help {
    font-size: 0.8rem;
    color: var(--text3);
    line-height: 1.4;
    margin-top: -2px;
}

.field-help code {
    background: rgba(255, 255, 255, 0.05);
    padding: 2px 4px;
    border-radius: 4px;
    color: var(--accent);
    font-family: var(--mono);
}

.commands-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.ch-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.search-mini {
    position: relative;
    display: flex;
    align-items: center;
}

.search-mini svg {
    position: absolute;
    left: 12px;
    color: var(--text3);
    pointer-events: none;
}

.search-mini input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px 12px 6px 34px;
    color: var(--text);
    font-size: 0.85rem;
    width: 100%;
    max-width: 200px;
    transition: all 0.2s;
}

.search-mini input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.05);
}

.empty-search {
    padding: 24px;
    text-align: center;
    color: var(--text3);
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed var(--border);
    border-radius: 8px;
}

.commands-header h2 {
    font-size: 1.25rem;
    white-space: nowrap;
}

#add-cmd-btn {
    animation: pulse-button 3s infinite;
}

@keyframes pulse-button {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    70% {
        transform: scale(1.03);
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
    }
}

.commands-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cmd-item {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.cmd-info {
    flex: 1;
    min-width: 0;
}

.cmd-info h4 {
    font-size: 0.95rem;
    margin-bottom: 4px;
    word-break: break-all;
    line-height: 1.4;
}

.cmd-info p {
    font-size: 0.8rem;
    color: var(--text3);
}

.cmd-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ---- Preview Section ---- */
.maker-preview-section {
    position: sticky;
    top: 100px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: calc(100vh - 120px);
    min-width: 0;
}

.sync-banner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(239, 150, 68, 0.1);
    border: 1px solid rgba(239, 150, 68, 0.3);
    color: #fdba74;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
}

.import-area {
    background: rgba(255, 255, 255, 0.02);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 32px;
    display: flex;
    align-items: center;
    gap: 24px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.import-area::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.2s;
}

.import-area:hover::after {
    opacity: 1;
}

.import-area:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.import-icon {
    width: 52px;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: var(--text2);
    transition: all 0.2s;
}

.import-area:hover .import-icon {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.import-text h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: #fff;
}

.import-text p {
    font-size: 0.85rem;
    color: var(--text3);
    line-height: 1.4;
}

.sync-banner.hidden {
    display: none;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

#ide-mode-toggle {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#ide-mode-toggle svg {
    transition: transform 0.3s;
}

.monaco-container {
    flex: 1;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: #1e1e1e;
    /* Monaco default dark */
}

.small-monaco {
    min-height: 250px;
}

/* ---- Drop Zone ---- */
.drop-zone {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.drop-zone.hidden {
    display: none;
}

.drop-zone-content {
    border: 3px dashed var(--text2);
    border-radius: 24px;
    padding: 64px;
    text-align: center;
    color: var(--text);
    pointer-events: none;
    transition: all 0.2s;
}

.drop-zone-content svg {
    margin-bottom: 16px;
    color: var(--text2);
}

.drop-zone-content h3 {
    font-size: 2rem;
    margin-bottom: 8px;
}

.drop-zone-content p {
    color: var(--text3);
    font-size: 1.1rem;
}

/* ---- Modals ---- */
.cmd-editor-modal {
    width: 95%;
    max-width: 1200px;
    height: 90vh;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.overlay.expanded {
    padding: 0;
}

.overlay.expanded .cmd-editor-modal {
    max-width: 100%;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
    border: none;
}

.modal-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text2);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.15s;
    line-height: 1;
    padding: 4px;
}

.close-btn:hover {
    color: #fff;
}

.cmd-modal-content {
    flex: 1;
    overflow-y: hidden;
    /* Container doesn't scroll, columns do */
    padding: 0;
    display: flex;
    flex-direction: column;
}

.modal-fields-sidebar {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
}

.modal-editor-main {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    border-left: 1px solid var(--border);
    flex: 1;
}

.modal-editor-main .form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.modal-editor-main .monaco-container {
    flex: 1;
    min-height: 400px;
}

@media (min-width: 900px) {
    .cmd-modal-content {
        flex-direction: row;
    }

    .modal-fields-sidebar {
        width: 380px;
        flex-shrink: 0;
    }
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* Buttons */
.btn {
    height: 38px;
    padding: 0 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    line-height: 1;
}

.btn-sm {
    height: 28px;
    padding: 0 10px;
    font-size: 0.8rem;
}

.btn-icon {
    width: 38px;
    padding: 0;
    flex-shrink: 0;
}

.btn-icon.btn-sm {
    width: 28px;
    padding: 0;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
}

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-color: var(--border);
}

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

.btn-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-success {
    background: rgba(34, 197, 94, 0.1);
    color: #4ade80;
    border-color: rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

/* ---- Responsive ---- */
/* ---- Tutorial Button Enhancements ---- */
.tour-launcher {
    display: flex;
    align-items: center;
    gap: 12px;
}

#start-tour-btn {
    position: relative;
    overflow: hidden;
    animation: btn-glow-pulse 3s infinite ease-in-out;
}


.btn-arrow {
    display: inline-block;
    font-size: 1.4rem;
    color: #fff;
    line-height: 1;
    animation: arrow-bounce-x 1s infinite ease-in-out;
}

@keyframes arrow-bounce-x {

    0%,
    100% {
        transform: translateX(0);
    }

    50% {
        transform: translateX(4px);
    }
}

@keyframes btn-glow-pulse {

    0%,
    100% {
        box-shadow: 0 0 0 rgba(255, 255, 255, 0);
    }

    50% {
        box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
    }
}


/* ---- Tour Overlay ---- */
.tour-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    pointer-events: none;
    transition: opacity 0.3s;
}

.tour-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.tour-spotlight {
    position: absolute;
    border-radius: 12px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.85);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10001;
    pointer-events: none;
}

.tour-card {
    position: absolute;
    width: 320px;
    background: #161618;
    border: 1px solid #333;
    border-radius: 16px;
    padding: 20px;
    z-index: 10002;
    pointer-events: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.tour-card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #fff;
}

.tour-card-content p {
    font-size: 0.9rem;
    color: #aaa;
    line-height: 1.5;
    margin-bottom: 20px;
}

.tour-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #333;
    padding-top: 16px;
}

#tour-progress {
    font-size: 0.8rem;
    color: #666;
    font-weight: 600;
}

.tour-btns {
    display: flex;
    gap: 8px;
}

/* ---- IDE Mode ---- */
body.ide-mode {
    overflow: hidden;
    height: 100vh;
}

body.ide-mode header {
    display: none;
}

body.ide-mode .maker-main {
    max-width: 100%;
    margin: 0;
    padding: 0;
    height: 100vh;
}

body.ide-mode .maker-container {
    display: grid;
    grid-template-columns: 450px 1fr;
    height: 100vh;
    gap: 0;
}

body.ide-mode .maker-form-section {
    height: 100vh;
    overflow-y: auto;
    padding: 48px;
    background: #0f0f11;
    border-right: 1px solid var(--border);
}

body.ide-mode .maker-preview-section {
    position: relative;
    top: 0;
    height: 100vh;
    padding: 48px;
    background: #161618;
}

body.ide-mode #ide-mode-toggle {
    background: #333;
    color: #fff;
    border-color: #444;
    padding: 6px 16px;
    min-width: 110px;
}

body.ide-mode #ide-mode-toggle svg {
    transform: rotate(180deg);
}

/* Responsive tweaks */
@media (max-width: 1200px) {
    body.ide-mode .maker-container {
        grid-template-columns: 380px 1fr;
    }
}

@media (max-width: 900px) {
    #ide-mode-toggle {
        display: none !important;
    }

    .maker-main {
        padding: 24px 16px;
    }

    .maker-preview-section {
        position: static;
        height: auto;
        min-height: 50vh;
    }

    .monaco-container {
        min-height: 400px;
    }

    body.ide-mode .maker-container {
        grid-template-columns: 1fr;
        overflow-y: auto;
    }

    body.ide-mode .maker-form-section,
    body.ide-mode .maker-preview-section {
        height: auto;
        padding: 24px 16px;
    }
}

@media (max-width: 600px) {
    .maker-header h1 {
        font-size: 1.75rem;
    }

    .ch-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .search-mini {
        width: 100%;
    }

    .search-mini input {
        max-width: 100%;
    }
}

/* Navigation Highlight */
.editor-goto-highlight {
    background: rgba(255, 255, 0, 0.15) !important;
    border-left: 4px solid #facc15 !important;
}

/* Mobile Warning */
.mobile-warning {
    display: none;
    background: rgba(239, 150, 68, 0.1);
    border: 1px solid rgba(239, 150, 68, 0.2);
    color: #fbbf24;
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    line-height: 1.4;
}

@media (max-width: 900px) {
    .mobile-warning {
        display: flex;
    }
}

/* UI Toggles & Link Buttons */
.maker-subtitle-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}

.btn-link {
    background: none;
    border: none;
    color: var(--cyan);
    font-size: 0.85rem;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
    white-space: nowrap;
}

.btn-link:hover {
    color: #fff;
}

.btn-link-sm {
    background: none;
    border: none;
    color: var(--text3);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.2s;
}

.btn-link-sm:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.section-header-mini {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.section-header-mini span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text3);
}

.hide-section-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    font-size: 1.2rem;
    line-height: 1;
}

.hide-section-btn:hover {
    background: #ef4444;
    border-color: #ef4444;
    transform: scale(1.1);
}

/* Store Browser Modal Styling */
.store-modal {
    max-width: 900px;
    height: 80vh;
    display: flex;
    flex-direction: column;
}

.store-modal-search {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.store-modal-search input {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
}

.store-modal-search input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.1);
}

.store-modal-content {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
    background: #000;
    align-content: start;
}

/* Fix for card squishing */
.store-modal-content .card {
    background: #0a0a0c;
    border-color: rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    min-height: 200px;
    width: 100%;
}

.store-modal-content .card:hover {
    background: #111114;
    border-color: rgba(255, 255, 255, 0.2);
}

/* Hide tour launcher and header in IDE mode to save space */
body.ide-mode .tour-launcher,
body.ide-mode .maker-header {
    display: none !important;
}

.store-modal-content .remix-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.store-modal-content .card:hover .remix-badge {
    background: #fff;
    color: #000;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 64px;
    color: var(--text3);
    font-size: 1rem;
}

.hidden {
    display: none !important;
}

.btn-link-inline {
    transition: all 0.2s;
}

.btn-link-inline:hover {
    color: #fff !important;
}
/* ---- Loader UI (Minimalistic Discovery Card) ---- */
.loader-ui {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #121214;
    border: 1px solid rgba(74, 222, 128, 0.2);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-radius: 12px;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 1000;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
    pointer-events: none;
}

.loader-ui.active {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.loader-ui-icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 10px;
    color: #4ade80;
}

.loader-ui-content {
    flex: 1;
}

.loader-ui-content h4 {
    font-size: 0.9rem;
    color: #fff;
    margin-bottom: 2px;
}

.loader-ui-content p {
    font-size: 0.75rem;
    color: #888;
}

.loader-ui-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 8px;
}

.loader-ui-actions .btn {
    padding: 6px 14px;
    font-size: 0.8rem;
}

.loader-shimmer {
    background: linear-gradient(90deg, transparent, rgba(74, 222, 128, 0.1), transparent);
    background-size: 200% 100%;
    animation: loader-shimmer 1.5s infinite;
}

@keyframes loader-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}
