/* =========================================
   Menu
========================================= */

#menu {
    position: fixed;
    top: 10px;
    right: 10px;

    display: block;

    width: 400px;
    max-width: calc(100vw - 20px);
    overflow: hidden;

    background: #2a2a2a;
    border-radius: 6px;

    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#menu summary {
    cursor: pointer;

    padding: 12px 16px;

    background: #313131;

    font-weight: bold;
    color: #cccccc;

    user-select: none;
}

#controls {
    display: flex;
    flex-direction: column;
    gap: 10px;

    padding: 12px 16px 16px;
}

/* =========================================
   MARK: Settings / Controls
========================================= */

.setting:not(:last-child) {
    margin-bottom: 1rem;
}

.inline-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

#srtTitle {
    display: block;

    max-width: 100%;
    overflow-wrap: anywhere;

    text-align: left;

    font-size: small;
    color: #888888;
}

.font-preview {
    text-align: center;

    margin-top: 0.6rem;
    margin-bottom: 0.3rem;
}

#applyFont {
    width: 92px;
}

/* =========================================
   Toggle Button
========================================= */

.toggle-btn {
    padding: 8px 14px;

    border: 1px solid #555;
    border-radius: 6px;

    background: #353535;
    color: #cccccc;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition:
        background 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.05s ease;
}

.toggle-btn:hover {
    background: #404040;
    border-color: #777;
}

.toggle-btn:active {
    transform: translateY(1px);
}

.toggle-btn.active {
    background: #777;
    border-color: #444;
    color: white;
}

.toggle-btn:focus-visible {
    outline: 2px solid #7cc7ff;
    outline-offset: 2px;
}

/* =========================================
   MARK: Playback
========================================= */

#playback-controls {
    margin-top: 1rem;
    display: flex; 
    justify-content: space-between;
}

#playBtn {
    width: 60px;
}

.progress-bar {
    --progress: 0%;
    --transition-time: 0.1s;

    width: 100%;
    height: 8px;

    margin-top: 8px;

    overflow: hidden;

    background-color: #444;
    border-radius: 4px;
}

.progress-bar::after {
    content: '';

    display: block;

    width: var(--progress);
    height: 100%;

    background-color: #FF8C00;
    border-radius: 4px;

    transition: width var(--transition-time) linear;
}

.progress-bar.between::after {
    background-color: #00008B;
}

.progress-bar.no-transition::after {
    transition: none;
}

/* =========================================
   MARK: Themes
========================================= */

.theme-row {
    padding: 6px 0;
    border-bottom: 1px solid #333;
}

.theme-row button {
    padding: 4px 8px;
}

/* =========================================
   MARK: Mobile Controls
========================================= */

.mobile-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);

    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.3s ease;
}

.mobile-controls.visible {
    opacity: 1;
    pointer-events: auto;
}

.mobile-btn {
    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(100, 100, 100, 0.4);
    color: rgba(200, 200, 200, 0.8);
    border: none;
    border-radius: 12px;

    font-size: 24px;
    user-select: none;

    transition:
        background 0.2s ease,
        transform 0.1s ease;
}

.mobile-btn:hover {
    background: rgba(120, 120, 120, 0.5);
}

.mobile-btn:active {
    transform: scale(0.95);
}

.mobile-btn-center {
    width: 56px;
    height: 56px;
    font-size: 28px;
    user-select: none;
}

.mobile-fullscreen-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;

    width: 50px;
    height: 50px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(100, 100, 100, 0.4);
    color: rgba(200, 200, 200, 0.8);
    border: none;
    border-radius: 12px;

    font-size: 24px;

    cursor: pointer;

    opacity: 0;
    pointer-events: none;
    user-select: none;

    transition:
        background 0.2s ease,
        transform 0.1s ease,
        opacity 0.3s ease;
}

.mobile-fullscreen-btn.visible {
    opacity: 1;
    pointer-events: auto;
}

.mobile-fullscreen-btn:hover {
    background: rgba(120, 120, 120, 0.8);
}

.mobile-fullscreen-btn:active {
    transform: scale(0.95);
}

/* =========================================
   MARK: Hotkeys
========================================= */

.hotkey-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.hotkey-row {
    display: flex;
    align-items: center;
    gap: 18px;
}