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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0a0a0f;
    color: #e5e5e5;
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

body.app-mode {
    overflow: hidden;
    height: 100vh;
}

/* Dark scrollbar */
::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #374151;
    border-radius: 6px;
    border: 2px solid #0a0a0f;
}

::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #374151 #0a0a0f;
}

.header {
    background: #0f0f16;
    border-bottom: 1px solid #2a2a35;
    padding: 1rem 0;
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 100;
    flex-shrink: 0;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 36px;
    width: auto;
    object-fit: contain;
}

.logo-text h1 {
    font-size: 1.35rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.2;
}

.logo-text p {
    font-size: 0.875rem;
    color: #9ca3af;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.login-btn {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    height: 44px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.5), rgba(31, 41, 55, 0.5));
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #374151;
    height: 44px;
}

.user-info:hover {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.7), rgba(31, 41, 55, 0.7));
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #f59e0b;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #e5e5e5;
}

.user-dropdown {
    position: relative;
}

.user-info-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.5), rgba(31, 41, 55, 0.5));
    border: 1px solid #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #e5e5e5;
    font-size: 0.875rem;
    font-weight: 500;
    white-space: nowrap;
}

.user-info-btn:hover {
    border-color: rgba(251, 191, 36, 0.5);
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.7), rgba(31, 41, 55, 0.7));
}

.user-info-btn svg {
    width: 16px;
    height: 16px;
    stroke: #9ca3af;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    left: 0;
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1000;
}

.dropdown-menu.active {
    display: block;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d1d5db;
    font-size: 0.875rem;
}

.dropdown-item:hover {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
}

.dropdown-item.upgrade-item {
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.25);
    color: #fbbf24;
    font-weight: 500;
}

.dropdown-item.upgrade-item:hover {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.4);
}

.dropdown-item.upgrade-item svg:last-child {
    opacity: 0.5;
    width: 12px;
    height: 12px;
}

.dropdown-divider {
    height: 1px;
    background: #374151;
    margin: 0.5rem 0;
}


.container {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gallery-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #0f0f16;
    overflow: hidden;
}


/* New Page Button */
.new-page-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.new-page-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.new-page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

/* Gallery Panel */

.gallery-header {
    background: #0f0f16;
    border-bottom: 1px solid #2a2a35;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.gallery-header h3 {
    color: #e5e5e5;
    font-size: 1rem;
    font-weight: 600;
}

.gallery-count {
    background: rgba(251, 191, 36, 0.1);
    color: #f59e0b;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
    font-weight: 500;
}

.gallery-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 0;
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    color: #6b7280;
}

.gallery-empty svg {
    width: 64px;
    height: 64px;
    stroke: #374151;
    margin-bottom: 1rem;
}

.gallery-empty h4 {
    font-size: 1.125rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
}

.gallery-empty p {
    font-size: 0.875rem;
    color: #6b7280;
}

.pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.page-card {
    background: linear-gradient(135deg, rgba(55, 65, 81, 0.3), rgba(31, 41, 55, 0.3));
    border: 1px solid #374151;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.page-card:hover {
    border-color: rgba(251, 191, 36, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(251, 191, 36, 0.15);
}

.page-thumbnail {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #1a1a24;
    position: relative;
    overflow: hidden;
}

.page-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.page-thumbnail-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a24, #0a0a0f);
}

.page-thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
    stroke: #374151;
    opacity: 0.5;
}

.page-info {
    padding: 1rem;
}

.page-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e5e5;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-date {
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 1rem;
}

.page-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.page-btn {
    background: #1a1a24;
    border: 1px solid #374151;
    color: #d1d5db;
    padding: 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    position: relative;
}

.page-btn:hover {
    background: #2a2a35;
    border-color: #f59e0b;
}

.page-btn.delete {
    color: #ef4444;
}

.page-btn.delete:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
}

.page-btn svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.edit-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 2rem;
}

.edit-modal.active {
    display: flex;
}

.edit-modal-content {
    background: #0f0f16;
    border: 1px solid #374151;
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.edit-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #2a2a35;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.edit-modal-header h3 {
    font-size: 1.25rem;
    color: #e5e5e5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.edit-modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: all 0.2s;
}

.edit-modal-close:hover {
    background: rgba(156, 163, 175, 0.1);
    color: #e5e5e5;
}

.edit-modal-body {
    padding: 1.5rem;
}

.edit-field {
    margin-bottom: 1.5rem;
}

.edit-field label {
    display: block;
    color: #9ca3af;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.edit-field input,
.edit-field textarea {
    width: 100%;
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 0.75rem;
    color: #e5e5e5;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
}

.edit-field input[type="color"] {
    height: 50px;
    cursor: pointer;
}

.edit-field input:focus,
.edit-field textarea:focus {
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.1);
}

.edit-field textarea {
    resize: vertical;
    min-height: 100px;
}

.color-preview {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
}

.color-item {
    flex: 1;
}

.color-swatch {
    width: 100%;
    height: 60px;
    border-radius: 8px;
    border: 2px solid #374151;
    margin-bottom: 0.5rem;
}

.edit-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #2a2a35;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.modal-btn.cancel {
    background: #1a1a24;
    color: #9ca3af;
    border: 1px solid #374151;
}

.modal-btn.cancel:hover {
    background: #2a2a35;
    color: #e5e5e5;
}

.modal-btn.primary {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
}

.modal-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(245, 158, 11, 0.3);
}

.modal-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.page-card-loading {
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: #0a0a0f;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 50;
}

.page-card-loading.active {
    display: flex;
}

.card-loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid #374151;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.card-loading-text {
    color: #d1d5db;
    font-size: 0.875rem;
    text-align: center;
    font-weight: 500;
}

.card-loading-steps {
    color: #6b7280;
    font-size: 0.75rem;
    text-align: center;
    max-width: 200px;
}

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

/* Hidden iframe for screenshot generation */
#screenshotFrame {
    position: fixed;
    top: -9999px;
    left: -9999px;
    width: 1200px;
    height: 800px;
    border: none;
}

/* ── Responsive: Tablet ── */
@media (max-width: 768px) {
    .pages-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 1rem;
    }

    .header-content {
        padding: 0 0.75rem;
    }

    .logo-text h1 {
        font-size: 1.15rem;
    }

    .logo-text p {
        display: none;
    }

    .gallery-content {
        padding: 1rem;
    }

    .gallery-header {
        padding: 0.75rem 1rem;
    }
}

/* ── Responsive: Mobile ── */
@media (max-width: 480px) {
    .header {
        padding: 0.625rem 0;
    }

    .header-content {
        padding: 0 0.625rem;
        gap: 0.5rem;
    }

    .logo-img {
        height: 28px;
    }

    .logo-section {
        gap: 0.5rem;
    }

    .logo-text h1 {
        font-size: 1rem;
    }

    .login-btn {
        padding: 0.4rem 0.875rem;
        font-size: 0.8rem;
        height: 36px;
    }

    .user-info-btn {
        padding: 0.35rem 0.625rem;
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .user-info-btn .user-avatar {
        width: 26px;
        height: 26px;
    }

    .user-info-btn .user-name {
        display: none;
    }

    .gallery-header {
        flex-direction: column;
        align-items: stretch;
        gap: 0.625rem;
        padding: 0.75rem;
    }

    .gallery-header h3 {
        font-size: 0.9rem;
    }

    .gallery-header > div {
        justify-content: space-between;
    }

    .gallery-content {
        padding: 0.75rem;
    }

    .pages-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .page-card {
        border-radius: 10px;
    }

    .page-card:hover {
        transform: none;
        box-shadow: none;
    }

    .page-thumbnail {
        aspect-ratio: 16 / 9;
    }

    .page-info {
        padding: 0.75rem;
    }

    .page-title {
        font-size: 0.8rem;
    }

    .page-date {
        margin-bottom: 0.625rem;
    }

    .page-actions {
        grid-template-columns: repeat(4, 1fr);
        gap: 0.375rem;
    }

    .page-btn {
        padding: 0.4rem 0.25rem;
        font-size: 0;
        justify-content: center;
    }

    .page-btn svg {
        width: 16px;
        height: 16px;
    }

    .new-page-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }

    .gallery-count {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }

    /* Modals */
    .modal-content {
        margin: 0.5rem;
        max-height: 95vh;
    }

    .dropdown-menu {
        right: -0.5rem;
        left: auto;
        min-width: 180px;
    }
}

/* Pricing Cards */
.pricing-card {
    position: relative;
    background: linear-gradient(135deg, rgba(31, 41, 55, 0.5), rgba(17, 24, 39, 0.5));
    border: 2px solid #374151;
    border-radius: 12px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s;
}

.pricing-card:hover {
    transform: translateY(-2px);
    border-color: rgba(245, 158, 11, 0.5);
}

.pricing-card.selected {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(234, 88, 12, 0.1));
    border-color: #fbbf24;
    box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.2);
}

.popular-badge {
    position: absolute;
    top: -10px;
    right: 1rem;
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

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

/* Landing Page Styles */
.landing-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.landing-page.hidden {
    display: none;
}

#mainApp {
    display: none;
}

#mainApp.active {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

#mainApp .header {
    flex-shrink: 0;
}

#mainApp .container {
    flex: 1;
    overflow: hidden;
}

#mainApp footer {
    flex-shrink: 0;
}

.landing-hero {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 6rem 2rem;
    text-align: center;
    background: #0a0a0f;
    position: relative;
    overflow: hidden;
}

.landing-hero::before {
    content: '';
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(251,191,36,0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 1;
}

.landing-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10,10,15,0.3) 0%, rgba(10,10,15,0.65) 60%, rgba(10,10,15,0.92) 100%);
    pointer-events: none;
    z-index: 1;
}

.landing-hero h1 {
    font-size: 3.75rem;
    font-weight: 900;
    color: #ffffff;
    margin-bottom: 1.25rem;
    line-height: 1.08;
    letter-spacing: -0.03em;
    max-width: 700px;
    position: relative;
    z-index: 2;
}

.landing-hero h1 .highlight {
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.landing-hero p {
    font-size: 1.2rem;
    color: #d1d5db;
    margin-bottom: 2.5rem;
    max-width: 540px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.7;
    position: relative;
    z-index: 2;
}

.landing-cta {
    display: inline-block;
    padding: 1rem 2.5rem;
    background: linear-gradient(135deg, #fbbf24, #f59e0b);
    color: #0a0a0f;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s;
    position: relative;
    letter-spacing: 0.01em;
    z-index: 2;
}

.landing-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(251, 191, 36, 0.3);
}

.landing-cta-hint {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: #6b7280;
    position: relative;
    z-index: 2;
}

/* Mosaic Background */
.landing-mosaic {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 300vw;
    height: 300vh;
    transform: translate(-50%, -50%) rotate(-12deg);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

.landing-mosaic-track {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    height: 100%;
    justify-content: center;
}

.landing-mosaic-row {
    display: flex;
    gap: 2rem;
    width: max-content;
    animation: mosaicScroll 40s linear infinite;
}

.landing-mosaic-row:nth-child(even) {
    animation-direction: reverse;
}

.landing-mosaic-row img {
    width: 60vw;
    min-width: 700px;
    max-width: 1000px;
    height: auto;
    border-radius: 14px;
    flex-shrink: 0;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
}

@keyframes mosaicScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* How It Works */
.landing-steps {
    background: #0a0a0f;
    padding: 5rem 2rem;
}

.landing-steps h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.landing-steps > p {
    text-align: center;
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 3.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.landing-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    max-width: 960px;
    margin: 0 auto;
}

.landing-step {
    text-align: center;
    padding: 2rem 1.5rem;
    background: #111827;
    border-radius: 16px;
    border: 1px solid #1f2937;
    transition: border-color 0.3s;
}

.landing-step:hover {
    border-color: #374151;
}

.landing-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(251,191,36,0.15), rgba(245,158,11,0.05));
    color: #fbbf24;
    font-weight: 800;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.landing-step h3 {
    color: #f1f5f9;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.landing-step p {
    color: #9ca3af;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Features */
.landing-features {
    background: #111827;
    padding: 5rem 2rem;
}

.landing-features h2 {
    text-align: center;
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.landing-features > p {
    text-align: center;
    color: #6b7280;
    font-size: 1.05rem;
    margin-bottom: 3.5rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.landing-features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    max-width: 960px;
    margin: 0 auto;
}

.landing-feature {
    padding: 1.75rem;
    background: #0f172a;
    border-radius: 14px;
    border: 1px solid #1e293b;
}

.landing-feature-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(251,191,36,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

.landing-feature-icon svg {
    width: 20px;
    height: 20px;
    stroke: #fbbf24;
    fill: none;
    stroke-width: 2;
}

.landing-feature h3 {
    color: #f1f5f9;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.landing-feature p {
    color: #9ca3af;
    font-size: 0.85rem;
    line-height: 1.6;
}

/* Bottom CTA */
.landing-bottom-cta {
    background: #0a0a0f;
    padding: 5rem 2rem;
    text-align: center;
}

.landing-bottom-cta h2 {
    font-size: 2.25rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.landing-bottom-cta p {
    color: #9ca3af;
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

/* Shared footer */
.landing-footer {
    background: #0a0a0f;
    border-top: 1px solid #1f2937;
    padding: 1.5rem 2rem;
    text-align: center;
    font-size: 0.8rem;
    color: #6b7280;
}

.landing-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

/* Landing Header */
.landing-header {
    padding: 1.25rem 2rem;
    border-bottom: 1px solid #1f2937;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10,10,15,0.95);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.landing-header .login-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
}

.landing-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem;
}

.landing-section h2 {
    font-size: 2rem;
    text-align: center;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 3rem;
}

.example-preview {
    background: #111827;
    border: 1px solid #1f2937;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.example-preview:hover {
    border-color: #374151;
    transform: translateY(-4px);
}

.example-preview .preview-image {
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #1f2937, #111827);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #fbbf24;
    font-weight: 600;
    border-bottom: 1px solid #1f2937;
}

.example-preview h3 {
    padding: 1.25rem;
    color: #e5e5e5;
    font-size: 1rem;
    text-align: center;
    font-weight: 600;
    background: #111827;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.feature-item {
    text-align: center;
    padding: 1.5rem;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.feature-item h3 {
    color: #e5e5e5;
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-item p {
    color: #9ca3af;
    font-size: 0.875rem;
}

.pricing-comparison {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 800px;
    margin: 0 auto 3rem;
}

.pricing-plan {
    background: #111827;
    border: 2px solid #1f2937;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s;
}

.pricing-plan:hover {
    border-color: #374151;
    transform: translateY(-4px);
}

.pricing-plan.premium {
    border-color: #fbbf24;
    background: #111827;
}

.pricing-plan .badge {
    display: inline-block;
    background: #fbbf24;
    color: #0a0a0f;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.pricing-plan h3 {
    font-size: 1.5rem;
    color: #e5e5e5;
    margin-bottom: 1rem;
    font-weight: 600;
}

.pricing-plan .price {
    font-size: 3rem;
    font-weight: 700;
    color: #fbbf24;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.pricing-plan .period {
    color: #9ca3af;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.pricing-plan ul {
    list-style: none;
    padding: 0;
    margin-bottom: 1.5rem;
}

.pricing-plan li {
    padding: 0.6rem 0;
    color: #d1d5db;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .landing-header {
        padding: 0.75rem 1rem;
    }
    .landing-header .logo-text h1 {
        font-size: 1.1rem !important;
    }
    .landing-header .login-btn {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }

    .landing-hero {
        padding: 3rem 1.5rem;
    }
    
    .landing-hero h1 {
        font-size: 2rem;
    }
    
    .landing-hero p {
        font-size: 1rem;
    }
    
    .landing-cta {
        padding: 0.9rem 2rem;
        font-size: 0.95rem;
    }

    .landing-mosaic-row img {
        width: 70vw;
        min-width: 280px;
        max-width: 400px;
    }

    .landing-footer {
        padding: 1.25rem 1rem;
    }
    .landing-footer-inner {
        flex-direction: column;
        gap: 0.5rem;
    }
    .landing-footer-inner span[style*="color: #374151"] {
        display: none;
    }
}

@media (max-width: 400px) {
    .landing-header .logo-text h1 {
        font-size: 0.95rem !important;
    }
    .landing-header .login-btn {
        padding: 0.45rem 0.75rem;
        font-size: 0.75rem;
    }
    .landing-hero h1 {
        font-size: 1.65rem;
    }
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    min-width: 300px;
    max-width: 450px;
    pointer-events: auto;
    animation: toastSlideIn 0.3s ease;
}

.toast.hiding {
    animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(100%); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes toastSlideOut {
    from { opacity: 1; transform: translateX(0); }
    to { opacity: 0; transform: translateX(100%); }
}

.toast-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.toast-icon svg {
    width: 100%;
    height: 100%;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
}

.toast-message {
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.4;
}

.toast-close {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.toast-close:hover {
    background: rgba(255,255,255,0.1);
    color: #e5e5e5;
}

.toast.success { border-color: #10b981; }
.toast.success .toast-icon { color: #10b981; }
.toast.success .toast-title { color: #10b981; }

.toast.error { border-color: #ef4444; }
.toast.error .toast-icon { color: #ef4444; }
.toast.error .toast-title { color: #ef4444; }

.toast.warning { border-color: #f59e0b; }
.toast.warning .toast-icon { color: #f59e0b; }
.toast.warning .toast-title { color: #f59e0b; }

.toast.info { border-color: #3b82f6; }
.toast.info .toast-icon { color: #3b82f6; }
.toast.info .toast-title { color: #3b82f6; }

/* Confirm Modal */
.confirm-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.confirm-modal.active {
    display: flex;
}

.confirm-modal-content {
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    animation: modalZoomIn 0.2s ease;
}

@keyframes modalZoomIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.confirm-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.confirm-modal-icon.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.confirm-modal-icon.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.confirm-modal-icon.info {
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
}

.confirm-modal-icon svg {
    width: 28px;
    height: 28px;
}

.confirm-modal-title {
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
    color: #e5e5e5;
}

.confirm-modal-message {
    font-size: 15px;
    color: #9ca3af;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 28px;
}

.confirm-modal-buttons {
    display: flex;
    gap: 12px;
}

.confirm-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.confirm-modal-btn.cancel {
    background: #374151;
    color: #e5e5e5;
}

.confirm-modal-btn.cancel:hover {
    background: #4b5563;
}

.confirm-modal-btn.confirm {
    background: #ef4444;
    color: white;
}

.confirm-modal-btn.confirm:hover {
    background: #dc2626;
}

.confirm-modal-btn.confirm.warning {
    background: #f59e0b;
}

.confirm-modal-btn.confirm.warning:hover {
    background: #d97706;
}

.confirm-modal-btn.confirm.info {
    background: #3b82f6;
}

.confirm-modal-btn.confirm.info:hover {
    background: #2563eb;
}

.name-modal-input {
    width: 100%;
    background: #0f1117;
    border: 1px solid #374151;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 15px;
    color: #e5e5e5;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.name-modal-input:focus {
    border-color: #f59e0b;
}

.editor-input {
    width: 100%;
    background: #0f1117;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.875rem;
    color: #e5e5e5;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.editor-input:focus {
    border-color: #f59e0b;
}

.editor-range {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: #1f2937;
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.editor-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 2px solid #0a0a0f;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}
.editor-range::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #f59e0b;
    cursor: pointer;
    border: 2px solid #0a0a0f;
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

/* Backend Modal Styles */
.backend-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.backend-modal.active {
    display: flex;
}

.backend-modal-content {
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    animation: modalZoomIn 0.2s ease;
}

.backend-modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.backend-modal-header svg {
    width: 32px;
    height: 32px;
    color: #f59e0b;
}

.backend-modal-header h3 {
    font-size: 20px;
    font-weight: 700;
    color: #e5e5e5;
}

.backend-form-group {
    margin-bottom: 20px;
}

.backend-form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #d1d5db;
    font-size: 14px;
}

.backend-form-group input {
    width: 100%;
    padding: 14px 16px;
    background: #0a0a0f;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e5e5;
    font-size: 15px;
    transition: border-color 0.2s;
}

.backend-form-group input:focus {
    outline: none;
    border-color: #f59e0b;
}

.backend-form-group input::placeholder {
    color: #6b7280;
}

.backend-form-group small {
    display: block;
    margin-top: 6px;
    color: #6b7280;
    font-size: 12px;
}

.backend-checkbox-group {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(245, 158, 11, 0.05);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 8px;
    margin-bottom: 24px;
}

.backend-checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #f59e0b;
}

.backend-checkbox-group label {
    color: #d1d5db;
    font-size: 14px;
    cursor: pointer;
}

.backend-modal-buttons {
    display: flex;
    gap: 12px;
}

.backend-modal-btn {
    flex: 1;
    padding: 14px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.backend-modal-btn.cancel {
    background: #374151;
    color: #e5e5e5;
}

.backend-modal-btn.cancel:hover {
    background: #4b5563;
}

.backend-modal-btn.generate {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
}

.backend-modal-btn.generate:hover {
    background: linear-gradient(135deg, #d97706, #dc2626);
}

.backend-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ==========================================
   VISUAL EDITOR STYLES
   ========================================== */

.visual-editor {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0a0a0f;
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.visual-editor.active {
    display: flex;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: #0f0f16;
    border-bottom: 1px solid #2a2a35;
    flex-shrink: 0;
}

.editor-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.editor-back-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e5e5;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.editor-back-btn:hover {
    background: #1f1f2e;
    border-color: #4b5563;
}

.editor-back-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.editor-title {
    font-size: 1rem;
    font-weight: 600;
    color: #e5e5e5;
}

.editor-header-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.editor-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
}

.editor-btn.secondary {
    background: #1f1f2e;
    color: #e5e5e5;
    border: 1px solid #374151;
}

.editor-btn.secondary:hover {
    background: #2a2a3a;
}

.editor-btn.primary {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
}

.editor-btn.primary:hover {
    opacity: 0.9;
}

.editor-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#undoBtn, #redoBtn {
    background: transparent;
    color: #9ca3af;
    padding: 0.4rem 0.5rem;
    border: 1px solid #374151;
}
#undoBtn:hover:not(:disabled), #redoBtn:hover:not(:disabled) {
    background: #1f1f2e;
    color: #e5e5e5;
}

.editor-mobile-block {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: #0f172a;
    color: #f1f5f9;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    gap: 1.5rem;
}
.editor-mobile-block svg {
    width: 64px;
    height: 64px;
    stroke: #f59e0b;
    fill: none;
    stroke-width: 1.5;
}
.editor-mobile-block h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}
.editor-mobile-block p {
    color: #94a3b8;
    font-size: 1rem;
    max-width: 320px;
    line-height: 1.6;
    margin: 0;
}
.editor-mobile-block button {
    background: linear-gradient(135deg, #f59e0b, #ea580c);
    color: white;
    border: none;
    padding: 0.75rem 2rem;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 0.5rem;
}
@media (max-width: 768px) {
    .editor-mobile-block { display: flex; }
}

.editor-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.editor-sidebar {
    width: 320px;
    background: #0f0f16;
    border-right: 1px solid #2a2a35;
    overflow-y: auto;
    flex-shrink: 0;
}

.editor-sidebar-section {
    border-bottom: 1px solid #2a2a35;
}

.editor-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    cursor: pointer;
    transition: background 0.2s;
}

.editor-sidebar-header:hover {
    background: rgba(255, 255, 255, 0.02);
}

.editor-sidebar-header h4 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #e5e5e5;
    margin: 0;
}

.editor-sidebar-header h4 svg {
    width: 18px;
    height: 18px;
    stroke: #f59e0b;
    fill: none;
    stroke-width: 2;
}

.editor-sidebar-header .chevron {
    width: 16px;
    height: 16px;
    stroke: #6b7280;
    fill: none;
    stroke-width: 2;
    transition: transform 0.2s;
}

.editor-sidebar-section.open .chevron {
    transform: rotate(180deg);
}

.editor-sidebar-content {
    padding: 0 1.25rem 1.25rem;
    display: none;
}

.editor-sidebar-section.open .editor-sidebar-content {
    display: block;
}

.editor-field {
    margin-bottom: 1rem;
}

.editor-field:last-child {
    margin-bottom: 0;
}

.editor-field label {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.editor-color-palettes {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.editor-palette {
    display: flex;
    gap: 2px;
    padding: 6px;
    background: #1a1a24;
    border: 2px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.editor-palette:hover {
    border-color: #6b7280;
    transform: scale(1.05);
}

.editor-palette.active {
    border-color: #f59e0b;
    box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.3);
}

.editor-palette span {
    width: 12px;
    height: 24px;
    border-radius: 3px;
}

.editor-palette span:first-child {
    border-radius: 3px 0 0 3px;
}

.editor-palette span:last-child {
    border-radius: 0 3px 3px 0;
}

.editor-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.editor-toggle-label {
    font-size: 0.875rem;
    color: #d1d5db;
}

.editor-toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: #374151;
    border-radius: 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.editor-toggle-switch.active {
    background: #f59e0b;
}

.editor-toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
}

.editor-toggle-switch.active::after {
    transform: translateX(20px);
}

.editor-select {
    width: 100%;
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: #e5e5e5;
    font-size: 0.875rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding-right: 2.5rem;
}

.editor-select:focus {
    outline: none;
    border-color: #f59e0b;
}

.editor-section-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.editor-section-item {
    display: flex;
    flex-direction: column;
    background: #1a1a24;
    border: 1px solid #374151;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.15s, opacity 0.15s, box-shadow 0.15s;
}

.editor-section-item.dragging {
    opacity: 0.4;
    transform: scale(0.96);
}

.editor-section-item.drag-over {
    border-color: #f59e0b;
    box-shadow: 0 0 0 1px #f59e0b;
}

.editor-section-drag-handle {
    cursor: grab;
    padding: 0 4px;
    display: flex;
    align-items: center;
    color: #4b5563;
    transition: color 0.2s;
}

.editor-section-drag-handle:hover {
    color: #9ca3af;
}

.editor-section-drag-handle:active {
    cursor: grabbing;
}

.editor-section-drag-handle svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    stroke: none;
}

.editor-section-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
}

.editor-section-item-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.editor-section-item-left:hover {
    opacity: 0.8;
}

.editor-section-item-left svg {
    width: 16px;
    height: 16px;
    stroke: #9ca3af;
    fill: none;
    stroke-width: 2;
}

.editor-section-item-name {
    font-size: 0.875rem;
    color: #e5e7eb;
    font-weight: 500;
}

.editor-sidebar-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: transparent;
    border: 1px solid #374151;
    border-radius: 8px;
    color: #e5e5e5;
    cursor: pointer;
    transition: all 0.2s;
}
.editor-sidebar-toggle:hover { background: #1f1f2e; }
.editor-sidebar-toggle svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.editor-sidebar-overlay {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 9;
}

@media (max-width: 1024px) {
    .editor-sidebar-toggle { display: flex; }
    .editor-header { padding: 0.75rem 1rem; }
    .editor-header-left { gap: 0.5rem; }
    .editor-title { font-size: 0.85rem; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .editor-body { position: relative; }
    .editor-sidebar {
        position: absolute;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 10;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
        box-shadow: none;
    }
    .editor-sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    }
    .editor-sidebar.open ~ .editor-sidebar-overlay {
        display: block;
    }
}

@media (max-width: 640px) {
    .editor-sidebar { width: 100%; }
    .editor-responsive-toggle { display: none; }
    .editor-back-btn { font-size: 0; padding: 0.5rem; }
    .editor-back-btn svg { width: 20px; height: 20px; }
}

.editor-preview {
    flex: 1;
    background: #1a1a24;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.editor-preview-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    transition: width 0.3s ease;
}

.editor-preview-frame.tablet-view {
    width: 768px;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: 0 0 0 1px #2a2a3e;
}

.editor-preview-frame.mobile-view {
    width: 375px;
    max-width: 100%;
    height: 100%;
    border-radius: 0;
    box-shadow: 0 0 0 1px #2a2a3e;
}

.editor-responsive-toggle {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #1a1a2e;
    border-radius: 8px;
    padding: 3px;
    border: 1px solid #2a2a3e;
}

.editor-responsive-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-responsive-btn:hover { color: #e5e5e5; background: #2a2a3e; }
.editor-responsive-btn.active { color: #f59e0b; background: #2a2a3e; }

.editor-responsive-btn svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.editor-preview-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #9ca3af;
    background: #1a1a24;
    z-index: 5;
}

.editor-preview-loading .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #374151;
    border-top-color: #f59e0b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Hero style options */
.editor-hero-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.editor-hero-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    background: #1a1a24;
    border: 2px solid #374151;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-hero-option:hover {
    border-color: #4b5563;
}

.editor-hero-option.active {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.editor-hero-option svg {
    width: 32px;
    height: 32px;
    stroke: #9ca3af;
    fill: none;
    stroke-width: 1.5;
}

.editor-hero-option.active svg {
    stroke: #f59e0b;
}

.editor-hero-option span {
    font-size: 0.75rem;
    color: #9ca3af;
}

.editor-hero-option.active span {
    color: #f59e0b;
}

/* Hover effect style buttons */
.editor-style-btn {
    background: #1a1a2e;
    border: 1px solid #2a2a3e;
    border-radius: 6px;
    color: #9ca3af;
    cursor: pointer;
    font-family: inherit;
    transition: border-color 0.2s, color 0.2s;
}

.editor-style-btn:hover {
    border-color: #4a4a6e;
    color: #e5e5e5;
}

.editor-style-btn.active {
    border-color: #f59e0b;
    color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

/* Notification badge for unsaved changes */
.editor-unsaved-badge {
    display: none;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    margin-left: 0.5rem;
}

.editor-unsaved-badge.show {
    display: block;
}

/* Image upload in editor */
.editor-image-upload {
    border: 2px dashed #374151;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.editor-image-upload:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.editor-image-upload svg {
    width: 32px;
    height: 32px;
    stroke: #6b7280;
    fill: none;
    stroke-width: 2;
    margin-bottom: 0.5rem;
}

.editor-image-upload p {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
}

.editor-image-upload input {
    display: none;
}

/* Loading overlay para evitar flash */
#appLoader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a0a0f;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

#appLoader.hidden {
    display: none;
}