﻿/* =========================================================
   GLOBAL
========================================================= */

[id] {
    scroll-margin-top: 100px;
}

.clickable {
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* =========================================================
   FILTERS / EFFECTS
========================================================= */

.black-white-transparent {
    filter: grayscale(100%);
    opacity: 0.5;
}

.mask-custom {
    backdrop-filter: blur(4px);
    background-color: rgba(255, 0, 0, 0.3);
}

/* =========================================================
   ANIMATIONS
========================================================= */

@keyframes fadeOut {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 2s ease-in-out forwards;
}

@keyframes fadeOutToHide {
    to {
        visibility: hidden;
        opacity: 0;
    }
}

.play-once {
    animation: fadeOutToHide 0s linear 6s forwards;
}

/* =========================================================
   GIF OVERLAY
========================================================= */

.gif-container {
    position: relative;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay-gif {
    width: 75%;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* =========================================================
   BREADCRUMB
========================================================= */

.breadcrumb {
    margin-bottom: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: 0.3rem;
}

    .breadcrumb-item + .breadcrumb-item::before {
        padding-right: 0.3rem;
    }

@media (max-width: 576px) {
    .breadcrumb {
        font-size: 0.75rem;
    }
}

/* =========================================================
   SECTION HEADERS (CATEGORIES)
========================================================= */

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.section-badge {
    max-width: 75px;
    width: 100%;
    height: auto;
}

.section-title {
    font-size: 1.25rem;
    white-space: nowrap;
    margin: 0;
}

/* =========================================================
   BADGE BLOCK (Course & Lesson)
========================================================= */

.badge-block {
    width: 80px;
    text-align: center;
}

    .badge-block > img {
        max-width: 48px;
        width: 100%;
        height: auto;
    }

    .badge-block .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.4rem;
        display: block;
        margin-top: 0.25rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* =========================================================
   BADGE OVERLAY (UNIFIED SYSTEM)
========================================================= */

.badge-overlay {
    /* Defaults (Details page) */
    --badge-size: 80px;
    --icon-size: 48px;
    --icon-offset: -18px;
    position: relative;
    display: inline-block;
}

/* Profile page badge sizing (72x72 + bigger overlay icons) */
.profile-page .badge-overlay {
    --badge-size: 72px;
    --icon-size: 28px; /* increase this to make lock/unlock/star bigger */
    --icon-offset: -2px; /* tweak to move icon inward/outward */
}

/* Crop viewport */
.badge-overlay__crop {
    width: var(--badge-size);
    height: var(--badge-size);
    overflow: hidden;
    position: relative;
}

    /* Center image in crop */
    .badge-overlay__crop img {
        position: absolute;
        top: 50%;
        left: 50%;
        width: var(--badge-size);
        height: var(--badge-size);
        transform: translate(-50%, -50%);
    }

/* Optional generic image support */
.badge-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Overlay icon */
.badge-overlay__icon {
    position: absolute;
    right: var(--icon-offset);
    bottom: var(--icon-offset);
    font-size: var(--icon-size);
    z-index: 2;
    text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

/* Overlay icon colors */
.badge-overlay__icon--locked {
    color: #dc3545;
}

.badge-overlay__icon--unlocked {
    color: #198754;
}

.badge-overlay__icon--star {
    color: #ffc107;
}

/* =========================================================
   Badge with border
*/

.badge.badge-overlay__icon--star {
    background-color: #fff8e1; /* soft gold */
    color: #ffc107;
    border: 1.5px solid #ffc107;
}

.badge.badge-overlay__icon--unlocked {
    background-color: #e9f7ef;
    color: #198754;
}

.badge.badge-overlay__icon--lock {
    background-color: #fdecea;
    color: #dc3545;
}

/* =========================================================
   PROFILE PAGE — MOBILE (≤576px)
   Scale EVERYTHING down ~20%
========================================================= */

@media (max-width: 576px) {

    /* Badge container */
    .profile-page .badge-block {
        width: 64px; /* 80 × 0.8 */
    }

    /* Badge image + overlay */
    .profile-page .badge-overlay {
        --badge-size: 58px; /* 72 × 0.8 */
        --icon-size: 22px; /* 28 × 0.8 */
        --icon-offset: -3px;
    }

    /* Badge title text */
    .profile-page .badge-block .badge {
        font-size: 0.6rem; /* 0.75 × 0.8 */
        padding: 0.15rem 0.3rem;
    }

    /* Reduce spacing between badge groups */
    .profile-page .badge-block {
        margin-bottom: 0.25rem;
    }
}

/* =========================================================
   Locked badge visual + UX
========================================================= */
.locked-badge {
    cursor: not-allowed;
}

    .locked-badge img {
        filter: grayscale(100%);
        opacity: 0.35;
    }

.locked-row {
    cursor: not-allowed;
}

    .locked-row img {
        filter: grayscale(100%);
        opacity: 0.4;
    }

/* =========================================================
   QUEST FILTER BUTTONS
========================================================= */

#filter-buttons .btn {
    white-space: nowrap;
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
}

.filter-btn.active {
    background-color: #0d6efd;
    color: white;
}

@media (max-width: 400px) {
    #filter-buttons {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* =========================================================
   CATALOG TREE / FOLDABLE ITEMS
========================================================= */

ul.catalog-tree {
    list-style-type: none;
    padding-left: 0;
}

    ul.catalog-tree .nested {
        margin-left: 1.5rem;
    }

ul.nested {
    margin-left: 1.5rem;
    list-style-type: none;
}

.hidden {
    display: none;
}

.toggle-button {
    cursor: pointer;
    margin-right: 4px;
    background: none;
    border: none;
    font-weight: bold;
    font-size: 1rem;
}

    .toggle-button.open::after {
        content: "▼";
    }

    .toggle-button:not(.open)::after {
        content: "▶";
    }

/* =========================================================
   TOOL TIPS  
========================================================= */
.tooltip {
    transition: opacity 0.3s ease-in-out;
}
