/* Home hero responsive styles */
#hero-container {
    position: relative;
    z-index: 10;
}

.hero-shell {
    /* width: min(100%, 840px);
    padding: 1.25rem 1rem 1.4rem;
    border-radius: 30px;
    background: linear-gradient(135deg, rgba(255,255,255,0.24), rgba(255,255,255,0.12));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18); */
    transform: translateY(-50px);
}

#logo-hero {
    width: 7rem;
    max-width: 100%;
    height: 7rem;
    display: block;
    margin: 0 auto;
    position: relative;
    z-index: 30;
    filter: drop-shadow(0 10px 24px rgba(15, 23, 42, 0.18));
}

.hero-search-form {
    width: 100%;
    margin: 0 auto;
}

#search-box {
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 3.35rem;
    width: 50rem;
    padding: 0 0.7rem;
    border-radius: 999px;
    /* background: linear-gradient(135deg, #ffffff 0%, #f4f9ff 100%); */
    border: 1px solid rgba(37, 99, 235, 0.18);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#search-box:focus-within {
    transform: translateY(-2px);
    border-color: rgba(37, 99, 235, 0.45);
    box-shadow: 0 18px 38px rgba(37, 99, 235, 0.2);
}

#search-box button {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.6rem;
    height: 2.6rem;
    margin-left: 0.45rem;
    border-radius: 999px;
    color: #2563eb;
    /* background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%); */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 6px 14px rgba(37, 99, 235, 0.14);
}

#search-box button:hover {
    transform: scale(1.04);
}

#search-box .search-input {
    text-align: right;
    font-size: 1rem;
    font-weight: 600;
    color: #0f172a;
    letter-spacing: 0.01em;
}

#search-box .search-input::placeholder {
    color: #64748b;
    font-weight: 500;
}

#search-box .search-input:focus {
    outline: none;
    box-shadow: none;
}

html.dark .hero-search-form a,
html.dark .hero-search-form a:hover {
    background-color: #374151 !important;
    color: #e5e7eb !important;
    border-color: rgba(148, 163, 184, 0.22) !important;
}

@media (max-width: 768px) {
    #hero-container {
        gap: 1rem;
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-shell {
        padding: 1rem 0.75rem 1.15rem;
        border-radius: 24px;
        transform: translateY(-150px);
    }

    #logo-hero {
        width: 7.5rem;
        margin-bottom: 0.25rem;
        margin-top: 9rem;
    }

    #search-box {
        height: 3.2rem;
        width: 100%;
        max-width: 100%;
        padding: 0 0.65rem;
    }

    #search-box .search-input {
        font-size: 1.02rem;
    }

    #search-box button {
        width: 2.45rem;
        height: 2.45rem;
        margin-left: 0.35rem;
    }

    #search-box button svg {
        width: 1.25rem;
        height: 1.25rem;
    }
}

/* Home-only navbar fix: remove unexpected right-side margin on home page
   Uses :root:has(#search-box) so it only applies when the home hero search exists. */
:root:has(#search-box) nav {
    left: 50% !important;
    transform: translateX(-50%) !important;
}

:root:has(#search-box) nav .navbar-inner {
    justify-content: space-between !important;
    gap: 1rem !important;
}

:root:has(#search-box) .navbar-search {
    margin: 0 !important;
    flex: 1 1 520px !important;
    min-width: 220px !important;
    max-width: 700px !important;
}

:root:has(#search-box) .navbar-links {
    margin-inline-start: 0 !important;
}

/* Strong centering fallback for home: avoid transform-based centering which
   can produce a visible offset on the home layout. Use margin auto instead. */
:root:has(#search-box) nav {
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    margin: 0.4rem auto 0 !important;
}

/* Platform stats - Premium design */

.platform-stats {
    opacity: 0;
    transform: translateY(20px);
    max-height: 80vh;
    overflow: hidden;
    transition: opacity 600ms cubic-bezier(0.34, 1.56, 0.64, 1), transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
    background-color: transparent;
}
.platform-stats.visible {
    opacity: 1;
    transform: translateY(0);
}

.platform-stats > div,
.platform-stats-detail-wrapper > div {
    max-width: min(80vw, 80rem);
    padding-left: max(1rem, calc((100vw - min(80vw, 80rem)) / 2));
    padding-right: max(1rem, calc((100vw - min(80vw, 80rem)) / 2));
}

/* Extra small phones: < 375px */
@media (max-width: 374px) {
    .platform-stats {
        max-height: none;
        overflow: visible;
    }

    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        max-width: 100vw;
        padding: 0 0.75rem !important;
    }

    .platform-stats .stat-item > div {
        padding: 1rem 1rem;
    }

    .stat-number {
        font-size: 2.25rem !important;
    }

    #platform-stats-detail {
        border-radius: 1.5rem !important;
        padding: 1rem !important;
    }
}

/* Small phones: 375px - 480px */
@media (min-width: 375px) and (max-width: 480px) {
    .platform-stats {
        max-height: none;
        overflow: visible;
    }

    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        max-width: 100vw;
        padding: 0 0.875rem !important;
    }

    .platform-stats .stat-item > div {
        padding: 1.125rem;
    }

    .stat-number {
        font-size: 2.5rem !important;
    }

    #platform-stats-detail {
        border-radius: 1.75rem !important;
        padding: 1.25rem !important;
    }
}

/* Medium phones: 481px - 640px */
@media (min-width: 481px) and (max-width: 640px) {
    .platform-stats {
        max-height: none;
        overflow: visible;
    }

    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        max-width: 100vw;
        padding: 0 1rem !important;
    }

    .platform-stats .stat-item > div {
        padding: 1.25rem;
    }

    .stat-number {
        font-size: 2.75rem !important;
    }

    #platform-stats-detail {
        border-radius: 1.75rem !important;
        padding: 1.5rem !important;
    }
}

/* Tablets: 641px - 1024px */
@media (min-width: 641px) and (max-width: 1024px) {
    .platform-stats {
        max-height: none;
        overflow: visible;
    }

    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        max-width: 95vw;
        padding: 0 1.5rem !important;
    }

    .platform-stats .stat-item > div {
        padding: 1.5rem;
    }

    .stat-number {
        font-size: 3rem !important;
    }

    #platform-stats-detail {
        border-radius: 2rem !important;
        padding: 1.75rem !important;
    }
}

/* Desktop: > 1024px */
@media (min-width: 1025px) {
    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        padding: 0 1.5rem !important;
    }
}

/* Unified media query for all mobile sizes */
@media (max-width: 1024px) {
    .platform-stats {
        max-height: none;
        overflow: visible;
    }

    .platform-stats > div,
    .platform-stats-detail-wrapper > div {
        max-width: min(100vw, 80rem);
    }
}

/* Stat item card hover effects */
.platform-stats .stat-item {
    cursor: pointer;
}

.platform-stats .stat-item > div {
    transition: all 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.platform-stats .stat-item:hover > div {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* Hover states with vibrant colors for each card type */
.platform-stats .stat-item[data-key="top_users"]:hover > div {
    background-color: rgba(219, 234, 254, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.platform-stats .stat-item[data-key="popular_courses"]:hover > div {
    background-color: rgba(224, 231, 255, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(79, 70, 229, 0.05) 100%);
}

.platform-stats .stat-item[data-key="top_teachers"]:hover > div {
    background-color: rgba(254, 243, 199, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.05) 100%);
}

.platform-stats .stat-item[data-key="popular_skills"]:hover > div {
    background-color: rgba(209, 250, 229, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.05) 100%);
}

/* Active states - same as hover when auto-rotating */
.platform-stats .stat-item.active > div {
    transform: translateY(-8px);
    box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.35);
}

.platform-stats .stat-item[data-key="top_users"].active > div {
    background-color: rgba(219, 234, 254, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(37, 99, 235, 0.05) 100%);
}

.platform-stats .stat-item[data-key="popular_courses"].active > div {
    background-color: rgba(224, 231, 255, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(79, 70, 229, 0.05) 100%);
}

.platform-stats .stat-item[data-key="top_teachers"].active > div {
    background-color: rgba(254, 243, 199, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.05) 100%);
}

.platform-stats .stat-item[data-key="popular_skills"].active > div {
    background-color: rgba(209, 250, 229, 0.65) !important;
    background-image: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(5, 150, 105, 0.05) 100%);
}

/* Stat number counter animation */
.platform-stats .stat-number {
    display: block;
    font-variant-numeric: tabular-nums;
    transition: all 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.platform-stats .stat-item:hover .stat-number {
    transform: scale(1.03);
}

.platform-stats .stat-item.active .stat-number {
    transform: scale(1.03);
}

html.dark .platform-stats .stat-item > div {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(8, 13, 24, 0.98));
    border-color: rgba(148, 163, 184, 0.22);
}

/* Dark mode hover states with vibrant colors */
html.dark .platform-stats .stat-item[data-key="top_users"]:hover > div {
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.4), rgba(37, 99, 235, 0.25)) !important;
    border-color: rgba(96, 165, 250, 0.3);
}

html.dark .platform-stats .stat-item[data-key="popular_courses"]:hover > div {
    background: linear-gradient(180deg, rgba(55, 48, 163, 0.4), rgba(99, 102, 241, 0.25)) !important;
    border-color: rgba(129, 140, 248, 0.3);
}

html.dark .platform-stats .stat-item[data-key="top_teachers"]:hover > div {
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.4), rgba(245, 158, 11, 0.25)) !important;
    border-color: rgba(252, 211, 77, 0.3);
}

html.dark .platform-stats .stat-item[data-key="popular_skills"]:hover > div {
    background: linear-gradient(180deg, rgba(4, 120, 87, 0.4), rgba(16, 185, 129, 0.25)) !important;
    border-color: rgba(52, 211, 153, 0.3);
}

/* Dark mode active states - same as hover */
html.dark .platform-stats .stat-item.active > div {
    transform: translateY(-8px);
    box-shadow: 0 10px 10px -5px rgba(0, 0, 0, 0.5);
}

html.dark .platform-stats .stat-item[data-key="top_users"].active > div {
    background: linear-gradient(180deg, rgba(30, 58, 138, 0.4), rgba(37, 99, 235, 0.25)) !important;
    border-color: rgba(96, 165, 250, 0.3);
}

html.dark .platform-stats .stat-item[data-key="popular_courses"].active > div {
    background: linear-gradient(180deg, rgba(55, 48, 163, 0.4), rgba(99, 102, 241, 0.25)) !important;
    border-color: rgba(129, 140, 248, 0.3);
}

html.dark .platform-stats .stat-item[data-key="top_teachers"].active > div {
    background: linear-gradient(180deg, rgba(120, 53, 15, 0.4), rgba(245, 158, 11, 0.25)) !important;
    border-color: rgba(252, 211, 77, 0.3);
}

html.dark .platform-stats .stat-item[data-key="popular_skills"].active > div {
    background: linear-gradient(180deg, rgba(4, 120, 87, 0.4), rgba(16, 185, 129, 0.25)) !important;
    border-color: rgba(52, 211, 153, 0.3);
}

html.dark .platform-stats .stat-item > div > div:nth-child(2) {
    opacity: 1;
    filter: saturate(1.2);
    box-shadow: 0 0 18px rgba(96, 165, 250, 0.35);
}

html.dark .platform-stats .stat-item[data-key="top_users"] > div > div:nth-child(2) {
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.95), rgba(96, 165, 250, 0.7), rgba(59, 130, 246, 0.06));
}

html.dark .platform-stats .stat-item[data-key="popular_courses"] > div > div:nth-child(2) {
    background: linear-gradient(180deg, rgba(99, 102, 241, 0.95), rgba(129, 140, 248, 0.72), rgba(99, 102, 241, 0.06));
}

html.dark .platform-stats .stat-item[data-key="top_teachers"] > div > div:nth-child(2) {
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.95), rgba(252, 211, 77, 0.72), rgba(245, 158, 11, 0.06));
}

html.dark .platform-stats .stat-item[data-key="popular_skills"] > div > div:nth-child(2) {
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.95), rgba(52, 211, 153, 0.72), rgba(16, 185, 129, 0.06));
}

/* Detail panel premium styling */
#platform-stats-detail {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(18px);
    color: #0f172a;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.35);
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08);
    transition: max-height 1000ms cubic-bezier(0.22, 1, 0.36, 1), opacity 800ms ease, transform 800ms ease, background-color 200ms ease, border-color 200ms ease, color 200ms ease !important;
    will-change: max-height, opacity, transform;
}

.mobile-stat-detail {
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transform: translateY(8px);
    transition: opacity 320ms ease, transform 320ms ease, max-height 500ms cubic-bezier(0.22, 1, 0.36, 1), margin-top 300ms ease;
    margin-top: 0;
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.28);
    box-shadow: 0 18px 35px -20px rgba(15, 23, 42, 0.3);
    touch-action: manipulation;
}

.mobile-stat-detail.is-open {
    opacity: 1;
    transform: translateY(0);
    margin-top: 0.75rem;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.mobile-stat-detail,
.mobile-stat-detail p,
.mobile-stat-detail span,
.mobile-stat-detail li,
.mobile-stat-detail a,
.mobile-stat-detail strong,
.mobile-stat-detail div,
.mobile-stat-detail h3,
.mobile-stat-detail h3 span {
    color: #0f172a;
}

.mobile-stat-detail h3 {
    line-height: 1.2;
}

.mobile-stat-detail h3 span {
    display: inline-block;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

@media (max-width: 767px) {
    .mobile-stat-detail {
        width: 100%;
        padding: 0;
        max-height: 75vh !important;
    }

    .mobile-stat-detail > div {
        border-radius: 1.5rem;
    }
}

/* Mobile responsive detail panel padding */
@media (max-width: 374px) {
    #platform-stats-detail {
        border-radius: 1.5rem !important;
    }
    #platform-stats-detail > div {
        padding: 0.75rem 0.75rem !important;
    }
}

@media (min-width: 375px) and (max-width: 480px) {
    #platform-stats-detail {
        border-radius: 1.75rem !important;
    }
    #platform-stats-detail > div {
        padding: 1rem 1rem !important;
    }
    #platform-stats-detail h3 {
        font-size: 1.25rem !important;
    }
}

@media (min-width: 481px) and (max-width: 640px) {
    #platform-stats-detail {
        border-radius: 1.75rem !important;
    }
    #platform-stats-detail > div {
        padding: 1.25rem 1.25rem !important;
    }
    #platform-stats-detail h3 {
        font-size: 1.375rem !important;
    }
}

@media (min-width: 641px) and (max-width: 1024px) {
    #platform-stats-detail {
        border-radius: 2rem !important;
    }
    #platform-stats-detail > div {
        padding: 1.5rem 1.75rem !important;
    }
    #platform-stats-detail h3 {
        font-size: 1.5rem !important;
    }
}

#platform-stats-detail h3 {
    color: #0f172a !important;
    line-height: 1.2;
}

#platform-stats-detail h3 span {
    display: inline-block;
    color: #0f172a !important;
    background-clip: text !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
}

html.dark #platform-stats-detail {
    color: #e2e8f0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(11, 16, 33, 0.96));
    border-color: rgba(96, 165, 250, 0.18);
    box-shadow: 0 25px 60px rgba(2, 6, 23, 0.5);
}

html.dark .platform-stats-badge {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(17, 24, 39, 0.9)) !important;
    border-color: rgba(125, 211, 252, 0.38) !important;
    box-shadow: 0 0 0 1px rgba(125, 211, 252, 0.16), 0 10px 24px rgba(2, 6, 23, 0.35) !important;
}

html.dark .platform-stats-badge-label {
    color: #e0f2fe !important;
    background: linear-gradient(90deg, #dbeafe 0%, #67e8f9 35%, #a7f3d0 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: 0 0 12px rgba(103, 232, 249, 0.2);
}

html.dark .platform-stats h2,
html.dark .platform-stats h2 span,
html.dark #platform-stats-detail h3,
html.dark #platform-stats-detail h3 span {
    color: #f8fafc !important;
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 28%, #93c5fd 55%, #67e8f9 100%) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    text-shadow: none !important;
}

html.dark #platform-stats-detail h3 {
    color: #f8fafc !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html.dark #platform-stats-detail h3 span {
    color: #f8fafc !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html.dark #platform-stats-detail,
html.dark #platform-stats-detail p,
html.dark #platform-stats-detail span,
html.dark #platform-stats-detail li,
html.dark #platform-stats-detail a,
html.dark #platform-stats-detail strong,
html.dark #platform-stats-detail div,
html.dark .mobile-stat-detail,
html.dark .mobile-stat-detail p,
html.dark .mobile-stat-detail span,
html.dark .mobile-stat-detail li,
html.dark .mobile-stat-detail a,
html.dark .mobile-stat-detail strong,
html.dark .mobile-stat-detail div {
    color: #e2e8f0;
}

html.dark .mobile-stat-detail h3,
html.dark .mobile-stat-detail h3 span {
    color: #f8fafc !important;
    background: none !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
    -webkit-text-fill-color: #f8fafc !important;
}

html.dark #platform-stats-detail .text-slate-900,
html.dark #platform-stats-detail .text-slate-800,
html.dark #platform-stats-detail .text-slate-700,
html.dark #platform-stats-detail .text-slate-600,
html.dark #platform-stats-detail .text-slate-500,
html.dark #platform-stats-detail .text-gray-900,
html.dark #platform-stats-detail .text-gray-800,
html.dark #platform-stats-detail .text-gray-700,
html.dark #platform-stats-detail .text-gray-600,
html.dark #platform-stats-detail .text-gray-500 {
    color: #f8fafc !important;
}

html.dark #platform-stats-detail .text-slate-400,
html.dark #platform-stats-detail .text-slate-300,
html.dark #platform-stats-detail .text-slate-500,
html.dark #platform-stats-detail .text-gray-400,
html.dark #platform-stats-detail .text-gray-300 {
    color: #cbd5e1 !important;
}

html.dark #platform-stats-detail .bg-white\/95,
html.dark #platform-stats-detail [class*="bg-white/"],
html.dark #platform-stats-detail .bg-slate-200,
html.dark #platform-stats-detail .bg-gray-100,
html.dark #platform-stats-detail .bg-slate-100,
html.dark #platform-stats-detail [class*="bg-gray-50"],
html.dark #platform-stats-detail [class*="bg-slate-50"],
html.dark #platform-stats-detail [class*="dark:bg-slate-900"],
html.dark #platform-stats-detail [class*="dark:bg-slate-700"] {
    background-color: rgba(15, 23, 42, 0.88) !important;
    border-color: rgba(96, 165, 250, 0.16) !important;
}

.mobile-stat-detail .skill-bar-fill {
    background: linear-gradient(90deg, #10b981 0%, #34d399 50%, #6ee7b7 100%) !important;
    box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.mobile-stat-detail .bg-slate-200,
.mobile-stat-detail [class*="bg-slate-200"] {
    background-color: rgba(226, 232, 240, 0.9) !important;
    border-color: rgba(16, 185, 129, 0.2) !important;
}

html.dark #platform-stats-detail .skill-bar-fill,
html.dark .mobile-stat-detail .skill-bar-fill {
    background: linear-gradient(90deg, #34d399 0%, #6ee7b7 35%, #10b981 100%) !important;
    box-shadow: 0 0 14px rgba(52, 211, 153, 0.45);
}

html.dark #platform-stats-detail .skill-bar-fill + .bg-slate-200,
html.dark #platform-stats-detail [class*="bg-slate-200"],
html.dark .mobile-stat-detail .bg-slate-200,
html.dark .mobile-stat-detail [class*="bg-slate-200"] {
    background-color: rgba(15, 23, 42, 0.75) !important;
    border-color: rgba(16, 185, 129, 0.28) !important;
}

/* Keep the detail illustration identical to light mode. */
html.dark #platform-stats-detail svg[aria-hidden="true"],
html.dark .mobile-stat-detail svg[aria-hidden="true"] {
    color: inherit !important;
    filter: none !important;
    opacity: 1 !important;
}

#platform-stats-detail.hidden {
    display: block !important;
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    animation: none;
}

#platform-stats-detail:not(.hidden) {
    opacity: 1;
    transform: translateY(0);
    animation: detailPanelFadeIn 600ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* Detail panel content */

@keyframes detailPanelFadeIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Detail panel header */
#platform-stats-detail h3 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html.dark #platform-stats-detail h3 {
    background: linear-gradient(135deg, #ffffff 0%, #e5e7eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Skill bar animation */
.skill-bar-fill {
    animation: fillBar 1.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes fillBar {
    from {
        width: 0 !important;
        opacity: 0;
    }
    to {
        width: var(--target-percent, 0%) !important;
        opacity: 1;
    }
}

/* List items in detail panel */
#platform-stats-detail ul li {
    transition: all 300ms ease;
    padding: 0.75rem 0;
}

#platform-stats-detail ul li:hover {
    transform: translateX(-4px);
}


/* Ensure the stats block sits above the particle background and is fully opaque */
.platform-stats {
    position: relative !important;
    z-index: 60 !important;
    background-color: transparent !important; /* keep outer transparent but child is solid */
}
.platform-stats > div {
    box-shadow: 0 8px 30px rgba(2,6,23,0.08) !important;
    opacity: 1 !important;
}

/* Keep this section tied to the site's explicit theme, not the OS theme. */
html:not(.dark) .platform-stats .stat-item > div,
html:not(.dark) #platform-stats-detail,
html:not(.dark) .mobile-stat-detail {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(148, 163, 184, 0.35) !important;
    color: #0f172a !important;
    box-shadow: 0 25px 60px rgba(15, 23, 42, 0.08) !important;
}

html:not(.dark) #platform-stats-detail,
html:not(.dark) .mobile-stat-detail {
    background: #ffffff !important;
}

html:not(.dark) #platform-stats-detail p,
html:not(.dark) #platform-stats-detail span,
html:not(.dark) #platform-stats-detail li,
html:not(.dark) #platform-stats-detail a,
html:not(.dark) #platform-stats-detail strong,
html:not(.dark) #platform-stats-detail div,
html:not(.dark) .mobile-stat-detail p,
html:not(.dark) .mobile-stat-detail span,
html:not(.dark) .mobile-stat-detail li,
html:not(.dark) .mobile-stat-detail a,
html:not(.dark) .mobile-stat-detail strong,
html:not(.dark) .mobile-stat-detail div {
    color: #0f172a;
}

html:not(.dark) #platform-stats-detail [class*="dark:bg-"],
html:not(.dark) .mobile-stat-detail [class*="dark:bg-"] {
    background-color: #ffffff !important;
}

html:not(.dark) #platform-stats-detail [class*="dark:border-"],
html:not(.dark) .mobile-stat-detail [class*="dark:border-"] {
    border-color: rgba(148, 163, 184, 0.35) !important;
}

html:not(.dark) #platform-stats-detail h3,
html:not(.dark) #platform-stats-detail h3 span,
html:not(.dark) .mobile-stat-detail h3,
html:not(.dark) .mobile-stat-detail h3 span {
    background: none !important;
    background-image: none !important;
    color: #1e3a8a !important;
    -webkit-text-fill-color: #1e3a8a !important;
    text-shadow: none !important;
}

/* Detail panel below the stats card */
#platform-stats-detail {
    max-height: 0;
    overflow: hidden;
    transition: max-height 220ms ease;
}
#platform-stats-detail.hidden {
    display: block !important; /* override utility .hidden so transitions work */
}
#platform-stats-detail p { margin: 0; }

/* Skill bar fill animation from right to left */
@keyframes fillBar {
    0% {
        width: 0%;
    }
    100% {
        width: var(--target-percent, 100%);
    }
}

.skill-bar-fill {
    animation: fillBar 1.2s ease-in-out forwards;
}

