/* ==========================================================================
   MabrookTech Audio & Video Studio — Studio-Specific Styles
   Complements ../assets/ecosystem.css (Apple Daylight Liquid Glass)
   ========================================================================== */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.hidden {
    display: none !important;
}

.mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* Sidebar Brand & Helpers */
.ms-studio-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0.2rem 1rem;
    border-bottom: 1px solid rgba(29, 29, 31, 0.08);
    margin-bottom: 0.9rem;
}

.ms-brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #0F4C81 0%, #0F766E 100%);
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    box-shadow: 0 8px 18px -6px rgba(15, 76, 129, 0.45);
}

.ms-brand-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #1D1D1F;
    line-height: 1.2;
    margin: 0;
}

.ms-brand-sub {
    font-size: 0.75rem;
    color: #6E6E73;
    margin: 0.15rem 0 0;
}

.ms-search-wrap {
    position: relative;
}

.ms-search-wrap i {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #6E6E73;
    font-size: 0.85rem;
    pointer-events: none;
}

.ms-search-wrap .mt-input {
    padding-left: 2.15rem;
}

.ms-group-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #6E6E73;
    padding: 0.35rem 0.5rem;
    margin-top: 0.4rem;
}

.ms-sidebar-footer-card {
    margin-top: auto;
    padding: 0.9rem;
    border-radius: 14px;
    background: rgba(15, 76, 129, 0.05);
    border: 1px solid rgba(15, 76, 129, 0.14);
    font-size: 0.78rem;
    color: #515154;
}

.ms-privacy-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 700;
    color: #0F4C81;
    margin-bottom: 0.35rem;
}

.ms-sidebar-footer-card p {
    margin: 0 0 0.65rem;
    line-height: 1.45;
}

.ms-hub-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    color: #0F766E;
    text-decoration: none;
}

.ms-hub-link:hover {
    text-decoration: underline;
}

/* Panel Headers & Cards */
.ms-panel-header {
    margin-bottom: 1.15rem;
}

.ms-panel-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: #1D1D1F;
    margin: 0.4rem 0 0.3rem;
}

.ms-panel-header p {
    color: #515154;
    margin: 0;
    font-size: 0.94rem;
    max-width: 78ch;
}

.mt-badge-sapphire {
    background: rgba(15, 76, 129, 0.11);
    color: #0F4C81;
    border: 1px solid rgba(15, 76, 129, 0.2);
}

.mt-badge-teal {
    background: rgba(15, 118, 110, 0.11);
    color: #0F766E;
    border: 1px solid rgba(15, 118, 110, 0.22);
}

.ms-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
    flex-wrap: wrap;
}

.ms-card-head h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.08rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    color: #1D1D1F;
}

.ms-subhead {
    font-family: 'Outfit', sans-serif;
    font-size: 0.98rem;
    font-weight: 700;
    margin: 0 0 0.6rem;
    color: #1D1D1F;
}

/* Spacing Utilities */
.ms-mt-1 { margin-top: 1rem; }
.ms-mt-sm { margin-top: 0.6rem; }
.ms-controls-row { margin-top: 0.9rem; margin-bottom: 0.9rem; }
.ms-col-span-2 { grid-column: span 2; }

.ms-btn-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
    margin-top: 1rem;
}

.ms-btn-sm {
    padding: 0.42rem 0.78rem;
    font-size: 0.82rem;
}

.ms-file-btn {
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.ms-upload-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
}

.ms-file-status {
    font-size: 0.86rem;
    color: #515154;
    font-weight: 500;
}

.ms-inline-status {
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: #0F4C81;
    font-weight: 500;
    min-height: 1.2em;
}

.ms-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    max-width: 100%;
}

.ms-stat-label {
    display: block;
    font-size: 0.75rem;
    color: #6E6E73;
    margin-bottom: 0.15rem;
}

/* Mode Pills & A/B Toggles */
.ms-mode-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.ms-mode-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.55rem 0.95rem;
    border-radius: 999px;
    border: 1px solid rgba(29, 29, 31, 0.12);
    background: rgba(255, 255, 255, 0.75);
    color: #1D1D1F;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.16s ease;
}

.ms-mode-pill:hover {
    border-color: rgba(15, 76, 129, 0.35);
}

.ms-mode-pill.active {
    background: #0F4C81;
    border-color: #0F4C81;
    color: #ffffff;
    box-shadow: 0 8px 18px -8px rgba(15, 76, 129, 0.55);
}

.ms-ab-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0.75rem;
}

.ms-ab-toggle {
    display: inline-flex;
    padding: 0.24rem;
    border-radius: 12px;
    background: rgba(29, 29, 31, 0.06);
    border: 1px solid rgba(29, 29, 31, 0.08);
    gap: 0.2rem;
}

.ms-ab-btn,
.ms-vis-mode {
    border: none;
    background: transparent;
    color: #515154;
    padding: 0.42rem 0.85rem;
    border-radius: 9px;
    font-size: 0.83rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
}

.ms-ab-btn.active,
.ms-vis-mode.active {
    background: #FFFFFF;
    color: #0F4C81;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* Recorder Stage & VU Meter */
.ms-rec-stage {
    background: #0F172A;
    color: #F8FAFC;
    border-radius: 16px;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ms-rec-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ms-rec-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.86rem;
    font-weight: 600;
    color: #CBD5E1;
}

.ms-rec-indicator .ms-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #64748B;
}

.ms-rec-indicator.recording {
    color: #FCA5A5;
}

.ms-rec-indicator.recording .ms-dot {
    background: #EF4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.25);
    animation: msPulse 1.1s infinite;
}

.ms-rec-indicator.paused .ms-dot {
    background: #F59E0B;
}

@keyframes msPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.75; }
}

.ms-rec-timer {
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFFFFF;
}

.ms-vu-wrapper {
    margin-bottom: 0.75rem;
}

.ms-vu-label-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.76rem;
    color: #94A3B8;
    margin-bottom: 0.3rem;
}

.ms-vu-bar-bg {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.ms-vu-bar-fill {
    width: 0%;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #10B981 0%, #38BDF8 60%, #F59E0B 85%, #EF4444 100%);
    transition: width 0.06s linear;
}

.ms-canvas-scope {
    width: 100%;
    height: 140px;
    display: block;
    border-radius: 12px;
    background: #0B1220;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.ms-video-preview {
    width: 100%;
    max-height: 320px;
    border-radius: 12px;
    margin-top: 0.75rem;
    background: #000;
}

.ms-player-mount audio,
.ms-player-mount video {
    width: 100%;
    border-radius: 12px;
    max-height: 360px;
}

/* History & Queue Rows */
.ms-empty-state {
    font-size: 0.88rem;
    color: #6E6E73;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(29, 29, 31, 0.03);
    border: 1px dashed rgba(29, 29, 31, 0.12);
}

.ms-take-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(29, 29, 31, 0.08);
    margin-bottom: 0.5rem;
}

.ms-take-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.ms-take-info strong {
    font-size: 0.88rem;
    color: #1D1D1F;
}

.ms-take-info span {
    font-size: 0.76rem;
    color: #6E6E73;
}

/* Waveform Scrubber & Sliders */
.ms-wave-container {
    margin-top: 1rem;
    background: #0F172A;
    border-radius: 14px;
    padding: 0.75rem;
}

#trim-wave-canvas {
    width: 100%;
    height: 170px;
    display: block;
    cursor: pointer;
    border-radius: 8px;
}

.ms-wave-hint {
    margin-top: 0.4rem;
    font-size: 0.76rem;
    color: #94A3B8;
}

.ms-range-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.25rem;
}

.ms-range {
    width: 100%;
    accent-color: #0F4C81;
    cursor: pointer;
}

.ms-num-sm {
    width: 90px;
    padding: 0.3rem 0.5rem;
    font-size: 0.84rem;
}

.ms-val-tag {
    font-size: 0.8rem;
    font-weight: 600;
    color: #0F4C81;
    background: rgba(15, 76, 129, 0.08);
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
}

/* Poster Waveform Canvas */
.ms-poster-canvas {
    width: 100%;
    height: auto;
    aspect-ratio: 1920 / 600;
    border-radius: 14px;
    border: 1px solid rgba(29, 29, 31, 0.1);
    background: #F8FAFC;
    display: block;
}

/* Dropzone tweaks */
.ms-dz-title {
    font-weight: 700;
    color: #1D1D1F;
    margin-top: 0.45rem;
}

.ms-dz-sub {
    font-size: 0.82rem;
    color: #6E6E73;
    margin-top: 0.2rem;
}

.ms-dz-compact {
    padding: 1.15rem 1rem;
}

/* BPM Detector & Tap Pad */
.ms-bpm-display {
    text-align: center;
    padding: 1.15rem 0.75rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(15, 76, 129, 0.06) 0%, rgba(15, 118, 110, 0.06) 100%);
    border: 1px solid rgba(15, 76, 129, 0.12);
    margin-top: 0.9rem;
}

.ms-bpm-number {
    font-size: 2.85rem;
    font-weight: 800;
    color: #0F4C81;
    line-height: 1.05;
}

.ms-bpm-unit {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: #0F766E;
    margin-top: 0.25rem;
}

.ms-bpm-sub {
    font-size: 0.82rem;
    color: #515154;
    margin-top: 0.35rem;
}

.ms-bpm-tap-box {
    margin-top: 0;
    margin-bottom: 0.85rem;
}

.ms-tap-pad {
    width: 100%;
    padding: 1.45rem 1rem;
    border-radius: 16px;
    border: 2px solid rgba(15, 76, 129, 0.25);
    background: linear-gradient(135deg, #0F4C81 0%, #135D9E 100%);
    color: #FFFFFF;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    transition: transform 0.06s ease, box-shadow 0.15s ease;
    box-shadow: 0 12px 24px -10px rgba(15, 76, 129, 0.45);
}

.ms-tap-pad i {
    font-size: 1.65rem;
}

.ms-tap-pad span {
    font-family: 'Outfit', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

.ms-tap-pad small {
    font-size: 0.78rem;
    opacity: 0.85;
}

.ms-tap-pad:active,
.ms-tap-pad.tapped {
    transform: scale(0.97);
    background: linear-gradient(135deg, #0F766E 0%, #0D9488 100%);
    border-color: #0F766E;
}

kbd {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    font-size: 0.76rem;
    font-family: 'JetBrains Mono', monospace;
    background: #FFFFFF;
    border: 1px solid rgba(29, 29, 31, 0.2);
    border-radius: 5px;
    box-shadow: 0 1px 0 rgba(29, 29, 31, 0.15);
}

/* ID3 Editor */
.ms-id3-grid {
    display: grid;
    grid-template-columns: 185px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.ms-cover-col {
    display: flex;
    flex-direction: column;
}

.ms-cover-box {
    width: 180px;
    height: 180px;
    border-radius: 14px;
    background: rgba(29, 29, 31, 0.05);
    border: 1px dashed rgba(29, 29, 31, 0.18);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: #6E6E73;
    overflow: hidden;
    font-size: 0.82rem;
}

.ms-cover-box i {
    font-size: 2.2rem;
}

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

.ms-table-wrap {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(29, 29, 31, 0.1);
}

.ms-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.84rem;
    background: #FFFFFF;
}

.ms-table th,
.ms-table td {
    text-align: left;
    padding: 0.55rem 0.75rem;
    border-bottom: 1px solid rgba(29, 29, 31, 0.07);
}

.ms-table th {
    background: rgba(29, 29, 31, 0.03);
    font-weight: 700;
    color: #515154;
    font-size: 0.76rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Warning Banner */
.ms-warn-banner {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 0.95rem;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.12);
    border: 1px solid rgba(217, 119, 6, 0.3);
    color: #92400E;
    font-size: 0.86rem;
    margin-top: 0.85rem;
}

/* Video Editor Workbench */
.ms-video-workbench {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: start;
}

.ms-video-stage {
    background: #0F172A;
    border-radius: 16px;
    padding: 0.75rem;
}

#vid-preview-canvas {
    width: 100%;
    height: auto;
    max-height: 360px;
    object-fit: contain;
    display: block;
    background: #020617;
    border-radius: 10px;
}

.ms-video-scrubber {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.65rem;
}

.ms-check-group {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 38px;
}

.ms-check {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1D1D1F;
    cursor: pointer;
}

.ms-watermark-box {
    padding: 0.8rem;
    border-radius: 12px;
    background: rgba(29, 29, 31, 0.03);
    border: 1px solid rgba(29, 29, 31, 0.08);
}

.ms-progress-wrap {
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 76, 129, 0.12);
    overflow: hidden;
    margin-top: 0.75rem;
}

.ms-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #0F4C81, #0F766E);
    transition: width 0.15s ease;
}

/* Video to GIF */
.ms-gif-video-preview {
    width: 100%;
    max-height: 290px;
    border-radius: 14px;
    background: #0F172A;
}

.ms-inline-input {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.ms-gif-result-wrap {
    text-align: center;
    background: rgba(29, 29, 31, 0.04);
    border-radius: 14px;
    padding: 1rem;
}

#gif-output-img {
    max-width: 100%;
    max-height: 380px;
    border-radius: 10px;
    box-shadow: 0 10px 26px -12px rgba(15, 23, 42, 0.25);
}

/* Responsive Breakpoints */
@media (max-width: 960px) {
    .ms-video-workbench,
    .ms-id3-grid {
        grid-template-columns: 1fr;
    }

    .ms-col-span-2 {
        grid-column: span 1;
    }
}
