:root {
    --bg-obsidian: #050505;
    --bg-charcoal: #0F0F0F;
    --border-color: #2A2A2A;
    --accent-purple: #7C3AED;
    --primary-color: #7C3AED;
    --accent-blue: #00D1FF;
    --text-primary: #e5e2e1;
    --text-secondary: #958da1;
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Inter', sans-serif;
}

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

body {
    background-color: var(--bg-obsidian);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow: hidden; /* App-like feel */
}

/* Layout */
.dashboard-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--bg-charcoal);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.logo {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 20px;
    margin-bottom: 40px;
    color: #fff;
}

.side-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding-right: 8px;
}

/* Custom Scrollbar for side-nav */
.side-nav::-webkit-scrollbar {
    width: 6px;
}
.side-nav::-webkit-scrollbar-track {
    background: transparent;
}
.side-nav::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    position: relative;
}

.nav-item:hover:not(.disabled), .nav-item.active {
    background-color: rgba(124, 58, 237, 0.1);
    color: var(--accent-purple);
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: transparent;
}

.badge {
    margin-left: auto;
    font-size: 10px;
    background: #333;
    padding: 3px 6px;
    border-radius: 4px;
    color: #999;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.nav-group-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 4px;
    padding-left: 16px;
    opacity: 0.7;
}

.nav-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 12px 0;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}
.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

/* Editor Panel */
.editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-obsidian);
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 24px;
    background-color: var(--bg-charcoal);
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 20px 24px;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
}

.tab-btn.active {
    color: var(--accent-purple);
    border-bottom-color: var(--accent-purple);
}

.tab-content {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}
.tab-content.hidden { display: none; }

/* Forms */
.form-group {
    margin-bottom: 20px;
}
.form-row {
    display: flex;
    gap: 16px;
}
.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

input[type="text"], select, textarea {
    width: 100%;
    background-color: var(--bg-charcoal);
    border: 1px solid var(--border-color);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    font-family: var(--font-body);
    outline: none;
}
input[type="text"]:focus, select:focus, textarea:focus {
    border-color: var(--accent-purple);
    box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.2);
}

.platform-selector {
    display: flex;
    gap: 16px;
}
.platform-option {
    cursor: pointer;
}
.platform-option input { display: none; }
.platform-option img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    border: 2px solid transparent;
    padding: 8px;
    background: #fff;
    transition: all 0.2s;
    object-fit: contain;
}
.platform-option input:checked + img,
.platform-option input:checked + .imessage-icon-wrapper {
    border-color: var(--accent-purple) !important;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.4);
}

.bg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
    margin-top: 8px;
}
.bg-item {
    height: 80px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.8);
    transition: all 0.2s;
}
.bg-item:hover {
    transform: scale(1.05);
}
.bg-item.active {
    border-color: var(--accent-purple);
    box-shadow: 0 0 10px rgba(124, 58, 237, 0.5);
}

.chat-builder {
    background-color: var(--bg-charcoal);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--border-color);
    margin-top: 24px;
}
.chat-builder h3 {
    margin-bottom: 16px;
    font-family: var(--font-heading);
    font-size: 18px;
}
.message-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}
.msg-item {
    display: flex;
    justify-content: space-between;
    background: var(--bg-obsidian);
    padding: 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}
.msg-item.right-msg {
    border-left: 4px solid var(--accent-purple);
}
.msg-item.left-msg {
    border-left: 4px solid var(--text-secondary);
}
.message-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

/* Buttons */
.btn-primary {
    background-color: var(--accent-purple);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-body);
}
.btn-primary:hover {
    box-shadow: 0 0 15px rgba(124, 58, 237, 0.5);
    transform: translateY(-1px);
}
.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.btn-secondary:hover:not(:disabled) {
    background-color: var(--bg-charcoal);
}
.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Preview Panel */
.preview-panel {
    width: 420px;
    background-color: var(--bg-charcoal);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.preview-header {
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}
.preview-header h3 {
    font-family: var(--font-heading);
}

.phone-selector select {
    padding: 8px 12px;
    width: auto;
}

.preview-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
    background: radial-gradient(circle, #1a1a1a 0%, #050505 100%);
}

/* Mobile frames */
.phone-mockup {
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    background: #000;
    transition: all 0.3s ease;
}

/* iPhone Frame */
.phone-mockup.iphone {
    width: 320px;
    height: 650px;
    border-radius: 40px;
    border: 10px solid #222;
}
.phone-mockup.iphone .phone-notch {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 25px;
    background: #222;
    border-bottom-left-radius: 15px;
    border-bottom-right-radius: 15px;
    z-index: 10;
}

/* Samsung Frame */
.phone-mockup.samsung {
    width: 320px;
    height: 670px;
    border-radius: 24px;
    border: 6px solid #333;
}
.phone-mockup.samsung .phone-notch {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #111;
    border-radius: 50%;
    z-index: 10;
}

/* Huawei Frame */
.phone-mockup.huawei {
    width: 320px;
    height: 680px;
    border-radius: 30px;
    border: 8px solid #444;
}
.phone-mockup.huawei .phone-notch {
    position: absolute;
    top: 10px;
    left: 20px;
    width: 30px;
    height: 14px;
    background: #111;
    border-radius: 10px;
    z-index: 10;
}

.phone-screen {
    width: 100%;
    height: 100%;
    border-radius: 30px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #0d0d12 0%, #1a1a24 100%);
}
.samsung .phone-screen { border-radius: 18px; }
.huawei .phone-screen { border-radius: 22px; }

/* Recording mode overrides to ensure clean 1080x1920 borderless output */
body.is-recording .phone-notch {
    display: none !important;
}
body.is-recording .phone-screen {
    border-radius: 0 !important;
}
body.is-recording .phone-mockup {
    border: none !important;
    border-radius: 0 !important;
}

/* Chat Interfaces base styles */
.chat-interface {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    transition: all 0.3s;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 40px 15px 15px 15px; /* accommodate notch */
}
.chat-pfp {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.chat-info h4 {
    font-size: 15px;
    font-weight: 600;
}
.chat-info .online-status {
    font-size: 11px;
    opacity: 0.8;
}
.chat-actions {
    margin-left: auto;
    display: flex;
    gap: 15px;
}

.chat-body {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    margin-bottom: 15px;
    font-size: 15px;
    line-height: 1.4;
    word-wrap: break-word;
    position: relative;
    clear: both;
}

/* Media Attachments inside Bubbles */
.chat-bubble img.bubble-media,
.chat-bubble video.bubble-media {
    max-width: 100%;
    border-radius: 12px;
    margin-top: 5px;
    display: block;
}
.chat-bubble img.bubble-sticker {
    max-width: 120px;
    background: transparent;
    border-radius: 0;
    margin-top: 0;
}
.chat-bubble audio.bubble-audio {
    width: 200px;
    margin-top: 5px;
    height: 40px;
}
.chat-bubble.media-only {
    background: transparent !important;
    padding: 0;
    box-shadow: none;
}
.chat-bubble.media-only::before,
.chat-bubble.media-only::after {
    display: none;
}

.chat-input-area {
    padding: 12px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 20px; /* home bar spacing */
}
.fake-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
}/* Unified Header/Input Toggles */
.wa-ui, .ig-ui, .ms-ui, .tk-ui, .im-ui { display: none !important; }

.chat-interface.whatsapp .wa-ui { display: flex !important; }
.chat-interface.instagram .ig-ui { display: flex !important; }
.chat-interface.messenger .ms-ui { display: flex !important; }
.chat-interface.tiktok .tk-ui { display: flex !important; }
.chat-interface.imessage .im-ui { display: flex !important; }

/* WhatsApp Specific Styles */
.chat-interface.whatsapp { background-color: #0b141a; background-image: radial-gradient(#202c33 1px, transparent 1px); background-size: 20px 20px; color: #fff; }
.chat-interface.whatsapp .chat-header { background-color: #202c33; color: white; border-bottom: none; }
.chat-interface.whatsapp .chat-info h4 { font-weight: 500; font-size: 16px; margin-bottom: 2px; }
.chat-interface.whatsapp .online-status { font-size: 13px; color: #8696a0; }
.chat-interface.whatsapp .bubble-left { align-self: flex-start; background-color: #202c33; color: #e9edef; border-radius: 8px; border-top-left-radius: 0; box-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.chat-interface.whatsapp .bubble-right { align-self: flex-end; background-color: #005c4b; color: #e9edef; border-radius: 8px; border-top-right-radius: 0; box-shadow: 0 1px 1px rgba(0,0,0,0.1); }
.chat-interface.whatsapp .chat-input-area { background: transparent; padding-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.wa-input-pill { flex: 1; background: #202c33; border-radius: 24px; display: flex; align-items: center; padding: 5px 12px; }
.wa-input-pill .fake-input { flex: 1; background: transparent; color: #8696a0; padding: 8px 10px; }
.wa-mic-btn { background: #00a884; color: #fff; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }

/* Instagram Specific Styles (Dark Mode) */
.chat-interface.instagram { background-color: #000; color: #fff; }
.chat-interface.instagram .chat-header { background: #000; color: #fff; border-bottom: 1px solid #262626; }
.btn-icon {
    background: #2a2a35;
    color: #a0a0b0;
    border: 1px solid #3f3f4e;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.btn-icon:hover {
    background: #7b1fa2;
    color: white;
    border-color: #7b1fa2;
}
.chat-interface.instagram .chat-info h4 { font-weight: 600; font-size: 16px; }
.chat-interface.instagram .bubble-left { align-self: flex-start; background: #262626; color: #fff; border-radius: 22px; padding: 12px 16px; }
.chat-interface.instagram .bubble-right { align-self: flex-end; background: linear-gradient(135deg, #7b1fa2, #3797F0); color: #fff; border-radius: 22px; padding: 12px 16px; }
.chat-interface.instagram .chat-input-area { background: #000; color: #fff; display: flex; align-items: center; padding: 10px; }
.ig-input-pill { flex: 1; background: #262626; border-radius: 24px; display: flex; align-items: center; padding: 4px; gap: 10px; }
.ig-cam-btn { background: #0095f6; color: #fff; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.ig-input-pill .fake-input { flex: 1; background: transparent; color: #888; padding: 10px 5px; }
.ig-input-pill > i { font-size: 22px; color: #fff; margin-right: 5px; }

/* Messenger Specific Styles (Dark Mode) */
.chat-interface.messenger { background-color: #000; color: #e4e6eb; }
.chat-interface.messenger .chat-header { background: #000; color: #e4e6eb; border-bottom: 1px solid #242526; }
.chat-interface.messenger .bubble-left { align-self: flex-start; background: #3e4042; color: #e4e6eb; border-radius: 18px; padding: 10px 14px; }
.chat-interface.messenger .bubble-right { align-self: flex-end; background: #0084ff; color: #fff; border-radius: 18px; padding: 10px 14px; }
.chat-interface.messenger .chat-input-area { background: #000; color: #0084ff; display: flex; align-items: center; gap: 10px; padding: 10px; }
.ms-left-actions { display: flex; gap: 15px; font-size: 20px; align-items: center; }
.ms-input-pill { flex: 1; background: #3a3b3c; border-radius: 20px; display: flex; align-items: center; padding: 6px 12px; }
.ms-input-pill .fake-input { flex: 1; background: transparent; color: #b0b3b8; padding: 4px; }
.ms-right-actions { font-size: 22px; }

/* TikTok Specific Styles */
.chat-interface.tiktok { background-color: #fff; color: #161823; }
.chat-interface.tiktok .chat-header { background: #fff; color: #161823; border-bottom: 1px solid #e5e5e5; justify-content: center; position: relative;}
.chat-interface.tiktok .chat-info h4 { text-align: center; font-weight: 700; font-size: 17px; margin: 0; }
.chat-interface.tiktok .back-btn { position: absolute; left: 15px; font-size: 20px; }
.chat-interface.tiktok .bubble-left { align-self: flex-start; background: #f1f1f2; color: #161823; border-radius: 12px; border-bottom-left-radius: 2px;}
.chat-interface.tiktok .bubble-right { align-self: flex-end; background: #fe2c55; color: #fff; border-radius: 12px; border-bottom-right-radius: 2px;}
.chat-interface.tiktok .chat-input-area { background: #fff; border-top: 1px solid #e5e5e5; color: #161823; display: flex; align-items: center; padding: 10px; gap: 15px; }
.chat-interface.tiktok .fake-input { flex: 1; background: #f1f1f2; color: #8a8b91; border-radius: 20px; padding: 12px 16px; }
.chat-interface.tiktok .chat-input-area > i { font-size: 24px; color: #161823; }

/* iMessage Specific Styles */
.chat-interface.imessage { background-color: #fff; color: #000; }
.chat-interface.imessage .bubble-left { align-self: flex-start; background: #e5e5ea; color: #000; border-radius: 18px; padding: 8px 14px; position: relative; margin-left: 5px; border-bottom-left-radius: 4px; }
.chat-interface.imessage .bubble-right { align-self: flex-end; background: #007aff; color: #fff; border-radius: 18px; padding: 8px 14px; position: relative; margin-right: 5px; border-bottom-right-radius: 4px; }

.chat-interface.imessage .bubble-left::before { content: ''; position: absolute; bottom: 0; left: -8px; height: 16px; width: 16px; background: #e5e5ea; border-bottom-right-radius: 12px; z-index: -1; }
.chat-interface.imessage .bubble-left::after { content: ''; position: absolute; bottom: 0; left: -10px; height: 16px; width: 10px; background: #fff; border-bottom-right-radius: 10px; z-index: 1; }

.chat-interface.imessage .bubble-right::before { content: ''; position: absolute; bottom: 0; right: -8px; height: 16px; width: 16px; background: #007aff; border-bottom-left-radius: 12px; z-index: -1; }
.chat-interface.imessage .bubble-right::after { content: ''; position: absolute; bottom: 0; right: -10px; height: 16px; width: 10px; background: #fff; border-bottom-left-radius: 10px; z-index: 1; }

/* Layout Mode Styles */
.layout-mode-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.layout-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 15px;
    background: var(--bg-charcoal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
}

.layout-btn:hover {
    background: #333;
}

.layout-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.layout-btn i {
    font-size: 18px;
}

.hidden-radio {
    display: none;
}

.platform-selector {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-top: 10px;
}

.platform-option {
    cursor: pointer;
    display: inline-block;
}

.platform-option input[type="radio"] {
    display: none;
}

.platform-option img,
.platform-option .imessage-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    filter: grayscale(80%) opacity(0.6);
}

.platform-option input[type="radio"]:checked + img,
.platform-option input[type="radio"]:checked + .imessage-icon-wrapper {
    filter: grayscale(0%) opacity(1);
    transform: scale(1.15);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.phone-screen { position: relative; overflow: hidden; }
.phone-bg-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.chat-interface { z-index: 10; transition: all 0.3s ease; }
.phone-screen.layout-overlay .chat-interface {
    position: absolute;
    top: 40px; /* Top anchor */
    bottom: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    height: 70%;
    border-radius: 24px;
    box-shadow: 0 15px 45px rgba(0,0,0,0.7);
    border: 1px solid rgba(255,255,255,0.12);
    opacity: 1;
    overflow: hidden;
    isolation: isolate; /* Ensures inner backgrounds are clipped by border-radius */
}

/* Ensure chat body inside overlay doesn't have scrollbars visible */
.phone-screen.layout-overlay .chat-interface .chat-body {
    overflow: hidden;
}

/* Scale down the bottom input bar in overlay mode to prevent horizontal cutoff */
.phone-screen.layout-overlay .chat-input-area {
    padding: 8px 10px !important;
    gap: 6px !important;
}
.phone-screen.layout-overlay .chat-input-area i {
    font-size: 18px !important;
}
.phone-screen.layout-overlay .fake-input {
    font-size: 12px !important;
    padding: 6px 8px !important;
}
.phone-screen.layout-overlay .ig-input-pill > i {
    font-size: 16px !important;
    margin-right: 3px !important;
}
.phone-screen.layout-overlay .ms-left-actions {
    gap: 8px !important;
}
.phone-screen.layout-overlay .ig-cam-btn,
.phone-screen.layout-overlay .wa-mic-btn {
    width: 28px !important;
    height: 28px !important;
    font-size: 14px !important;
}
.phone-screen.layout-overlay .chat-input-area.im-ui {
    gap: 6px !important;
}

/* Notification Banner */
.notification-banner {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 85%;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 20;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.notification-banner.hidden {
    top: -100px;
    opacity: 0;
}

.notif-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
}

.notif-pfp {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.notif-name {
    font-size: 13px;
    font-weight: 600;
    color: #000;
    flex: 1;
}

.notif-app {
    font-size: 11px;
    color: #888;
}

.notif-body {
    font-size: 14px;
    color: #333;
    padding-left: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.export-bar {
    padding: 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.export-bar button {
    width: 100%;
}

/* Mobile Header */
.mobile-header {
    display: none;
    padding: 16px 20px;
    background-color: var(--bg-charcoal);
    border-bottom: 1px solid var(--border-color);
    justify-content: space-between;
    align-items: center;
}
#menu-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 20px;
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar { display: none; }
    .mobile-header { display: flex; }
    .dashboard-container { flex-direction: column; height: calc(100vh - 60px); }
    .preview-panel { width: 100%; border-left: none; border-top: 1px solid var(--border-color); }
    .editor-panel { flex: unset; height: 50vh; }
}

/* Animations & Typing Indicator */
@keyframes popInWA-sent {
    0% { transform: scale(0.8); opacity: 0; transform-origin: top right; }
    100% { transform: scale(1); opacity: 1; transform-origin: top right; }
}
@keyframes popInWA-received {
    0% { transform: scale(0.8); opacity: 0; transform-origin: top left; }
    100% { transform: scale(1); opacity: 1; transform-origin: top left; }
}
@keyframes popInBottom-sent {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; transform-origin: bottom right; }
    100% { transform: scale(1) translateY(0); opacity: 1; transform-origin: bottom right; }
}
@keyframes popInBottom-received {
    0% { transform: scale(0.8) translateY(10px); opacity: 0; transform-origin: bottom left; }
    100% { transform: scale(1) translateY(0); opacity: 1; transform-origin: bottom left; }
}

.chat-bubble.bubble-right.animating { animation: popInBottom-sent 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.chat-bubble.bubble-left.animating { animation: popInBottom-received 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.chat-interface.whatsapp .chat-bubble.bubble-right.animating { animation: popInWA-sent 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.chat-interface.whatsapp .chat-bubble.bubble-left.animating { animation: popInWA-received 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 10px 14px;
    background: #202c33; /* Default dark */
    border-radius: 18px;
    width: fit-content;
    margin-bottom: 10px;
    align-items: center;
    align-self: flex-start;
}

.chat-interface.instagram .typing-indicator, .chat-interface.messenger .typing-indicator {
    background: #262626;
}
.chat-interface.tiktok .typing-indicator {
    background: #f1f1f2;
}
.chat-interface.imessage .typing-indicator {
    background: #e5e5ea;
}

.typing-indicator span {
    width: 6px;
    height: 6px;
    background: #a8a8a8;
    border-radius: 50%;
    animation: typingBounce 0.8s infinite alternate;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBounce {
    0% { transform: translateY(0); opacity: 0.4; }
    100% { transform: translateY(-4px); opacity: 1; }
}

/* Custom File Input */
.custom-file-input {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-charcoal);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: border-color 0.2s;
}
.custom-file-input:hover {
    border-color: var(--accent-purple);
}
.custom-file-input input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.custom-file-input span {
    flex: 1;
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-file-input .btn-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

/* Script Input Section */
#script-input {
    font-family: 'Courier New', monospace;
    font-size: 13px;
    line-height: 1.5;
    resize: vertical;
}
.script-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}
.script-status {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    min-height: 18px;
}
.script-status.success {
    color: #00a884;
}
.script-status.error {
    color: #ff4444;
}

/* Typing bubble in preview */
.chat-bubble.typing-bubble {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    max-width: fit-content;
}

/* Capture mode: rectangular screen, no border, no notch */
.capture-mode .phone-mockup {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    padding: 0 !important;
}
.capture-mode .phone-notch {
    display: none !important;
}
.capture-mode .phone-screen {
    border-radius: 0 !important;
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
    width: 320px !important;
}
.capture-mode .chat-interface {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
.capture-mode .chat-body {
    overflow: visible !important;
    max-height: none !important;
    height: auto !important;
}
