/* =============================================================================
   CAPCUT PRO MOBILE — FULL FEATURE STYLESHEET
   Touch-First Architecture with Complete Action Grid & Category Bottom Sheets
   ============================================================================= */

:root {
    --bg-main: #080A0F;
    --bg-surface: #11151F;
    --bg-sheet: #181D29;
    --bg-input: #0B0E15;

    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(79, 172, 254, 0.3);

    --primary-cyan: #00F2FE;
    --primary-blue: #4FACFE;
    --accent-purple: #7F56D9;
    --accent-magenta: #FF2A85;
    --danger-red: #FF4D4D;

    --text-main: #FFFFFF;
    --text-muted: #94A3B8;
    --text-dim: #64748B;

    --font-app: 'Inter', -apple-system, sans-serif;
    --font-heading: 'Outfit', sans-serif;
    --font-code: 'Fira Code', monospace;

    --nav-height: 60px;
    --header-height: 48px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body, html {
    width: 100%;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: var(--font-app);
    font-size: 13px;
}

.mobile-container {
    display: flex;
    flex-direction: column;
    width: 100vw;
    min-height: 100vh;
    padding-bottom: calc(var(--nav-height) + 20px);
}

/* TOP HEADER */
.mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 12px;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 100;
}

.mobile-header-left {
    display: flex;
    align-items: center;
    gap: 6px;
}

.app-icon-badge {
    font-size: 14px;
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.mobile-title {
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.badge-pro {
    font-size: 9px;
    background: linear-gradient(135deg, var(--accent-magenta), var(--accent-purple));
    color: #FFF;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 800;
    margin-left: 4px;
}

.mobile-header-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.mobile-pill-select, .mobile-pill-select-sm {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 12px;
    outline: none;
}

.mobile-export-btn {
    background: linear-gradient(135deg, var(--primary-cyan), var(--primary-blue));
    color: #050C1A;
    border: none;
    padding: 6px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

/* MAIN VIEWPORT & CANVAS */
.mobile-viewport {
    width: 100%;
    min-height: 280px;
    max-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    background: #000;
}

.canvas-box {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
}

#preview-canvas {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
    border-radius: 8px;
}

.floating-transport {
    position: absolute;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(24, 29, 41, 0.9);
    backdrop-filter: blur(12px);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid var(--border-subtle);
    z-index: 50;
}

.mobile-play-btn {
    background: var(--primary-blue);
    color: #000;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.mobile-timecode {
    font-family: var(--font-code);
    font-size: 11px;
    color: var(--primary-cyan);
    font-weight: 600;
}

.mobile-timecode .divider {
    color: var(--text-dim);
    margin: 0 2px;
}

/* TIMELINE SECTION */
.mobile-timeline-section {
    width: 100%;
    min-height: 240px;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.timeline-quick-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 36px;
    padding: 0 10px;
    background: rgba(8, 10, 15, 0.8);
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
}

.tool-group-left {
    display: flex;
    gap: 6px;
}

.tool-chip {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.tool-chip.danger {
    color: var(--danger-red);
}

.timeline-zoom-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: var(--text-dim);
}

.zoom-btn {
    background: rgba(255, 255, 255, 0.08);
    border: none;
    color: var(--text-main);
    width: 22px;
    height: 22px;
    border-radius: 4px;
}

.mobile-timeline-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    position: relative;
    padding-top: 20px;
    min-height: 180px;
}

.timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    z-index: 30;
    pointer-events: auto;
}

.playhead-head {
    width: 12px;
    height: 12px;
    background: var(--primary-cyan);
    clip-path: polygon(0 0, 100% 0, 50% 100%);
    margin-left: -5px;
}

.playhead-line {
    width: 2px;
    height: 100%;
    background: var(--primary-cyan);
    box-shadow: 0 0 6px var(--primary-cyan);
}

.mobile-tracks-wrapper {
    min-width: 1000px;
    position: relative;
}

.timeline-ruler {
    height: 18px;
    background: rgba(0, 0, 0, 0.2);
    position: relative;
    border-bottom: 1px solid var(--border-subtle);
}

.track-lane {
    height: 32px;
    margin-bottom: 2px;
    background: rgba(255, 255, 255, 0.02);
    position: relative;
}

.timeline-clip {
    position: absolute;
    height: 26px;
    top: 3px;
    border-radius: 4px;
    background: #1e293b;
    border: 1px solid var(--primary-blue);
    color: #fff;
    font-size: 9px;
    font-weight: 600;
    display: flex;
    align-items: center;
    padding: 0 6px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.timeline-clip.selected {
    border: 2px solid var(--primary-cyan);
    box-shadow: 0 0 8px rgba(0, 242, 254, 0.5);
}

.timeline-clip-text { border-color: var(--accent-purple); background: #4c1d95; }
.timeline-clip-audio { border-color: #10B981; background: #064e3b; }
.timeline-clip-effect { border-color: var(--accent-magenta); background: #831843; }

/* ANDROID BOTTOM NAVIGATION DOCK */
.android-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--nav-height);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
    z-index: 200;
    overflow-x: auto;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    min-width: 52px;
    height: 100%;
    cursor: pointer;
}

.nav-item.active {
    color: var(--primary-cyan);
}

.nav-icon {
    font-size: 16px;
    margin-bottom: 2px;
}

.nav-label {
    font-size: 9px;
    font-weight: 600;
}

/* SLIDE-UP BOTTOM SHEETS WITH ACTION GRIDS */
.bottom-sheet {
    position: fixed;
    bottom: var(--nav-height);
    left: 0;
    right: 0;
    background: var(--bg-sheet);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border: 1px solid var(--border-accent);
    border-bottom: none;
    padding: 12px 16px 20px 16px;
    transform: translateY(120%);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 150;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.9);
    max-height: 60vh;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.sheet-handle {
    width: 40px;
    height: 6px;
    background: var(--text-dim);
    border-radius: 3px;
    margin: 0 auto 8px auto;
    cursor: pointer;
}

.sheet-close-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--text-main);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.sheet-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.mobile-upload-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: rgba(79, 172, 254, 0.12);
    border: 1.5px dashed var(--primary-blue);
    border-radius: 10px;
    text-align: center;
    color: var(--primary-cyan);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    margin-bottom: 14px;
}

.action-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.action-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-main);
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}

.action-card .icon {
    font-size: 18px;
}

.action-card:hover {
    border-color: var(--primary-cyan);
    background: rgba(0, 242, 254, 0.08);
}

.text-presets-row, .mobile-filter-chips, .mobile-effect-chips, .canvas-bg-chips, .speed-btn-group, .audio-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 8px;
}

.text-btn-preset, .filter-chip, .effect-chip, .bg-chip, .speed-btn, .audio-tab {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 8px 14px;
    border-radius: 18px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.filter-chip.active, .effect-chip.active, .bg-chip.active, .speed-btn.active, .audio-tab.active {
    background: var(--primary-blue);
    color: #000;
    border-color: var(--primary-blue);
}

.mobile-input {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 13px;
    margin-top: 8px;
}

.slider-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-muted);
}

.slider-row input[type="range"] {
    width: 60%;
}

.color-picker-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    font-size: 12px;
}

.mobile-audio-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.audio-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 12px;
    border-radius: 8px;
    font-size: 12px;
}

.btn-add-audio {
    background: var(--primary-blue);
    color: #000;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

/* MODAL */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-backdrop.hidden, .hidden {
    display: none !important;
}

.modal-card {
    background: var(--bg-surface);
    border: 1px solid var(--border-accent);
    border-radius: 16px;
    width: 85%;
    max-width: 320px;
    padding: 20px;
    text-align: center;
}

.progress-bar-container {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin: 16px 0;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-cyan), var(--primary-blue));
}
