﻿/*
 * LaunchCompass
 * Copyright (c) 2026 Robert Morgan / RMC Software Solutions, LLC
 * All rights reserved.
 * 
 * This software is proprietary and confidential.
 * Unauthorized copying, modification, distribution, or use is strictly prohibited.
 * 
 * File: wwwroot\css\audio-panel.css
 * Author: Robert Morgan
 * Version: 1.1.0
 * Created: 01/31/2026
 * Modified: 02/11/2026
 * Released: 00/00/0000
 * 
 * Description:
 *     Styles for audio streaming panels on ShootingPage.
 *     Includes audio mode slider toggle, dropdown, mute button, and status indicator.
 *     Supports both Direct Stream and Web Page panel modes.
 *     v1.1.0: Added audio-mode-toggle slider, audio-mute-row, web page panel reuses
 *             existing audio-panel and audio-dropdown classes.
 * 
 * MVVM Role: Styling
 * Architecture: Component Styles
*/


/* ==========================================
   AUDIO MODE SLIDER TOGGLE
   Sits outside both panels - always visible
   ========================================== */

.audio-mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin: 1rem auto 0.5rem;
    max-width: 320px;
}

.audio-mode-label {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 500;
    transition: color 0.2s ease;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

    .audio-mode-label.active {
        color: var(--accent-color, #ff6b35);
    }

/* Toggle switch container */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
}

    .toggle-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

/* Slider track */
.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.15);
    border-radius: 13px;
    transition: background-color 0.3s ease;
}

    /* Slider knob */
    .toggle-slider::before {
        content: '';
        position: absolute;
        height: 20px;
        width: 20px;
        left: 3px;
        bottom: 3px;
        background-color: #ffffff;
        border-radius: 50%;
        transition: transform 0.3s ease;
    }

/* Checked state */
.toggle-switch input:checked + .toggle-slider {
    background-color: var(--accent-color, #ff6b35);
}

    .toggle-switch input:checked + .toggle-slider::before {
        transform: translateX(22px);
    }

/* ==========================================
   SHARED MUTE BUTTON ROW
   Visible in both modes
   ========================================== */

.audio-mute-row {
    display: flex;
    justify-content: center;
    margin: 0.25rem auto;
    max-width: 320px;
}

/* ==========================================
   AUDIO PANEL CONTAINER
   Used by both Direct Stream and Web Page panels
   ========================================== */

.audio-panel {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1rem;
    margin: 0.5rem auto;
    max-width: 320px;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

/* Row with dropdown (and optionally mute button) */
.audio-source-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

/* Audio source dropdown - shared by both panels */
.audio-dropdown {
    flex: 1;
    padding: 0.625rem 0.75rem;
    font-size: 0.9rem;
    background-color: rgba(30, 30, 30, 0.9);
    color: var(--text-primary, #ffffff);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%23888' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

    .audio-dropdown:focus {
        outline: none;
        border-color: var(--accent-color, #ff6b35);
    }

    .audio-dropdown option {
        background-color: #1e1e1e;
        color: #ffffff;
        padding: 0.5rem;
    }

/* Mute button */
.mute-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background-color: rgba(30, 30, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

    .mute-button:hover:not(.disabled) {
        background-color: rgba(50, 50, 50, 0.9);
        border-color: var(--accent-color, #ff6b35);
    }

    .mute-button.disabled {
        opacity: 0.4;
        cursor: not-allowed;
    }

.mute-icon {
    font-size: 1.25rem;
}

/* Status message */
.audio-status {
    font-size: 0.8rem;
    text-align: center;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.3s ease;
}

    .audio-status.status-idle {
        color: rgba(255, 255, 255, 0.5);
    }

    .audio-status.status-connecting {
        color: #ffc107;
    }

        .audio-status.status-connecting::after {
            content: '';
            animation: ellipsis 1.5s infinite;
        }

@keyframes ellipsis {
    0% {
        content: '';
    }

    25% {
        content: '.';
    }

    50% {
        content: '..';
    }

    75% {
        content: '...';
    }
}

.audio-status.status-connected {
    color: #4caf50;
}

.audio-status.status-failed {
    color: #f44336;
}

/* Ensure proper spacing from nav */
.shooting-page .audio-panel {
    margin-bottom: 5rem;
}
