:root {
    --canvas-bg: #F8FAFC;
    --canvas-surface: #FFFFFF;
    --canvas-surface-alt: #F1F5F9;
    --canvas-primary: #059669;
    --canvas-accent: #34D399;
    --canvas-text: #0F172A;
    --canvas-muted: #64748B;
    --canvas-border: #E2E8F0;
}

.marketing-canvas-section {
    position: relative;
    padding: 80px 20px;
    background-color: var(--canvas-bg);
    overflow: hidden;
    min-height: 850px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
}

.ambient-glow {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: floatBlob 10s infinite alternate ease-in-out;
}

.orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(134, 239, 172, 0.4) 0%, rgba(255,255,255,0) 70%);
    top: -100px; left: 15%;
}

.orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(147, 197, 253, 0.3) 0%, rgba(255,255,255,0) 70%);
    bottom: -50px; right: 10%;
    animation-delay: -5s;
}

.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 16px;
    color: var(--canvas-text);
}

.gradient-text {
    background: linear-gradient(135deg, var(--canvas-primary) 0%, var(--canvas-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--canvas-muted);
    max-width: 600px;
    margin: 0 auto;
}

.floating-templates-bar {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 40px;
}

.template-chip {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--canvas-border);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--canvas-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    backdrop-filter: blur(5px);
}

.template-chip:hover, .template-chip.active {
    background: var(--canvas-primary);
    color: #fff;
    border-color: var(--canvas-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.2);
}

.app-window {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    height: 750px;
    display: flex;
    overflow: hidden;
}

.app-sidebar {
    width: 70px;
    background: #fff;
    border-right: 1px solid var(--canvas-border);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0;
    flex-shrink: 0;
}

.app-logo { font-size: 1.5rem; color: var(--canvas-primary); margin-bottom: 30px; }

.sidebar-nav { display: flex; flex-direction: column; gap: 20px; align-items: center; width: 100%; }

.nav-item {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    color: var(--canvas-muted);
    border-radius: 10px;
    font-size: 1.1rem;
    transition: 0.2s;
    text-decoration: none;
}

.nav-item:hover, .nav-item.active {
    background: var(--canvas-surface-alt);
    color: var(--canvas-primary);
}

.user-avatar-sm img {
    width: 36px; height: 36px; border-radius: 50%;
    border: 2px solid #fff;
}

.app-content-grid {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.panel-editor {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--canvas-border);
    background: rgba(255, 255, 255, 0.6);
}

.panel-header {
    padding: 20px 30px;
    border-bottom: 1px solid var(--canvas-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.panel-title { font-weight: 700; color: var(--canvas-text); font-size: 1rem; }
.badge-ai {
    background: #ECFDF5;
    color: var(--canvas-primary);
    font-size: 0.75rem;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: 700;
}

.chat-stream {
    flex: 1;
    padding: 30px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message-group { display: flex; gap: 16px; align-items: flex-start; }
.avatar-bubble { width: 36px; height: 36px; border-radius: 10px; overflow: hidden; flex-shrink: 0; }
.avatar-bubble img { width: 100%; height: 100%; object-fit: cover; }
.ai-bubble {
    background: var(--canvas-primary); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}

.message-content {
    background: #fff;
    padding: 16px 20px;
    border-radius: 0 16px 16px 16px;
    border: 1px solid var(--canvas-border);
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--canvas-text);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
    max-width: 90%;
}
.user-message .message-content {
    background: var(--canvas-surface-alt); border: none; box-shadow: none; border-radius: 16px 16px 0 16px;
}

.ai-status {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 12px; font-size: 0.8rem; font-weight: 600; color: var(--canvas-muted);
}

.typing-indicator span {
    display: inline-block; width: 5px; height: 5px;
    background: var(--canvas-muted); border-radius: 50%;
    margin-right: 3px; animation: bounce 1s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

.typewriter-output { white-space: pre-wrap; word-wrap: break-word; }
.cursor-blink { display: inline-block; margin-left: 2px; color: var(--canvas-primary); animation: blink 1s infinite; }

.editor-input-area {
    padding: 20px;
    border-top: 1px solid var(--canvas-border);
    background: #fff;
}
.input-wrapper {
    background: var(--canvas-surface-alt);
    border-radius: 12px;
    padding: 8px 12px;
    display: flex; align-items: center;
}
.input-wrapper input {
    flex: 1; background: transparent; border: none;
    outline: none; padding: 10px; color: var(--canvas-text);
}
.btn-attach, .btn-send {
    background: none; border: none; color: var(--canvas-muted);
    cursor: pointer; padding: 8px; font-size: 1.1rem;
}

.panel-preview {
    background: #F8FAFC;
    display: flex; flex-direction: column;
    position: relative;
}

.preview-controls { display: flex; gap: 10px; }
.btn-sm {
    padding: 6px 14px;
    border: 1px solid var(--canvas-border);
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    color: var(--canvas-muted);
    font-size: 0.85rem;
    display: flex; align-items: center; gap: 6px;
}
.btn-sm.primary { background: var(--canvas-text); color: #fff; border-color: var(--canvas-text); }

.device-mockup-container {
    flex: 1;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.phone-frame {
    width: 320px; height: 620px;
    background: #fff;
    border: 12px solid #1E293B;
    border-radius: 40px;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    overflow: hidden;
}

.notch {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 140px; height: 28px;
    background: #1E293B;
    border-bottom-left-radius: 18px;
    border-bottom-right-radius: 18px;
    z-index: 20;
}

.status-bar {
    padding: 12px 24px 8px 24px;
    display: flex; justify-content: space-between;
    font-size: 0.75rem; font-weight: 700; color: #1E293B;
}

.app-screen { height: 100%; overflow-y: hidden; position: relative; background: #fff; }

/* --- SOCIAL LAYOUT --- */
.insta-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px; border-bottom: 1px solid #f1f5f9;
}
.insta-user { display: flex; align-items: center; gap: 10px; }
.circle-avi {
    width: 32px; height: 32px;
    background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
    border-radius: 50%;
}
.text-lines .line { background: #E2E8F0; height: 8px; border-radius: 4px; margin-bottom: 4px; }
.text-lines .line.sm { width: 80px; }
.text-lines .line.xs { width: 50px; }

.insta-image-skeleton {
    width: 100%; height: 320px;
    background: #F1F5F9;
    position: relative; margin-bottom: 12px;
    overflow: hidden;
}

.generated-img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.2s ease-in-out;
    display: block;
}

.image-overlay-loader {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 1.5s infinite;
    z-index: 2;
}

.insta-actions {
    padding: 0 16px; margin-bottom: 12px;
    display: flex; justify-content: space-between;
    font-size: 1.3rem; color: #1E293B;
}
.left-icons { display: flex; gap: 16px; }

.insta-caption { padding: 0 16px; }
.caption-line { width: 40%; height: 10px; background: #E2E8F0; border-radius: 4px; margin-bottom: 12px; }
.caption-text-area {
    font-size: 0.85rem; color: #334155; line-height: 1.45;
    white-space: pre-wrap; word-wrap: break-word;
}

/* --- BLOG LAYOUT --- */
.blog-cover {
    width: 100%; height: 220px; background: #F1F5F9;
    position: relative; margin-bottom: 20px; overflow: hidden;
}
.blog-body { padding: 0 20px; }
.blog-title-mock {
    font-size: 1.2rem; font-weight: 800; color: #0F172A;
    margin-bottom: 15px; line-height: 1.3;
}
.blog-text-area {
    font-size: 0.9rem; line-height: 1.6; color: #334155;
    white-space: pre-wrap; word-wrap: break-word;
}

/* --- VIDEO LAYOUT (Full Screen TikTok Style) --- */
.video-layout {
    width: 100%;
    height: 100%;
    background: #000;
    position: absolute; /* Sit on top of everything */
    top: 0;
    left: 0;
    z-index: 10;
}

.video-container {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* Force video image to fill screen */
.video-layout .generated-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

/* Dark gradient at bottom for text readability */
.video-ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, transparent 20%, transparent 60%, rgba(0,0,0,0.85) 100%);
    z-index: 5;
    pointer-events: none;
}

.play-btn-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3.5rem;
    color: rgba(255,255,255,0.9);
    z-index: 6;
    text-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.video-sidebar {
    position: absolute;
    right: 12px;
    bottom: 110px; /* Above the text area */
    display: flex;
    flex-direction: column;
    gap: 24px;
    align-items: center;
    z-index: 20;
}

.v-icon {
    font-size: 1.6rem;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    cursor: pointer;
    transition: transform 0.2s;
}
.v-icon:hover { transform: scale(1.1); }
.v-icon span { display: block; font-size: 0.75rem; margin-top: 5px; font-weight: 600; }

/* Text Content at the very bottom */
.video-bottom-text {
    position: absolute;
    bottom: 30px;
    left: 15px;
    width: 75%; /* Leave room for sidebar */
    color: #fff;
    z-index: 20;
    text-align: left;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
}

.v-user {
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 6px;
}
.v-user::after {
    content: 'Follow';
    border: 1px solid rgba(255,255,255,0.5);
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    font-weight: 500;
}

.v-desc {
    font-size: 0.9rem;
    line-height: 1.4;
    font-weight: 400;
    white-space: pre-wrap; /* Preserve newlines */
}

@keyframes floatBlob {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 30px) scale(1.05); }
}
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

@media (max-width: 992px) {
    .app-content-grid { grid-template-columns: 1fr; }
    .panel-preview { display: none; }
}
@media (max-width: 768px) {
    .app-sidebar { display: none; }
    .app-window { height: auto; min-height: 600px; }
}