/* --- 全域設定 --- */
html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    font-family: "Microsoft JhengHei", "Heiti TC", sans-serif;
    overflow: hidden;
    touch-action: none !important;
    overscroll-behavior: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.a-canvas {
    touch-action: none !important;
}

* {
    box-sizing: border-box;
}

/* --- 1. 彈出視窗 (Info Popup) --- */
.info-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    background: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: white;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    touch-action: pan-y !important;
}

.info-popup.show {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%) scale(1);
}

.popup-close-x {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    color: #ddd;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2002;
    transition: all 0.2s;
    line-height: 1;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.popup-close-x:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: scale(1.1);
}

.popup-media-container {
    position: relative;
    width: 100%;
    height: 300px;
    background: #000;
    display: none;
    flex-shrink: 0;
    border-bottom: 1px solid #333;
}

.popup-media-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.popup-media-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    padding: 15px 10px;
    cursor: pointer;
    font-size: 20px;
    transition: 0.2s;
    user-select: none;
}

.nav-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.nav-btn.left {
    left: 0;
}

.nav-btn.right {
    right: 0;
}

.popup-content {
    padding: 25px;
}

.info-popup h2 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #4aa3ff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
    padding-right: 30px;
}

.info-popup p {
    margin: 0 0 20px 0;
    line-height: 1.7;
    color: #ddd;
    font-size: 15px;
    white-space: pre-wrap;
}

.popup-audio {
    width: 100%;
    margin-top: 10px;
    margin-bottom: 10px;
    display: none;
    height: 40px;
}

@media screen and (max-height: 600px) and (orientation: landscape) {
    .info-popup {
        flex-direction: row;
        width: 85vw;
        max-width: 750px;
        height: 80vh;
        max-height: none;
        overflow: hidden;
    }

    .popup-media-container {
        width: 50%;
        height: 100%;
        border-bottom: none;
        border-right: 1px solid rgba(255, 255, 255, 0.15);
        background: #000;
    }

    .popup-media-container img {
        height: 100%;
        object-fit: contain;
    }

    .popup-content {
        flex: 1;
        height: 100%;
        overflow-y: auto;
        display: flex;
        flex-direction: column;
    }
}

.overlay-mask {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    backdrop-filter: blur(3px);
}

.overlay-mask.show {
    opacity: 1;
    pointer-events: auto;
}

/* --- 2. 地圖系統 --- */
#map-component {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    align-items: flex-end;
    z-index: 1500;
    transition: all 0.3s ease;
    pointer-events: none;
    /* Don't block scene when closed */
}

#map-component>* {
    pointer-events: auto;
    /* Re-enable for child elements */
}

#mobile-map-btn {
    display: none;
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: white;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(5px);
    z-index: 1502;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

#mobile-map-btn svg {
    width: 24px;
    height: 24px;
    fill: white;
}

#map-content-wrapper {
    display: flex;
    align-items: flex-end;
    transition: all 0.3s ease;
}

#map-display {
    position: relative;
    /* Square dimensions */
    width: 250px;
    height: 250px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-right: none;
    border-radius: 8px 0 0 8px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (min-width: 769px) and (min-height: 601px) {
    #map-component:hover #map-display {
        /* Square hover dimensions */
        width: 450px;
        height: 450px;
    }
}

#map-image-wrapper {
    position: relative;
    display: inline-block;
    line-height: 0;
    width: 100%;
    height: 100%;
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

@media (min-width: 769px) and (min-height: 601px) {
    #map-component:hover #map-image-wrapper {
        width: 100%;
        height: 100%;
    }
}

#current-map-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
}

#map-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    z-index: 10;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.map-pin {
    position: absolute;
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2UzM2UyZSIgZD0iTTEyIDJDNy41ODkgMiA0IDUuNTg5IDQgOS45OTVjMCAzLjk1MyAzLjY4NiA5LjIyNiA3LjM4NCAxMy43MjhsLjYxNi43NTFsLjYxNi0uNzUxQzE2LjMxNCAxOS4yMiAyMCAxMy45NDggMjAgOS45OTUgMjAgNS41ODkgMTYuNDExIDIgMTIgMnoiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEwIiByPSIzLjUiIGZpbGw9IiNmZmZmZmYiLz48L3N2Zz4=');
    background-size: contain;
    background-repeat: no-repeat;
    transform: translate(-50%, -100%);
    cursor: pointer;
    transition: transform 0.2s;
    z-index: 2;
    display: none;
}

.map-pin:hover {
    transform: translate(-50%, -100%) scale(1.3);
    z-index: 3;
}

.map-pin.active {
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCI+PHBhdGggZmlsbD0iI2ZmYjMwMCIgZD0iTTEyIDJDNy41ODkgMiA0IDUuNTg5IDQgOS45OTVjMCAzLjk1MyAzLjY4NiA5LjIyNiA3LjM4NCAxMy43MjhsLjYxNi43NTFsLjYxNi0uNzUxQzE2LjMxNCAxOS4yMiAyMCAxMy45NDggMjAgOS45OTUgMjAgNS41ODkgMTYuNDExIDIgMTIgMnoiLz48Y2lyY2xlIGN4PSIxMiIgY3k9IjEwIiByPSIzLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=');
    animation: pinBounce 1.5s infinite;
    z-index: 4;
}

@keyframes pinBounce {

    0%,
    100% {
        transform: translate(-50%, -100%);
    }

    50% {
        transform: translate(-50%, -130%);
    }
}

#floor-nav {
    display: flex;
    flex-direction: column;
    background: rgba(30, 30, 30, 0.95);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 0 8px 8px 0;
    overflow: hidden;
}

.floor-btn {
    width: 50px;
    min-height: 50px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s;
    padding: 5px;
}

.floor-btn:hover {
    background: #444;
    color: white;
}

.floor-btn.active {
    background: #b30000;
    color: white;
}

/* --- 3. 一般 UI --- */
.scene-info {
    position: fixed;
    top: 20px;
    right: 80px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    z-index: 999;
    pointer-events: none;
    font-size: 18px;
    letter-spacing: 2px;
    backdrop-filter: blur(5px);
}

#menu-toggle {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 999;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    font-size: 24px;
    width: 44px;
    height: 44px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* ... */

.controls {
    position: fixed;
    top: 20px;
    left: 80px;
    /* Adjusted to be closer to equal spacing */
    bottom: auto;
    transform: none;
    display: flex;
    gap: 10px;
    z-index: 999;
    /* remove container bg/padding to let button stand alone like menu */
    background: transparent;
    padding: 0;
    border-radius: 0;
    backdrop-filter: none;
    border: none;
    align-items: center;
}

.controls button {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: none;
    /* Remove border to match menu style */
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    /* Match menu icon size approx */
    transition: 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

/* New Scene Menu Styles */
#scene-menu {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100%;
    /* Glassmorphism background */
    background: linear-gradient(135deg, rgba(20, 20, 20, 0.95), rgba(40, 40, 40, 0.98));
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    z-index: 998;
    transition: left 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    padding: 80px 20px 20px;
    box-sizing: border-box;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.6);
}

#scene-menu.open {
    left: 0;
}

#scene-menu h3 {
    margin-bottom: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 15px;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: 1px;
    color: #fff;
    text-align: center;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#menu-list {
    list-style: none;
    padding: 0 5px;
    /* Add slight padding for hover effects */
    overflow-y: auto;
    max-height: calc(100% - 80px);
    /* Custom Scrollbar for Webkit */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

#menu-list::-webkit-scrollbar {
    width: 6px;
}

#menu-list::-webkit-scrollbar-track {
    background: transparent;
}

#menu-list li:not(.menu-category-header) {
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: #ddd;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-size: 16px;
    position: relative;
    overflow: hidden;
}

#menu-list li:not(.menu-category-header)::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #d32f2f;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

#menu-list li:not(.menu-category-header):hover {
    background: linear-gradient(90deg, rgba(211, 47, 47, 0.15), rgba(255, 255, 255, 0.05));
    color: #fff;
    transform: translateX(5px) scale(1.02);
    border-color: rgba(211, 47, 47, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    padding-left: 25px;
}

#menu-list li:not(.menu-category-header):hover::before {
    transform: scaleY(1);
}

#menu-list li:not(.menu-category-header).active {
    background: linear-gradient(90deg, rgba(211, 47, 47, 0.3), rgba(255, 255, 255, 0.05));
    border-color: #d32f2f;
    color: #fff;
}

/* --- 手機版與響應式調整 --- */

@media (max-width: 768px),
screen and (max-height: 600px) and (orientation: landscape) {
    #mobile-map-btn {
        display: flex;
    }

    #map-close-btn {
        display: flex;
    }

    .controls {
        top: 20px;
        left: 80px;
        bottom: auto;
        padding: 5px 12px;
        transform: none;
    }

    .controls button {
        width: 36px;
        height: 36px;
    }

    #map-component {
        bottom: 20px;
    }

    #map-content-wrapper {
        display: none;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        flex-direction: row;
        align-items: stretch;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
        max-width: 95vw;
    }

    #map-component.map-open {
        z-index: 2005 !important;
        pointer-events: auto;
        /* Enable interaction when map is open */
    }

    #map-component.map-open #map-content-wrapper {
        display: flex;
    }

    #floor-nav {
        border-radius: 0 8px 8px 0;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    #map-display {
        width: 85vw;
        height: auto;
        max-height: 60vh;
        border-radius: 8px 0 0 8px;
        border-right: none;
        background: #000;
    }
}

@media screen and (max-height: 600px) and (orientation: landscape) {
    #map-display {
        width: 45vw;
        max-width: 350px;
        height: auto;
        max-height: 85vh;
        border-radius: 8px 0 0 8px;
        border-right: none;
        background: #000;
    }
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    z-index: 9999;
    transition: opacity 0.8s;
    letter-spacing: 3px;
    font-weight: 300;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.modal {
    /* ★★★ 關鍵修正：預設隱藏，避免載入時直接顯示 ★★★ */
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.8);
    touch-action: pan-y !important;
}

/* 只有加上 .show 時才顯示，並設定 flex 置中 */
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 500px;
    border-radius: 10px;
    position: relative;
    animation: animatetop 0.4s;
    max-height: 90vh;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

@keyframes animatetop {
    from {
        opacity: 0;
        transform: translateY(-10%);
    }

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

@keyframes toss {
    0% {
        transform: rotateX(0deg) rotateY(0deg);
    }

    50% {
        transform: rotateX(180deg) rotateY(180deg);
    }

    100% {
        transform: rotateX(360deg) rotateY(360deg);
    }
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-10deg);
    }

    75% {
        transform: rotate(10deg);
    }

    100% {
        transform: rotate(0deg);
    }
}

@keyframes throw {
    0% {
        transform: translateY(0) rotate(0);
    }

    50% {
        transform: translateY(-50px) rotate(180deg);
    }

    100% {
        transform: translateY(0) rotate(360deg);
    }
}

:root {
    --fc-bg-color: #fcf9f0;
    --fc-border-color: #b8a398;
    --fc-theme-red: #a71e32;
    --fc-theme-gold: #9a834f;
    --fc-text-dark: #5d4037;
    --fc-text-light: #8d6e63;
}

/* 按鈕樣式 */

/* --- From index.html inline styles --- */

/* --- 1. 基礎設定 --- */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    touch-action: none;
    background-color: #000;
    font-family: "Microsoft JhengHei", sans-serif;
}

/* --- 2. Popup 樣式 --- */
.popup-text-content {
    font-size: 16px;
    line-height: 1.6;
    color: #eee;
    text-align: left;
    overflow-wrap: break-word;
}

.popup-text-content ul,
.popup-text-content ol {
    padding-left: 24px;
    margin: 10px 0;
}

.popup-text-content h1,
.popup-text-content h2 {
    color: #fff;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
}

.popup-text-content a {
    color: #4aa3ff;
    text-decoration: underline;
    cursor: pointer;
}

.popup-text-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

/* 手機橫向調整 */
@media screen and (orientation: landscape) and (max-height: 600px) {

    /* 1. 修改外部容器對齊方式 */
    .modal.show {
        align-items: flex-start !important;
    }

}

/* --- 手機直式專用修正 (Mobile Portrait Fixes) --- */
@media (max-width: 768px) and (orientation: portrait) {

    /* 1. 修改外部容器對齊方式 */
    /* 原本是垂直置中(center)，改為從頂部開始(flex-start)，這樣才能精準控制往上移動 */
    .modal.show {
        align-items: flex-start !important;
    }

}

/* Settings Button & Modal */
#settings-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

#settings-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    transform: rotate(90deg);
}

.settings-content {
    text-align: left;
    max-width: 500px;
    padding: 30px;
    line-height: 1.8;
}

.settings-content h2 {
    color: #4aa3ff;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
}

.settings-body p {
    font-size: 16px;
    color: #444;
    margin-bottom: 15px;
}

.settings-close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 30px;
    cursor: pointer;
    color: #aaa;
    transition: color 0.2s;
}

.settings-close-btn:hover {
    color: #000;
}

/* Glass Transition Overlay */
/* Black Transition Overlay */
#transition-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;

    /* Flex Center */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 300;
    letter-spacing: 2px;
    /* Solid Black */
    z-index: 1000000;
    /* Ensure it covers everything including loading screen */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

body.transition-active #transition-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Transparent Loading State */
#loading-screen.loading-transparent {
    background: rgba(0, 0, 0, 0.4);
    /* Dark dim instead of full black */
    backdrop-filter: none;
    /* No expensive blur */
    -webkit-backdrop-filter: none;
    transition: opacity 0.2s;
}

/* CSS for Menu Categories */
.menu-category-header {
    background: transparent;
    color: #4aa3ff;
    font-weight: bold;
    padding: 20px 10px 8px 5px;
    cursor: default;
    pointer-events: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 15px;
    margin-top: 10px;
    letter-spacing: 1px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.menu-category-header:first-child {
    margin-top: 0;
}

/* Mobile Info Popup Adjustment */
@media (max-width: 600px) {
    .info-popup {
        width: 85%;
        max-height: 80vh;
    }

    .popup-content {
        padding: 20px;
    }

    .info-popup h2 {
        font-size: 20px;
    }
}

/* Audio Control Button */
#popupAudioControl {
    display: none;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 14px;
    border-radius: 20px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    letter-spacing: 0.5px;
}

#popupAudioControl:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.4);
}

#popupAudioControl:active {
    transform: translateY(1px);
    box-shadow: none;
}

#popupAudioControl.playing {
    background: rgba(74, 163, 255, 0.2);
    border-color: #4aa3ff;
    color: #4aa3ff;
    box-shadow: 0 0 15px rgba(74, 163, 255, 0.2);
}

#popupAudioControl.playing #audioIcon {
    animation: soundWave 1.2s infinite ease-in-out;
}

@keyframes soundWave {

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

    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

#audioIcon {
    font-size: 14px;
}

/* Custom Audio Player */
#customAudioPlayer {
    backdrop-filter: blur(5px);
    transition: all 0.3s ease;
}

#customPlayBtn:hover {
    color: #4aa3ff;
    transform: scale(1.1);
}

/* Styled Range Input */
#audioProgress {
    -webkit-appearance: none;
    background: transparent;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.2);
    position: relative;
    outline: none;
}

#audioProgress::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 12px;
    width: 12px;
    border-radius: 50%;
    background: #4aa3ff;
    cursor: pointer;
    margin-top: -4px;
    box-shadow: 0 0 10px rgba(74, 163, 255, 0.5);
    transition: transform 0.1s;
}

#audioProgress::-webkit-slider-thumb:hover {
    transform: scale(1.3);
}

#audioProgress::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: transparent;
    border-radius: 2px;
}

/* Beautify Transition Overlay Spinner (Premium Glow) */
#transition-overlay .loading-spinner {
    width: 50px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 50%;
    border-top-color: #fff;
    border-left-color: rgba(255, 255, 255, 0.5);
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
    animation: spin-glow 1s linear infinite;
}

#transition-overlay div:last-child {
    font-size: 14px !important;
    font-weight: 300;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 4px;
    animation: text-pulse 1.5s ease-in-out infinite alternate;
}

@keyframes spin-glow {
    0% {
        transform: rotate(0deg);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }

    50% {
        transform: rotate(180deg);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
    }

    100% {
        transform: rotate(360deg);
        box-shadow: 0 0 5px rgba(255, 255, 255, 0.1);
    }
}

@keyframes text-pulse {
    from {
        opacity: 0.5;
        letter-spacing: 4px;
    }

    to {
        opacity: 1;
        letter-spacing: 5px;
    }
}