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

body {
    font-family: 'Inter', sans-serif;
    /* Giao diện Dark Mode với dải màu Gradient tối */
    background: #0f172a;
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 10%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 25%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 25%, 1) 0, transparent 50%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #f8fafc;
}

/* Đồng hồ La Mã Background Cơ Học Cao Cấp */
.bg-clock-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: -1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.25;
    /* Sáng hơn chút để khoe bánh răng */
    pointer-events: none;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.roman-clock {
    width: clamp(300px, 90vw, 600px);
    height: clamp(300px, 90vw, 600px);
    border-radius: 50%;
    position: relative;
    background: radial-gradient(circle, rgba(15, 23, 42, 0.1) 0%, rgba(15, 23, 42, 0.7) 100%);
    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.8), 0 0 30px rgba(59, 130, 246, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Các vòng viền trang trí bên trong */
.clock-inner-ring {
    position: absolute;
    inset: 15px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.clock-dashed-ring {
    position: absolute;
    inset: 40px;
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

/* Hệ thống Bánh răng (Gears) */
@keyframes gear-spin-cw {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes gear-spin-ccw {
    100% {
        transform: rotate(-360deg);
    }
}

.clock-gears {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    overflow: hidden;
    z-index: 1;
    /* Nằm dưới kim và số */
}

.gear {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gear-1 {
    font-size: 240px;
    top: 50%;
    left: 50%;
    margin-top: -120px;
    margin-left: -120px;
    color: rgba(148, 163, 184, 0.15);
    animation: gear-spin-cw 30s linear infinite;
}

.gear-2 {
    font-size: 160px;
    top: 10%;
    right: 10%;
    color: rgba(59, 130, 246, 0.12);
    /* Ánh xanh dương */
    animation: gear-spin-ccw 20s linear infinite;
}

.gear-3 {
    font-size: 180px;
    bottom: 12%;
    left: 12%;
    color: rgba(236, 72, 153, 0.12);
    /* Ánh hồng */
    animation: gear-spin-ccw 25s linear infinite;
}

.gear-4 {
    font-size: 100px;
    top: 35%;
    left: 25%;
    color: rgba(255, 255, 255, 0.1);
    animation: gear-spin-cw 15s linear infinite;
}

/* Trục kim trung tâm */
.clock-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    background: #0f172a;
    border: 3px solid #ec4899;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Các kim đồng hồ xịn xò */
.hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    z-index: 5;
    transition: transform 0.05s linear;
}

/* Kim giờ dáng gươm sắc bén */
.hour-hand {
    width: 8px;
    height: 28%;
    background: linear-gradient(to top, #94a3b8, #ffffff);
    margin-left: -4px;
    clip-path: polygon(10% 100%, 90% 100%, 50% 0%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Kim phút dài và thanh lịch */
.minute-hand {
    width: 6px;
    height: 42%;
    background: linear-gradient(to top, #94a3b8, #ffffff);
    margin-left: -3px;
    clip-path: polygon(15% 100%, 85% 100%, 50% 0%);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Kim giây có đuôi đối trọng */
.second-hand {
    width: 2px;
    height: 45%;
    background: #ec4899;
    margin-left: -1px;
    z-index: 6;
}

.second-hand::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 40px;
    /* Đuôi kim giây */
    background: #ec4899;
}

.num-wrapper {
    position: absolute;
    top: 2%;
    left: 50%;
    width: 50px;
    height: 96%;
    margin-left: -25px;
    text-align: center;
    z-index: 2;
    /* Nằm trên bánh răng */
}

.num-wrapper span {
    display: block;
    font-family: 'Times New Roman', serif;
    font-size: clamp(2rem, 8vw, 3.5rem);
    font-weight: bold;
    color: rgba(255, 255, 255, 0.6);
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}

/* Dynamic Island Transition */
#dynamic-island {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Spinning Record & Border */
@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

.spin-slow {
    animation: spin 6s linear infinite;
}

.spin-border {
    animation: spin 3s linear infinite;
}

.spin-paused {
    animation-play-state: paused;
}

/* Music Waves */
.wave-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    height: 30px;
}

.wave-bar {
    width: 4px;
    background-color: #3b82f6;
    border-radius: 2px;
    animation: wave 1.2s ease-in-out infinite;
}

.wave-bar.mini {
    background-color: #10b981;
    width: 3px;
}

.wave-bar:nth-child(1) {
    animation-delay: 0.0s;
    height: 10px;
}

.wave-bar:nth-child(2) {
    animation-delay: 0.1s;
    height: 20px;
}

.wave-bar:nth-child(3) {
    animation-delay: 0.2s;
    height: 30px;
}

.wave-bar:nth-child(4) {
    animation-delay: 0.3s;
    height: 15px;
}

.wave-bar:nth-child(5) {
    animation-delay: 0.4s;
    height: 25px;
}

.paused-wave .wave-bar {
    animation-play-state: paused;
    height: 5px !important;
    transition: height 0.3s;
}

@keyframes wave {
    0%,
    100% {
        transform: scaleY(0.5);
    }

    50% {
        transform: scaleY(1);
    }
}

/* Hide scrollbar for list */
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Dark Glassmorphism (Hiệu ứng kính mờ trong suốt) */
.glass-dark {
    background: rgba(30, 41, 59, 0.4);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

.glass-modal {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

/* Hiệu ứng loading iOS Spinner dạng nan hoa */
.ios-spinner {
    position: relative;
    width: 30px;
    height: 30px;
}
.ios-spinner div {
    width: 8.5%;
    height: 25%;
    background: #000000; /* Màu đen tuyền */
    position: absolute;
    left: 45.75%;
    top: 37.5%;
    opacity: 0;
    border-radius: 50px;
    animation: ios-fade 1s linear infinite;
}
.ios-spinner .bar1 { transform: rotate(0deg) translate(0, -135%); animation-delay: 0s; }
.ios-spinner .bar2 { transform: rotate(30deg) translate(0, -135%); animation-delay: -0.9167s; }
.ios-spinner .bar3 { transform: rotate(60deg) translate(0, -135%); animation-delay: -0.8333s; }
.ios-spinner .bar4 { transform: rotate(90deg) translate(0, -135%); animation-delay: -0.75s; }
.ios-spinner .bar5 { transform: rotate(120deg) translate(0, -135%); animation-delay: -0.6667s; }
.ios-spinner .bar6 { transform: rotate(150deg) translate(0, -135%); animation-delay: -0.5833s; }
.ios-spinner .bar7 { transform: rotate(180deg) translate(0, -135%); animation-delay: -0.5s; }
.ios-spinner .bar8 { transform: rotate(210deg) translate(0, -135%); animation-delay: -0.4167s; }
.ios-spinner .bar9 { transform: rotate(240deg) translate(0, -135%); animation-delay: -0.3333s; }
.ios-spinner .bar10 { transform: rotate(270deg) translate(0, -135%); animation-delay: -0.25s; }
.ios-spinner .bar11 { transform: rotate(300deg) translate(0, -135%); animation-delay: -0.1667s; }
.ios-spinner .bar12 { transform: rotate(330deg) translate(0, -135%); animation-delay: -0.0833s; }

@keyframes ios-fade {
    from { opacity: 1; }
    to { opacity: 0.22; }
}
