/* Avatar Tab Styles */
#avatar-display-container {
    position: relative;
    width: 300px;
    height: 400px;
    margin: 0 auto;
    border: 3px solid #333;
    border-radius: 10px;
    overflow: hidden;
    background-color: #f0f0f0;
}

.avatar-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Ensures images respect aspect ratio */
    object-position: bottom center;
    /* Aligns all layers to the bottom */
    z-index: 1;
}

/* Layer specific z-indices (Front to Back) */
/* Order: glasses, hair, jacket, t-shirt, head, trainers, trousers, arms, background */
.avatar-layer.glasses {
    z-index: 10;
}

.avatar-layer.hair {
    z-index: 9;
}

.avatar-layer.jacket {
    z-index: 8;
}

.avatar-layer.t-shirt {
    z-index: 7;
}

.avatar-layer.head {
    z-index: 6;
}

.avatar-layer.trainers {
    z-index: 4;
}

.avatar-layer.trousers {
    z-index: 3;
}

.avatar-layer.arms {
    z-index: 2;
}

.avatar-layer.background {
    object-fit: cover;
    /* Background should fill the container */
    object-position: center;
    z-index: 1;
}

/* Helper to raise trainers above trousers (z-index 4) */
.avatar-layer.trainers.layer-over-trousers {
    z-index: 5 !important;
}

/* Avatar Builder Styles */
.avatar-builder-container {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.15);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    height: 100%;
}

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.category-btn {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    color: #555;
}

.category-btn.active {
    background: #4a90e2;
    color: white;
    border-color: #4a90e2;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 144, 226, 0.3);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
}

.option-card {
    background: white;
    border-radius: 10px;
    padding: 0;
    /* REMOVED padding to maximize icon size */
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-card img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
    /* Add slight internal padding to prevent edge touching if needed, or keeping it 0 for max size */
}

.option-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.option-card.active {
    border-color: #4a90e2;
    background-color: #f0f7ff;
    transform: scale(1.05);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.2);
}

/* 3D Pop Animation */
@keyframes popIn {
    0% {
        transform: scale(0.9);
        opacity: 0.8;
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.pop-anim {
    animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* --- Avatar App Collections Mode --- */
.avatar-mode-container {
    animation: fadeInUp 0.5s ease-out;
}

#avatar-collections-carousel {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding: 1rem 0.5rem;
    scroll-behavior: smooth;
}

.collection-card {
    min-width: 140px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.collection-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
}

.collection-card img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.collection-card h6 {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.collection-card p {
    font-size: 0.75rem;
    color: #aaa;
    margin-bottom: 0.75rem;
    line-height: 1.2;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spinHighlight {
    0% {
        transform: rotate(0deg) scale(1);
        filter: brightness(1);
    }

    50% {
        transform: rotate(180deg) scale(1.1);
        filter: brightness(1.2);
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6);
    }

    100% {
        transform: rotate(360deg) scale(1);
        filter: brightness(1);
    }
}

/* --- Avatar Shop Category Grid --- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
    margin-bottom: 1.5rem;
}

.category-icon-btn {
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    z-index: 1;
}

.category-icon-btn i {
    font-size: 1.2rem;
    color: #6c757d;
    transition: all 0.2s ease;
}

.category-icon-btn:hover {
    background: #e9ecef;
    transform: scale(1.05);
    border-color: #adb5bd;
    z-index: 10;
}

.category-icon-btn:hover i {
    color: #495057;
}

.category-icon-btn.active {
    background: var(--primary-color, #0d6efd);
    border-color: var(--primary-color, #0d6efd);
    box-shadow: 0 0 15px rgba(13, 110, 253, 0.4);
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.category-icon-btn.active i {
    color: #fff;
    transform: scale(1.1);
}

/* Tooltip on hover */
.category-icon-btn::after,
.collection-icon-container::after {
    content: attr(data-label);
    position: absolute;
    top: 100%;
    margin-top: -5px;
    /* Pull it slightly up closer to the icon */
    left: 50%;
    transform: translateX(-50%);
    /* Move it below the element */
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 100;
}

.category-icon-btn:hover::after,
.collection-icon-container:hover::after {
    opacity: 1;
}

@media (max-width: 576px) {
    .category-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
}

/* --- Avatar Mode Switch (Segmented Control) --- */
.avatar-mode-switch-container {
    display: flex;
    background-color: #e9ecef;
    /* Light grey track */
    border: 1px solid #dee2e6;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    /* Inner shadow for depth */
    border-radius: 50px;
    /* Pill shape */
    padding: 4px;
    margin-bottom: 20px;
    position: relative;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.mode-switch-item {
    flex: 1;
    text-align: center;
    padding: 8px 16px;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: #6c757d;
    /* Inactive grey */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    user-select: none;
}

.mode-switch-item.active {
    background-color: #fff;
    color: #0d6efd;
    /* Active Blue */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    /* Pop out shadow */
    transform: scale(1.02);
    /* Slight scale up */
}

/* Subtopic Complete Due Button Styling (V2.1.0 Feature) */
.complete-due-subtopic-btn {
    font-size: 0.75rem !important;
    padding: 2px 8px !important;
    border-radius: 4px !important;
    border-width: 1px !important;
    transition: all 0.2s ease !important;
    white-space: nowrap !important;
}

.complete-due-subtopic-btn:hover {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3) !important;
}

.complete-due-subtopic-btn.active {
    background-color: #ffc107 !important;
    border-color: #ffc107 !important;
    color: #000 !important;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3) !important;
}

.complete-due-subtopic-btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 1px 2px rgba(255, 193, 7, 0.3) !important;
}

/* Ensure proper spacing in subtopic layout */
.form-check .d-flex.align-items-center {
    gap: 0.5rem;
}

/* Mobile responsiveness for subtopic buttons */
@media (max-width: 768px) {
    .complete-due-subtopic-btn {
        font-size: 0.7rem !important;
        padding: 1px 6px !important;
    }

    .form-check .d-flex.align-items-center {
        flex-wrap: wrap;
        gap: 0.25rem;
    }
}


.badge-summary-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 6px 0 0;
    padding: 7px 12px;
    max-width: 150px;
    border-radius: 12px;
    background: linear-gradient(140deg, rgba(255, 214, 117, 0.92), rgba(255, 246, 217, 0.92));
    border: 1px solid rgba(255, 185, 62, 0.55);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.12);
    color: #2C3E50;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.badge-summary-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    border-color: rgba(255, 185, 62, 0.7);
}

.badge-summary-card:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.14);
}

.badge-summary-card:focus-visible {
    outline: 3px solid rgba(255, 185, 62, 0.65);
    outline-offset: 3px;
}

.badge-summary-icon {
    background: rgba(255, 185, 62, 0.2);
    color: #ffb93e;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.4);
}

.badge-summary-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    text-align: left;
}

.badge-summary-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5c4d00;
    opacity: 0.9;
}

.badge-summary-count {
    font-weight: 700;
    font-size: 1.05rem;
    color: #2C3E50;
}

@media (max-width: 1024px) {
    .badge-summary-card {
        max-width: 180px;
        padding: 9px 14px;
        gap: 12px;
    }

    .badge-summary-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .badge-summary-count {
        font-size: 1.1rem;
    }
}

.badge-progress-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(28, 48, 74, 0.95), rgba(46, 92, 147, 0.85));
    box-shadow: 0 10px 26px rgba(10, 20, 35, 0.28);
    color: #ffffff;
    margin-bottom: 24px;
}

.badge-progress-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    background: rgba(255, 185, 62, 0.22);
    color: #ffca5b;
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, 0.35);
}

.badge-progress-heading {
    font-weight: 600;
    font-size: 1.15rem;
    letter-spacing: 0.01em;
}

.badge-progress-subtext {
    margin-top: 4px;
    font-size: 0.95rem;
    opacity: 0.92;
}

.badge-progress-banner .badge-progress-copy {
    flex: 1;
}

.badge-progress-count {
    font-weight: 700;
    font-size: 1.55rem;
    background: rgba(255, 185, 62, 0.18);
    color: #ffe7a8;
    padding: 8px 20px;
    border-radius: 999px;
    min-width: 110px;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(255, 255, 255, 0.25);
}

@media (max-width: 768px) {
    .badge-progress-banner {
        flex-direction: column;
        align-items: flex-start;
    }

    .badge-progress-count {
        align-self: stretch;
    }
}

@media (max-width: 576px) {
    .badge-summary-card {
        margin-top: 18px;
    }
}

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@600;700&display=swap');


#check-live-sessions-wrapper,
#check-live-lessons-wrapper {
    position: absolute;
    top: 90px;
    right: 25px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    z-index: 50;
    transition: transform 0.2s ease;
}

#check-live-sessions-wrapper:hover,
#check-live-lessons-wrapper:hover {
    transform: scale(1.05);
}

#check-live-sessions-fa-btn,
#check-live-lessons-fa-btn {
    font-size: 1.8rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#check-live-sessions-fa-btn {
    color: #ff4444;
}

#check-live-lessons-fa-btn {
    color: #d08b00;
}

#check-live-sessions-text,
#check-live-lessons-text {
    font-size: 0.65rem;
    font-weight: 700;
    margin-top: 2px;
    /* text-transform: uppercase; Removed per user request */
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.7);
    padding: 2px 4px;
    border-radius: 4px;
}

#check-live-sessions-text {
    color: #ff4444;
}

#check-live-lessons-text {
    color: #915f00;
}

#streak-wheel-svg {
    display: block;
    margin: 0 auto;
}

#streak-wheel-caption {
    margin-top: 4px;
    margin-bottom: 8px;
    font-size: 1rem;
    font-weight: 700;
    color: #ffb93e;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.7);
    line-height: 1.2;
}
