/* ==========================================================================
   Video MMS Recorder Modal
   ========================================================================== */

.vmms-overlay {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.vmms-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}
.vmms-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}
.dark .vmms-modal {
    background: #1f2937;
}

/* Header */
.vmms-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
.dark .vmms-header {
    border-bottom-color: #374151;
    background: #111827;
}
.vmms-header__title {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}
.dark .vmms-header__title {
    color: #f3f4f6;
}
.vmms-header__title svg {
    width: 16px;
    height: 16px;
    color: #ef4444;
}
.vmms-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: none;
    cursor: pointer;
    border-radius: 6px;
    color: #6b7280;
    transition: all 0.15s;
}
.vmms-close:hover {
    background: #f3f4f6;
    color: #374151;
}
.dark .vmms-close:hover {
    background: #374151;
    color: #d1d5db;
}
.vmms-close svg {
    width: 16px;
    height: 16px;
}

/* Viewport / video area */
.vmms-viewport {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #000;
    overflow: hidden;
}
.vmms-viewport video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vmms-viewport video.vmms-mirror {
    transform: scaleX(-1);
}

/* Countdown overlay */
.vmms-countdown {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.4);
    z-index: 2;
}
.vmms-countdown__number {
    font-size: 5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    animation: vmms-countdown-pop 1s ease-out infinite;
}
@keyframes vmms-countdown-pop {
    0% { transform: scale(1.3); opacity: 0.7; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.9); opacity: 0.5; }
}

/* Recording indicator */
.vmms-rec-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    z-index: 2;
}
.vmms-rec-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    animation: vmms-rec-pulse 1s ease-in-out infinite;
}
@keyframes vmms-rec-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}
.vmms-rec-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

/* Timer bar */
.vmms-timer-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: #ef4444;
    transition: width 1s linear;
    z-index: 2;
}

/* Controls */
.vmms-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0.75rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}
.dark .vmms-controls {
    background: #111827;
    border-top-color: #374151;
}

/* Record button */
.vmms-record-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid #ef4444;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}
.vmms-record-btn:hover {
    transform: scale(1.08);
}
.vmms-record-btn__inner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #ef4444;
    transition: all 0.2s;
}
.vmms-record-btn--recording .vmms-record-btn__inner {
    width: 18px;
    height: 18px;
    border-radius: 4px;
}
.dark .vmms-record-btn {
    background: #1f2937;
}

/* Action buttons (Send / Re-record) */
.vmms-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.vmms-action-btn svg {
    width: 16px;
    height: 16px;
}
.vmms-action-btn--send {
    background: #0d9488;
    color: #fff;
}
.vmms-action-btn--send:hover {
    background: #0f766e;
}
.vmms-action-btn--redo {
    background: #f3f4f6;
    color: #6b7280;
}
.vmms-action-btn--redo:hover {
    background: #e5e7eb;
    color: #374151;
}
.dark .vmms-action-btn--redo {
    background: #374151;
    color: #9ca3af;
}
.dark .vmms-action-btn--redo:hover {
    background: #4b5563;
    color: #d1d5db;
}

/* Status states */
.vmms-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    min-height: 160px;
}
.vmms-status__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e5e7eb;
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: vmms-spin 0.7s linear infinite;
}
@keyframes vmms-spin {
    to { transform: rotate(360deg); }
}
.vmms-status__text {
    font-size: 0.8125rem;
    color: #6b7280;
    font-weight: 500;
}
.vmms-status__success {
    color: #059669;
    font-weight: 600;
}
.vmms-status__error {
    color: #dc2626;
    font-size: 0.8125rem;
    text-align: center;
    padding: 0 1rem;
}

/* Error state */
.vmms-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem;
    min-height: 160px;
}
.vmms-error__icon {
    width: 32px;
    height: 32px;
    color: #ef4444;
}
.vmms-error__text {
    font-size: 0.8125rem;
    color: #6b7280;
    text-align: center;
    max-width: 300px;
    line-height: 1.5;
}
