/* ====================================================================
   iOS 26 TRANSLUCENT CYAN LIQUID GLASS THEME (v10.0)
   Viền xanh trong suốt chuẩn iOS 26 Liquid Glass
   Tối ưu đa thiết bị (Mobile, Tablet, Desktop) & Đa trình duyệt
==================================================================== */

:root {
    --bg-dark: #02050e;
    --glass-surface: rgba(4, 12, 30, 0.42);
    --glass-border: rgba(0, 240, 255, 0.22);
    --glass-border-specular: rgba(0, 240, 255, 0.48);
    --glass-border-active: rgba(0, 240, 255, 0.55);
    --glass-border-active-specular: rgba(0, 240, 255, 0.85);
    --cyan: #00f0ff;
    --cyan-glow: rgba(0, 240, 255, 0.4);
    --blue-deep: #0055ff;
    --blue-sky: #38bdf8;
    --text-white: #ffffff;
    --text-silver: #cbd5e1;
    --text-muted: #64748b;
    --font-ios: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Rajdhani', -apple-system, sans-serif;
    --ease-ios: cubic-bezier(0.16, 1, 0.3, 1);
    --ring-radius: 360px;
}

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: var(--font-ios);
    height: 100vh;
    height: 100dvh;
    width: 100vw;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 14px 10px;
}

/* Three.js Background Canvas */
#three-canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 1;
    pointer-events: none;
}

/* Ambient Halos */
.ambient-halo {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: 0;
    pointer-events: none;
    opacity: 0.32;
}

.halo-top-left {
    top: -150px;
    left: -150px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blue-deep), transparent 70%);
}

.halo-bottom-right {
    bottom: -150px;
    right: -150px;
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, var(--cyan), transparent 70%);
}

/* ====================================================================
   1. KHUNG THÔNG TIN CHÍNH Ở TRÊN (HEADER LIQUID GLASS ISLAND)
==================================================================== */
.ios-top-island {
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 580px;
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-specular);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 26px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.25),
                inset 0 -1px 1px 0 rgba(0, 0, 0, 0.35),
                0 20px 45px rgba(0, 0, 0, 0.65),
                0 0 25px rgba(0, 240, 255, 0.12);
    transition: all 0.3s var(--ease-ios);
}

.ios-top-island:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.35),
                0 20px 50px rgba(0, 0, 0, 0.75),
                0 0 30px rgba(0, 240, 255, 0.22);
}

/* Avatar Box */
.avatar-box {
    position: relative;
    width: 62px;
    height: 62px;
    border-radius: 50%;
    padding: 2.5px;
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.8), rgba(255, 255, 255, 0.9), rgba(0, 85, 255, 0.8));
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.45);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background: #04091a;
    display: block;
    border: 2px solid #02050e;
}

.verified-dot {
    position: absolute;
    bottom: -1px;
    right: -1px;
    background: var(--cyan);
    color: #02050e;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9.5px;
    border: 2px solid #02050e;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.8);
}

/* User Meta */
.user-meta {
    text-align: center;
}

.name-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2px;
}

.user-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.status-pill {
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.25);
    padding: 2px 7px;
    border-radius: 12px;
    font-size: 10.5px;
    font-weight: 600;
    color: var(--cyan);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pulsing-dot {
    width: 5.5px;
    height: 5.5px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
    animation: neonBlink 1.4s infinite;
}

@keyframes neonBlink {
    0% { transform: scale(0.9); opacity: 0.5; }
    50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 12px var(--cyan); }
    100% { transform: scale(0.9); opacity: 0.5; }
}

.user-sub {
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: var(--cyan);
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
}

/* Quick Access Pills (Telegram, Channel, TikTok, Zalo) */
.quick-access-pills {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 2px;
}

.ios-quick-pill {
    background: rgba(4, 12, 30, 0.5);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-specular);
    border-radius: 16px;
    padding: 4px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transition: all 0.25s var(--ease-ios);
}

.ios-quick-pill i {
    font-size: 12px;
    color: var(--cyan);
}

.ios-quick-pill .zalo-img-inline,
.ios-quick-pill .zalo-icon-inline,
.ios-quick-pill .zalo-svg-icon {
    width: 14px;
    height: 14px;
    border-radius: 3.5px;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
    object-fit: contain;
}

.ios-quick-pill:hover {
    background: rgba(0, 240, 255, 0.16);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.4);
    transform: translateY(-2px);
}

/* ====================================================================
   2. KHU VỰC VÒNG LẶP VÔ HẠN KÉO 3D (TAB 2 BÊN NHỎ RỒI BỰ)
==================================================================== */
.infinite-carousel-wrapper {
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 960px;
    height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.carousel-viewport {
    position: relative;
    width: 280px;
    height: 385px;
    perspective: 1200px;
    cursor: grab;
    overflow: visible;
}

.carousel-viewport:active {
    cursor: grabbing;
}

.infinite-carousel-track {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Thẻ kính iOS 26 Liquid Glass trong suốt chuẩn */
.ios-glass-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 280px;
    height: 375px;
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-specular);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 26px;
    padding: 22px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.25),
                inset 0 -1px 1px 0 rgba(0, 0, 0, 0.35),
                0 25px 50px rgba(0, 0, 0, 0.75),
                0 0 25px rgba(0, 240, 255, 0.12);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    overflow: hidden;
    transition: transform 0.65s cubic-bezier(0.16, 1, 0.3, 1),
                opacity 0.65s ease,
                filter 0.65s ease,
                box-shadow 0.65s ease,
                border-color 0.65s ease;
}

/* Thẻ ở chính diện: To nhất (Scale 1.0), Sáng rõ nhất */
.ios-glass-card.card-active {
    opacity: 1;
    filter: blur(0px);
    border-color: var(--glass-border-active);
    border-top: 1px solid var(--glass-border-active-specular);
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.4),
                0 30px 65px rgba(0, 0, 0, 0.85),
                0 0 35px rgba(0, 240, 255, 0.3);
    z-index: 10;
}

/* Tab nhỏ ở 2 bên: Thu nhỏ (Scale 0.78), mờ nhẹ để tạo hiệu ứng nhỏ rồi bự */
.ios-glass-card.card-adjacent {
    opacity: 0.65;
    filter: blur(0.3px);
    border-color: rgba(0, 240, 255, 0.18);
    cursor: pointer;
    z-index: 5;
}

.ios-glass-card.card-adjacent:hover {
    opacity: 0.85;
    border-color: var(--cyan);
}

/* Thẻ nằm xa phía sau */
.ios-glass-card.card-far {
    opacity: 0.15;
    filter: blur(1.5px);
    pointer-events: none;
    z-index: 1;
}

/* Nội dung bên trong thẻ kính */
.card-hero-icon {
    width: 68px;
    height: 68px;
    border-radius: 18px;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-specular);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-top: 4px;
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.2);
    transition: transform 0.3s ease;
}

.ios-glass-card:hover .card-hero-icon {
    transform: scale(1.08) rotate(4deg);
}

.card-tag {
    font-family: var(--font-heading);
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 1.5px;
    color: var(--cyan);
    margin-top: 8px;
    display: inline-block;
}

.card-title {
    font-size: 17.5px;
    font-weight: 700;
    color: #ffffff;
    margin: 3px 0 5px;
}

.card-desc {
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-silver);
    padding: 0 4px;
}

.card-handle {
    font-family: 'Courier New', monospace;
    font-size: 11px;
    color: var(--cyan);
    background: rgba(4, 12, 30, 0.65);
    border: 1px dashed rgba(0, 240, 255, 0.25);
    padding: 4px 10px;
    border-radius: 8px;
    margin: 8px 0 12px;
    display: inline-block;
}

.card-action-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, var(--cyan), var(--blue-deep));
    border: none;
    border-radius: 13px;
    color: #02050e;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 0 16px rgba(0, 240, 255, 0.5);
    transition: all 0.25s var(--ease-ios);
}

.card-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 26px rgba(0, 240, 255, 0.8);
}

/* Thẻ QR Code */
.qr-frame {
    padding: 8px;
    border-radius: 14px;
    background: rgba(4, 10, 26, 0.85);
    border: 1px solid rgba(0, 240, 255, 0.35);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
    margin: 6px 0;
}

.qr-img {
    width: 115px;
    height: 115px;
    display: block;
    border-radius: 8px;
}

/* Zalo SVG Icon Custom */
.zalo-svg-box {
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zalo-svg-hero,
.zalo-img-hero {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: block;
    object-fit: contain;
    box-shadow: 0 0 16px rgba(0, 104, 255, 0.45);
    transition: transform 0.3s ease;
}

.ios-glass-card:hover .zalo-img-hero,
.ios-glass-card:hover .zalo-svg-hero {
    transform: scale(1.08) rotate(4deg);
}

/* ====================================================================
   3. THANH ÂM NHẠC THỜI GIAN THỰC Ở ĐÁY (BOTTOM GLASS MUSIC PLAYER)
==================================================================== */
.bottom-music-player {
    position: relative;
    z-index: 100;
    width: 100%;
    max-width: 620px;
    background: var(--glass-surface);
    border: 1px solid var(--glass-border);
    border-top: 1px solid var(--glass-border-specular);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border-radius: 24px;
    padding: 9px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.25),
                inset 0 -1px 1px 0 rgba(0, 0, 0, 0.35),
                0 20px 45px rgba(0, 0, 0, 0.7),
                0 0 25px rgba(0, 240, 255, 0.12);
    transition: all 0.3s var(--ease-ios);
}

.bottom-music-player:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: inset 0 1px 1px 0 rgba(0, 240, 255, 0.35),
                0 20px 50px rgba(0, 0, 0, 0.8),
                0 0 30px rgba(0, 240, 255, 0.22);
}

.player-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 125px;
}

.disc-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #02050e;
    border: 2px solid var(--cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cyan);
    font-size: 17px;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4);
    flex-shrink: 0;
}

.disc-wrapper.spinning {
    animation: spinDisc 3.5s linear infinite;
}

@keyframes spinDisc {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.track-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.player-title {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 105px;
}

.player-artist {
    font-size: 10px;
    color: var(--text-silver);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 105px;
}

.player-center {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    max-width: 280px;
}

.player-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ctrl-btn {
    background: transparent;
    border: none;
    color: var(--text-silver);
    font-size: 11.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 3px;
}

.ctrl-btn:hover {
    color: var(--cyan);
    transform: scale(1.15);
}

.main-play-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--blue-deep));
    border: none;
    color: #02050e;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 0 14px rgba(0, 240, 255, 0.6);
    transition: all 0.25s var(--ease-ios);
}

.main-play-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 22px rgba(0, 240, 255, 0.9);
}

.player-timeline {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
}

.time-label {
    font-family: var(--font-heading);
    font-size: 10px;
    font-weight: 700;
    color: var(--text-silver);
    min-width: 28px;
}

.progress-bar-container {
    flex: 1;
    height: 4.5px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    overflow: visible;
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--blue-deep), var(--cyan));
    border-radius: 10px;
    position: relative;
    box-shadow: 0 0 10px var(--cyan);
}

.progress-thumb {
    position: absolute;
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px var(--cyan);
}

.player-right {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 95px;
    justify-content: flex-end;
}

.audio-bars {
    display: flex;
    align-items: flex-end;
    gap: 2.5px;
    height: 13px;
}

.audio-bars span {
    width: 2.5px;
    height: 3.5px;
    background: #475569;
    border-radius: 1px;
}

.audio-bars.active span {
    background: var(--cyan);
    box-shadow: 0 0 6px var(--cyan);
    animation: eqPulse 1.1s infinite ease-in-out alternate;
}

.audio-bars.active span:nth-child(2) { animation-delay: 0.15s; }
.audio-bars.active span:nth-child(3) { animation-delay: 0.3s; }
.audio-bars.active span:nth-child(4) { animation-delay: 0.45s; }
.audio-bars.active span:nth-child(5) { animation-delay: 0.6s; }

@keyframes eqPulse {
    0% { height: 3.5px; }
    50% { height: 13px; }
    100% { height: 4.5px; }
}

.volume-box {
    display: flex;
    align-items: center;
    gap: 5px;
}

.vol-btn {
    background: transparent;
    border: none;
    color: var(--text-silver);
    font-size: 11.5px;
    cursor: pointer;
}

.vol-slider {
    -webkit-appearance: none;
    width: 42px;
    height: 3.5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    outline: none;
    cursor: pointer;
}

.vol-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 8.5px;
    height: 8.5px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 8px var(--cyan);
}

/* ====================================================================
   ĐA THIẾT BỊ (RESPONSIVE CHO MOBILE, ANDROID, TABLET, DESKTOP)
==================================================================== */
@media (max-width: 600px) {
    body {
        padding: 8px 6px;
    }

    :root {
        --ring-radius: 210px;
    }

    .ios-top-island {
        padding: 8px 12px;
        gap: 5px;
        border-radius: 20px;
    }

    .avatar-box {
        width: 48px;
        height: 48px;
    }

    .user-name {
        font-size: 15px;
    }

    .user-sub {
        font-size: 10px;
        letter-spacing: 0.5px;
    }

    .quick-access-pills {
        gap: 4px;
    }

    .ios-quick-pill {
        padding: 3px 8px;
        font-size: 10px;
    }

    .infinite-carousel-wrapper {
        height: 345px;
    }

    .carousel-viewport {
        width: 220px;
        height: 310px;
        perspective: 1000px;
    }

    .ios-glass-card {
        width: 220px;
        height: 305px;
        padding: 15px 12px;
        border-radius: 22px;
    }

    .card-hero-icon {
        width: 48px;
        height: 48px;
        font-size: 22px;
        border-radius: 14px;
        margin-top: 0;
    }

    .zalo-img-hero,
    .zalo-svg-hero {
        width: 30px;
        height: 30px;
        border-radius: 8px;
    }

    .card-tag {
        font-size: 9.5px;
        letter-spacing: 1px;
        margin-top: 3px;
    }

    .card-title {
        font-size: 14.5px;
        margin: 2px 0;
    }

    .card-desc {
        font-size: 10px;
        line-height: 1.35;
        max-height: 2.7em;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .card-handle {
        font-size: 9.5px;
        padding: 2px 8px;
        margin: 4px 0 6px;
    }

    .card-action-btn {
        padding: 7px 10px;
        font-size: 11px;
        border-radius: 10px;
        gap: 6px;
    }

    .qr-frame {
        padding: 5px;
        margin: 3px 0;
        border-radius: 10px;
    }

    .qr-img {
        width: 80px;
        height: 80px;
    }

    .bottom-music-player {
        padding: 7px 12px;
        border-radius: 18px;
        gap: 8px;
    }

    .player-left {
        min-width: auto;
    }

    .player-title, .player-artist {
        max-width: 75px;
        font-size: 10px;
    }

    .disc-wrapper {
        width: 28px;
        height: 28px;
        font-size: 13px;
    }

    .main-play-btn {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .ctrl-btn {
        width: 24px;
        height: 24px;
        font-size: 10px;
    }

    .player-timeline {
        gap: 6px;
    }

    .time-label {
        font-size: 9px;
        min-width: 24px;
    }

    .player-right .volume-box {
        display: none;
    }
}

/* Tối ưu chuyên sâu cho điện thoại Android cỡ nhỏ & hẹp (360px - 390px hoặc chiều cao thấp) */
@media (max-width: 390px), (max-height: 680px) {
    :root {
        --ring-radius: 185px;
    }

    .ios-top-island {
        padding: 6px 10px;
        gap: 4px;
    }

    .avatar-box {
        width: 42px;
        height: 42px;
    }

    .user-name {
        font-size: 14px;
    }

    .user-sub {
        font-size: 9px;
    }

    .ios-quick-pill {
        padding: 2.5px 7px;
        font-size: 9px;
        gap: 3px;
    }

    .infinite-carousel-wrapper {
        height: 305px;
    }

    .carousel-viewport {
        width: 195px;
        height: 275px;
        perspective: 900px;
    }

    .ios-glass-card {
        width: 195px;
        height: 270px;
        padding: 12px 10px;
        border-radius: 18px;
    }

    .card-hero-icon {
        width: 40px;
        height: 40px;
        font-size: 19px;
        border-radius: 12px;
    }

    .zalo-img-hero,
    .zalo-svg-hero {
        width: 26px;
        height: 26px;
        border-radius: 6px;
    }

    .card-title {
        font-size: 13.5px;
    }

    .card-desc {
        font-size: 9.5px;
    }

    .card-action-btn {
        padding: 6px 8px;
        font-size: 10px;
    }

    .qr-img {
        width: 70px;
        height: 70px;
    }
}
