@import url('https://fonts.cdnfonts.com/css/digital-numbers');

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "楷体";
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    font-size: 20px;
    background-color: #ff7389;
    padding-top: 25px;
    /* Space for the status bar */

    /* 禁用文字選取和觸控行為 */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

/* 全局禁用所有元素的文字選取 */
* {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}

/* 允許輸入框可以選取（必要的例外） */
input,
textarea {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}


/* --- Custom Scrollbar (Invisible/Minimalist) --- */
::-webkit-scrollbar {
    width: 3px;
    height: 3px;
    background: transparent;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0);
    /* Standard hidden */
    border-radius: 10px;
}

/* Only show a vague hint on hover so it's usable if needed */
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Firefox */
html {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

/* --- Global White Text Glow --- */
.marquee-text,
.about-footer {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3), 0 0 10px rgba(255, 255, 255, 0.3), 0 0 15px rgba(255, 255, 255, 0.3) !important;
}

.container {
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.section {
    max-width: 950px;
    padding: 15px;
    margin: 2px auto;
    border-radius: 16px;
    border: 5px solid;
    color: white;
    text-align: center;
    font-size: 20px;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.6), 0 0 10px rgba(0, 0, 0, 0.6), 0 0 15px rgba(0, 0, 0, 0.6);
    user-select: none;
}

#home {
    background-color: rgb(17 196 206 / 50%);
    border-color: rgb(17 196 206 / 50%);
    padding: -1px;
    height: auto;
}

/* Dashboard & Video */
.dashboard {
    font-family: 'Segoe UI', Arial, sans-serif;
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
}

.stats-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

video {
    width: 95%;
    max-width: 800px;
    height: auto;
    max-height: 70vh;
    object-fit: cover;
    display: block;
    margin: 25px auto;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Background Video Styles */
#global-bg video {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover !important;
    transform: translate(-50%, -50%);
    margin: 0 !important;
    max-width: none !important;
    max-height: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* --- Immersive Mode --- */
body.immersive-active {
    overflow: hidden !important;
    touch-action: none;
    /* Prevent browser gestures while panning */
}

.immersive-active .container,
.immersive-active .ai-robot-wrapper,
.immersive-active .dock-robot-wrapper,
.immersive-active #cursor-robot {
    display: none !important;
}

.immersive-active #global-bg {
    z-index: 1 !important;
    /* Bring above hidden container but below dock/restore */
}

#global-bg {
    transition: background-position 0.1s ease-out;
    /* Smooth panning */
}

#global-bg video {
    transition: object-position 0.1s ease-out;
}



@keyframes fadeInRestore {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.immersive-controls {
    position: fixed;
    right: 15px;
    bottom: 70px;
    /* Above the restore button */
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10005;
    align-items: center;
}

.immersive-ctrl-btn {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.restore-ui-btn {
    position: fixed;
    right: 15px;
    bottom: 20px;
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    z-index: 10005;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    font-size: 18px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.restore-ui-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.restore-icon {
    font-size: 18px;
}

.immersive-ctrl-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.immersive-ctrl-btn.active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.2);
}

/* Draggable Widgets */
.immersive-widget {
    position: fixed;
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    color: #00f2ff;
    font-family: 'Digital Numbers', 'Orbitron', sans-serif !important;
    font-weight: bold;
    cursor: move;
    z-index: 10006;
    user-select: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.immersive-clock {
    font-size: 32px;
    min-width: 180px;
    text-align: center;
    padding: 10px 20px;
}

.widget-digital-time {
    text-shadow: 0 0 10px rgba(0, 242, 255, 0.8), 0 0 20px rgba(0, 242, 255, 0.4);
    letter-spacing: 2px;
}

/* Size Variants */
.immersive-widget.small-size {
    transform: scale(0.8);
}

.immersive-widget.large-size {
    transform: scale(1.6);
}

/* Mini Calendar Widget */
.immersive-calendar {
    width: 200px;
    padding: 12px;
}

.mini-cal-header {
    font-size: 14px;
    text-align: center;
    margin-bottom: 8px;
    color: #ffd700;
}

.mini-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 11px;
}

.mini-day {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.mini-day-name {
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: rgba(255, 255, 255, 0.4);
}

.mini-day.today {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.mini-day.holiday {
    color: #ffd700;
}

/* Force Calendar Today Marker to be White Glass Circle */
.calendar-day.today {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(8px) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    color: #fff !important;
    border-radius: 50% !important;
    padding: 0 !important;
    /* Reset padding to rely on flex centering */
    width: 34px;
    /* Slightly larger for better fit */
    height: 34px;
    margin: auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* --- Digit Update Animation (Enhanced Rolling Effect) --- */
@keyframes digit-slide-up {
    0% {
        transform: translateY(0);
        filter: brightness(1);
        opacity: 1;
    }

    40% {
        transform: translateY(-20px);
        opacity: 0;
        filter: brightness(2);
    }

    41% {
        transform: translateY(20px);
        opacity: 0;
    }

    100% {
        transform: translateY(0);
        opacity: 1;
        filter: brightness(1);
    }
}

@keyframes digit-glow-burst {

    0%,
    100% {
        text-shadow: 0 0 5px rgba(0, 242, 255, 0.5);
    }

    50% {
        text-shadow: 0 0 20px #00f2ff, 0 0 30px #00f2ff;
    }
}

.digit-update {
    display: inline-block !important;
    animation:
        digit-slide-up 0.5s cubic-bezier(0.4, 0, 0.2, 1),
        digit-glow-burst 0.5s ease-out;
    will-change: transform, opacity;
}

.mini-day.today {
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    padding: 2px;
}

/* Tablet/Mobile: Remove halo/glow and reduce large scale from immersive widgets */
@media screen and (max-width: 1366px) {

    .immersive-widget,
    .widget-digital-time {
        text-shadow: none !important;
    }

    .immersive-widget.large-size {
        transform: scale(1.2) !important;
        /* Reduced from 1.6 for mobile/tablets */
    }
}