/* Bootstrap 5 underlines links by default; keep the Bootstrap 4 look (underline on hover only). */
a {
    text-decoration: none;
}

a:not(.btn):not(.badge):hover {
    text-decoration: underline;
}

/* In dark mode .text-bg-dark matches the page background, so lift it to stay visible. */
[data-bs-theme="dark"] .badge.text-bg-dark {
    background-color: var(--bs-gray-700) !important;
}

.theme-switch {
    display: inline-flex;
    gap: 0.25rem;
    margin: 0.5rem 0 0 0.75rem;
}

#video-container, #thumbnails {
    margin-top: 15px;
}

.flash-container {
    padding: 0 15px;
}

.buttons-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 15px 0;
}

#video-container video,
.plyr,
.plyr__video-wrapper,
#thumbnails img {
    max-width: 100%;
}

#video-container video,
.plyr {
    width: 100%;
}

#thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

#thumbnails .img-container {
    position: relative;
    flex: 1 1 calc(25% - 3px);
    min-width: 150px;
}

.img-container .img-seconds {
    position: absolute;
    width: 70px;
    color: #fff;
    background: #1964a6;
    margin-left: 10px;
    margin-top: 10px;
    border: solid 1px #013e6a;
    border-radius: 5px;
    padding: 5px;
    display: none;
    cursor: pointer;
}

.img-container:hover .img-seconds {
    display: block;
}

.mobile-break {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.record-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.record-path {
    min-width: 0;
}

.record-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
}

.record-actions .badge,
.record-actions .btn {
    margin: 0;
}

.record-actions svg {
    flex: 0 0 auto;
}

.video-actions {
    margin-top: 1rem;
}

.player-helper {
    width: 100%;
    height: auto;
    padding: 1rem;
    margin-top: 1rem;
}

.player-helper > :last-child {
    margin-bottom: 0;
}

.job-item-row {
    gap: 0.75rem;
}

.login-card {
    max-width: 420px;
    margin: 2rem auto;
    padding: 1.25rem;
    border: var(--bs-border-width) solid var(--bs-border-color);
    border-radius: var(--bs-border-radius);
    background: var(--bs-body-bg);
}

.login-card .btn[type="submit"] {
    width: 100%;
}

.table-responsive {
    -webkit-overflow-scrolling: touch;
}

@media (min-width: 992px) {
    .player-helper {
        position: fixed;
        top: 1rem;
        left: 1rem;
        width: 300px;
        max-height: calc(100vh - 2rem);
        overflow-y: auto;
        z-index: 1030;
    }

    .player-content {
        padding-left: 340px;
    }

    .helper-toggle-mobile {
        display: none;
    }
}

@media (min-width: 1920px) {
    .player-content {
        max-width: none;
    }

    #video-container {
        margin-right: 0;
    }

    #thumbnails .img-container {
        flex: 0 1 calc(33.333% - 3px);
        min-width: 0;
    }

    #thumbnails img {
        width: 100%;
        height: auto;
    }
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.95rem;
    }

    .theme-switch {
        margin: 0.75rem 0 0 15px;
    }

    .buttons-container .btn,
    .buttons-container .badge,
    .buttons-container > span {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .flash-container {
        padding-top: 0.75rem;
    }

    .record-actions .badge,
    .record-actions .btn,
    .player-helper .btn {
        width: 100%;
        text-align: center;
    }

    .job-item-row .job-actions {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: 100%;
    }

    .job-item-row .job-actions .btn {
        flex: 1 1 100%;
        margin-left: 0;
    }

    .mobile-url-group {
        flex-direction: column;
    }

    .mobile-url-group > .form-control,
    .mobile-url-group > .btn {
        width: 100%;
        border-radius: var(--bs-border-radius);
    }

    #thumbnails .img-container {
        width: 100%;
    }

    #thumbnails img {
        height: auto;
    }

    .player-helper {
        position: fixed;
        top: 3.5rem;
        left: 0;
        right: 0;
        width: 100%;
        max-height: calc(100vh - 4rem);
        overflow-y: auto;
        z-index: 1020;
        transform: translateX(-100%);
        transition: transform 0.3s ease-in-out;
    }

    .player-helper.show {
        transform: translateX(0);
    }

    .helper-toggle-mobile {
        position: fixed;
        top: 1rem;
        left: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        padding: 0.4rem;
        background-color: var(--bs-primary);
        border: none;
        border-radius: 0.375rem;
        color: white;
        cursor: pointer;
        z-index: 1031;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background-color 0.2s ease;
    }

    .helper-toggle-mobile:hover {
        background-color: #0b5ed7;
    }

    .helper-toggle-mobile:active {
        background-color: #0a58ca;
    }
}