:root { 
    --blue: #007aff; 
    --red: #ff3b30; 
    --bg: #0a0a0a; 
    --yellow: #FFD60A; 
}

/* BASE & WRAPPER */
body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; background: var(--bg); overflow-x: hidden; }
.ls-wrapper { display: flex; flex-direction: column; align-items: center; width: 100%; padding: 40px 20px; box-sizing: border-box; }

/* APP BOX */
.ls-app {
    position: relative; width: 100%; max-width: 1280px; 
    background: var(--bg); border-radius: 24px; overflow: hidden;
    border: 1px solid #222; box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    margin: 0 auto; aspect-ratio: 16/9; 
}

/* STAGE */
.ls-stage { width: 100%; height: 100%; position: relative; background: var(--bg); }
.ls-stage::before {
    content: ''; position: absolute; inset: 0;
    background-image: url('https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?q=80&w=1200&auto=format&fit=crop');
    background-size: cover; background-position: center; 
    opacity: 0.6; transition: opacity 0.8s ease; z-index: 1;
}
.ls-app.camera-active .ls-stage::before { opacity: 0; }
#camRaw { position: absolute; width: 1px; height: 1px; opacity: 0; }
#mainCanvas { width: 100%; height: 100%; object-fit: contain; display: block; position: relative; z-index: 5; }

/* OVERLAY */
.ls-overlay { 
    position: absolute; inset: 0; background: rgba(0,0,0,0.6); 
    display: flex; justify-content: center; align-items: center; z-index: 100; 
    transition: opacity 0.5s ease, visibility 0.5s; backdrop-filter: blur(5px);
}
.ls-app.camera-active .ls-overlay { opacity: 0; visibility: hidden; pointer-events: none; }

/* BRANDING CARD */
.glass-card { 
    background: #0a0a0a; border: 1px solid #222; padding: 40px 30px; border-radius: 28px; 
    text-align: center; width: 90%; max-width: 380px; box-shadow: 0 30px 60px rgba(0,0,0,0.9);
    box-sizing: border-box; display: flex; flex-direction: column; align-items: center;
}
.ls-logo { width: 100%; max-width: 260px; height: auto; display: block; margin-bottom: 15px; }
.glass-card p { margin: 0 0 25px 0; color: var(--yellow); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; opacity: 0.9; }

/* UI LAYERS */
.ui-layer { 
    position: absolute; inset: 0; pointer-events: none; 
    display: flex; flex-direction: column; justify-content: space-between; 
    padding: 20px; opacity: 0; transition: opacity 0.5s ease 0.5s; z-index: 50;
}
.ls-app.camera-active .ui-layer { opacity: 1; }
.ui-top { display: flex; justify-content: space-between; pointer-events: auto; }
.ui-bottom { display: flex; justify-content: center; pointer-events: auto; }

/* BUTTONS */
.btn-primary { 
    background: var(--blue); color: white; border: none; padding: 16px 32px; border-radius: 99px; 
    font-weight: 600; cursor: pointer; font-size: 16px; transition: transform 0.1s; 
    box-shadow: 0 5px 15px rgba(0,122,255,0.4); max-width: 100%;
}
.btn-primary:active { transform: scale(0.98); }
.full-width { width: 100%; margin-top: 10px; border-radius: 12px; }
.btn-glass { 
    background: rgba(30,30,30,0.8); color: white; border: 1px solid rgba(255,255,255,0.15); 
    padding: 8px 16px; border-radius: 20px; cursor: pointer; backdrop-filter: blur(10px); 
    font-weight: 600; font-size: 13px; transition: background 0.2s; 
}
.btn-glass:hover { background: rgba(50,50,50,0.9); }
.btn-text { background: none; border: none; cursor: pointer; font-weight: bold; font-size: 16px; }
.text-red { color: var(--red); }

/* RECORD BUTTON */
.record-btn { width: 72px; height: 72px; border-radius: 50%; border: 4px solid white; background: transparent; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.record-inner { width: 60px; height: 60px; background: var(--red); border-radius: 50%; transition: 0.3s cubic-bezier(0.25, 1, 0.5, 1); }
.record-btn.recording .record-inner { width: 30px; height: 30px; border-radius: 6px; }
.record-btn.recording { border-color: rgba(255,255,255,0.5); }
.rec-pill { background: rgba(255,0,0,0.2); border: 1px solid red; color: red; padding: 6px 12px; border-radius: 20px; font-weight: bold; display: none; align-items: center; gap: 6px; font-size: 12px; }
.red-dot { width: 8px; height: 8px; background: red; border-radius: 50%; animation: pulse 1s infinite; }
.audio-viz { position: absolute; bottom: 110px; left: 50%; transform: translateX(-50%); display: flex; gap: 4px; align-items: flex-end; height: 20px; }
.viz-bar { width: 6px; height: 100%; background: #34c759; border-radius: 3px; opacity: 0.3; transition: height 0.1s; }

/* MODALS & INPUTS */
.ls-modal { 
    position: absolute; inset: 0; background: rgba(10,10,10,0.8); z-index: 200; 
    display: flex; justify-content: center; align-items: center; backdrop-filter: blur(15px);
}
.modal-card { 
    background: #0a0a0a; padding: 30px; border-radius: 24px; width: 90%; max-width: 500px; 
    text-align: center; color: white; border: 1px solid #222; box-shadow: 0 40px 80px rgba(0,0,0,0.8);
    max-height: 90%; overflow-y: auto;
}
.small-card { max-width: 320px; }
.large-card { max-width: 600px; text-align: left; }
.modal-card h3 { margin: 0 0 20px 0; color: #fff; font-size: 20px; font-weight: 700; }
.modal-card label { display: block; text-align: left; font-size: 12px; color: #888; font-weight: 700; margin-bottom: 5px; text-transform: uppercase; }
.ls-input, .ls-select { 
    width: 100%; padding: 14px; margin-bottom: 15px; background: #222; border: 1px solid #444; 
    color: white; border-radius: 12px; box-sizing: border-box; font-size: 16px; 
}
textarea.ls-input { font-size: 18px; line-height: 1.5; background: #1e1e1e; min-height: 200px; }
.ls-input:focus, .ls-select:focus { border-color: var(--blue); outline: none; background: #2a2a2a; }
.ls-hr { border: 0; border-top: 1px solid #333; margin: 20px 0; }
.video-wrap { width: 100%; background: transparent; border-radius: 12px; overflow: hidden; margin-bottom: 20px; }
.video-wrap video { width: 100%; max-height: 60vh; display: block; object-fit: contain; }
.btn-row { display: flex; justify-content: center; gap: 15px; }

/* TELEPROMPTER, MEDIA, ARROWS */
.teleprompter-display {
    position: absolute; top: 10%; left: 50%; transform: translateX(-50%); width: 80%; max-height: 25%;
    overflow: hidden; padding: 10px; border-radius: 12px; background: rgba(0,0,0,0.5);
    color: white; font-size: 28px; font-weight: 600; text-align: center; 
    pointer-events: none; z-index: 60; display: none; text-shadow: 0 2px 4px black;
}
#teleprompterText { margin: 0; line-height: 1.5; position: relative; transition: transform 0.1s linear; white-space: pre-wrap; }

.speed-control {
    position: absolute; top: 50%; right: 20px; transform: translateY(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: auto; z-index: 60;
    background: rgba(30,30,30,0.8); padding: 8px 6px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1);
}
.speed-btn { width: 30px; height: 30px; border-radius: 50%; background: var(--blue); color: white; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px; }
#speedVal { color: white; font-weight: bold; font-size: 12px; }

.accordion-header { background: #1a1a1a; color: white; border: 1px solid #333; padding: 12px; border-radius: 12px; width: 100%; text-align: left; cursor: pointer; }
.word-count-info { font-size: 12px; color: #aaa; margin-top: -10px; margin-bottom: 15px; }
.word-count-info span { font-weight: bold; color: white; }
.upload-btn-wrapper { position: relative; overflow: hidden; display: inline-block; margin-bottom: 15px; }
.upload-btn-wrapper input[type=file] { position: absolute; left: 0; top: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }

/* MEDIA PREVIEW WITH ARROWS */
.media-preview-grid { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 15px; }
.media-item { position: relative; width: 80px; height: 80px; border-radius: 8px; overflow: hidden; border: 2px solid var(--blue); display: flex; flex-direction: column; }
.media-item img, .media-item video { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; z-index: 1; }
.media-controls { position: absolute; bottom: 0; left: 0; right: 0; height: 24px; z-index: 2; display: flex; background: rgba(0,0,0,0.6); }
.media-btn { flex: 1; border: none; background: none; color: white; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.media-btn:hover { background: rgba(255,255,255,0.2); }
.media-remove { position: absolute; top: 0; right: 0; background: var(--red); color: white; border: none; width: 20px; height: 20px; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 3; }

@keyframes pulse { 50% { opacity: 0.5; } }
@media (max-width: 768px) { 
    .ls-wrapper { padding: 10px; }
    .ls-app { aspect-ratio: 9/16; min-height: 550px; max-height: 85vh; border-radius: 20px; }
    .glass-card { width: 85%; padding: 30px 20px; }
    .ui-layer { padding: 20px; }
}