/* Context Menu */
.context-menu {
    position: fixed;
    z-index: 20000;
    width: 180px;
    background: rgba(28, 28, 30, 0.6) !important;
    backdrop-filter: blur(25px) saturate(200%) !important;
    -webkit-backdrop-filter: blur(25px) saturate(200%) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35) !important;
    padding: 5px !important;
    display: none !important;
    flex-direction: column;
}

.context-menu.open {
    display: flex !important;
}

.context-menu .dd-item {
    font-size: 13px !important;
    padding: 6px 12px !important;
    border-radius: 6px !important;
    text-align: left !important;
    color: #fff !important;
    background: transparent !important;
    border: none !important;
    width: 100% !important;
    margin: 0 !important;
}

.context-menu .dd-item:hover {
    background: var(--blue) !important;
}

.context-menu .dd-sep {
    height: 1px !important;
    background: rgba(255, 255, 255, 0.1) !important;
    margin: 4px 6px !important;
}

/* Global macOS Cursors */
* {
    cursor: url('https://raw.githubusercontent.com/vinceliuice/WhiteSur-cursors/master/dist/cursors/left_ptr.svg'), auto !important;
}

a,
button,
[onclick],
.dock-item,
.tl,
.ck,
.tb-btn,
.fs-item,
.sn-item,
.dd-item:not(.disabled),
.lp-item,
.social-btn,
.sidebar-item,
.settings-nav-item,
.finder-icon-item,
.finder-sidebar-item {
    cursor: url('https://raw.githubusercontent.com/vinceliuice/WhiteSur-cursors/master/dist/cursors/hand2.svg'), pointer !important;
}

input,
textarea,
[contenteditable] {
    cursor: url('https://raw.githubusercontent.com/vinceliuice/WhiteSur-cursors/master/dist/cursors/ibeam.svg'), text !important;
}

/* Wallpaper Grid */
.wallpaper-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 8px;
}

.wallpaper-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    border-radius: 12px;
    object-fit: cover;
    border: 4px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wallpaper-thumb:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.wallpaper-thumb.active {
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.3);
}

/* Dropdown Animation Overrides */
.dropdown {
    display: block !important;
    opacity: 0;
    transform: scale(0.96) translateY(-8px);
    transition: opacity 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    visibility: hidden;
}

.dropdown.open {
    opacity: 1 !important;
    transform: scale(1) translateY(0) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* General Settings UI */
.settings-row select {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 6px;
    padding: 4px 8px;
    font-size: 11px;
    outline: none;
}

/* Smooth Boot Fixes */
#desktop {
    background: #000;
}

/* Startup Animations */
#menubar {
    transform: translateY(-100%);
    transition: transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

#desktop.system-ready #menubar {
    transform: translateY(0);
}

/* Fullscreen Overrides */
body.fullscreen-active #menubar,
body.fullscreen-active #desktop #menubar {
    transform: translateY(-100%) !important;
}

body.fullscreen-active #dock,
body.fullscreen-active #desktop #dock {
    transform: translateX(-50%) translateY(120%) !important;
}

body.fullscreen-active #dock.dock-visible {
    transform: translateX(-50%) translateY(0) !important;
}


#desktop #dock {
    opacity: 0 !important;
    transform: translate(-50%, 150px) !important;
    transition: transform 1.2s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1.2s ease-out;
    visibility: visible !important;
}

#desktop.system-ready #dock {
    opacity: 1 !important;
    transform: translate(-50%, 0) !important;
}

.desktop-icon {
    opacity: 0;
    transform: scale(0.9) translateY(10px);
    transition: opacity 0.6s var(--smooth), transform 0.6s var(--smooth);
}

#desktop.system-ready .desktop-icon {
    opacity: 1;
    transform: scale(1) translateY(0);
}

/* Stagger icons entry */
#desktop.system-ready .desktop-icon:nth-child(1) {
    transition-delay: 0.8s;
}

#desktop.system-ready .desktop-icon:nth-child(2) {
    transition-delay: 0.9s;
}

#desktop.system-ready .desktop-icon:nth-child(3) {
    transition-delay: 1.0s;
}

#desktop.system-ready .desktop-icon:nth-child(4) {
    transition-delay: 1.1s;
}

/* Boot Logo Refinement */
.apple-logo {
    opacity: 0;
    animation: fadeScale .5s ease forwards .3s, bootLogoPulse 2.5s ease-in-out infinite alternate .8s;
}

@keyframes bootLogoPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 255, 255, 0));
    }

    100% {
        transform: scale(1.02);
        filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.4));
    }
}



/* Dock Item Smooth Removal */
.dock-item {
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1), width 0.5s cubic-bezier(0.19, 1, 0.22, 1), margin 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.dock-item.removing {
    transform: scale(0) translateY(40px);
    opacity: 0;
    width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

/* Calculator Scientific Style */
.calc-keys.scientific {
    grid-template-columns: repeat(10, 1fr) !important;
}

.calc-display {
    font-family: 'Inter', sans-serif !important;
    font-weight: 200 !important;
    font-size: 52px !important;
    transition: all 0.3s var(--smooth);
    position: relative;
    overflow: hidden;
}

/* Slide-in animation for numbers */
.calc-display-val {
    display: inline-block;
    animation: numSlideIn 0.2s var(--smooth) forwards;
}

@keyframes numSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.calc-keys {
    transition: grid-template-columns 0.4s var(--smooth);
}

.ck-scientific {
    background: #2a2a2c !important;
    font-size: 13px !important;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.3s var(--smooth);
}

.calc-keys.scientific .ck-scientific {
    opacity: 1;
    transform: scale(1);
}

.ck-scientific:hover {
    background: #3a3a3c !important;
}

/* Result Flash Effect */
.calc-flash {
    animation: calcResultFlash 0.3s var(--smooth);
}

#window-calculator {
    transition: width 0.4s var(--smooth), height 0.4s var(--smooth), top 0.4s var(--smooth), left 0.4s var(--smooth);
}

#window-calculator:has(.scientific) {
    width: 650px !important;
}

@keyframes calcResultFlash {
    0% {
        background: rgba(255, 255, 255, 0.2);
    }

    100% {
        background: transparent;
    }
}

.ck-op.active {
    background: #fff !important;
    color: #ff9f0a !important;
}

.discord-native-overlay {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 300px;
    background: #111214;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    z-index: 10;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: transform 0.3s var(--smooth);
}

.discord-native-overlay:hover {
    transform: translateY(-4px);
}

.discord-banner {
    height: 60px;
    background: var(--blue);
}

.discord-win-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 6px solid #111214;
    margin-top: -40px;
    margin-left: 16px;
    background: #111214;
    object-fit: cover;
}

.discord-profile-details {
    padding: 16px;
}

.discord-win-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    border: none !important;
}

.discord-win-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #b5bac1;
}

.discord-status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #23a55a;
}

/* Tutorial Overlay */
#tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.4s var(--smooth);
    pointer-events: none;
    /* Allow clicking through the blur part, but the overlay child handles its own clicks */

    /* The hole trick */
    clip-path: polygon(0% 0%, 0% 100%, 100% 100%, 100% 0%, 0% 0%,
            var(--hole-left, 0) var(--hole-top, 0),
            var(--hole-right, 0) var(--hole-top, 0),
            var(--hole-right, 0) var(--hole-bottom, 0),
            var(--hole-left, 0) var(--hole-bottom, 0),
            var(--hole-left, 0) var(--hole-top, 0));
}

.tutorial-card {
    pointer-events: auto;
    /* Re-enable clicks for the guide card */
}

#tutorial-overlay.hidden {
    display: none;
}

.tutorial-card {
    width: 380px;
    background: rgba(30, 30, 35, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    animation: springPop 0.6s var(--spring);
}

.tutorial-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.tutorial-avatar {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 2px solid var(--blue);
}

.tutorial-title-group h3 {
    margin: 0;
    font-size: 18px;
    color: #fff;
}

.tutorial-title-group span {
    font-size: 12px;
    opacity: 0.5;
    color: #fff;
}

.tutorial-body {
    min-height: 80px;
    margin-bottom: 30px;
}

.tutorial-body p {
    font-size: 15px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    font-weight: 500;
}

#tutorial-text.typing::after {
    content: '|';
    margin-left: 2px;
    color: var(--blue);
    animation: blink 0.8s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.tutorial-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.btn-tutorial {
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-tutorial.skip {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.6);
}

.btn-tutorial.next {
    background: var(--blue);
    color: white;
    flex: 1;
}

.btn-tutorial:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.tutorial-progress {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
}

.tutorial-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s;
}

.tutorial-dot.active {
    background: var(--blue);
    width: 16px;
    border-radius: 3px;
}

@keyframes springPop {
    0% {
        transform: scale(0.8) translateY(40px);
        opacity: 0;
    }

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

.tutorial-highlight {
    position: relative;
    z-index: 10001 !important;
    box-shadow: 0 0 0 4px var(--blue), 0 0 20px var(--blue) !important;
    transition: all 0.3s var(--smooth);
    backdrop-filter: blur(0) !important;
    filter: blur(0) !important;
}

/* YouTube App Styles */
.yt-app {
    display: flex;
    height: 100%;
    background: #0f0f0f;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

.yt-sidebar {
    width: 240px;
    padding: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.yt-sidebar-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 10px 16px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s var(--smooth);
    font-size: 13px;
    font-weight: 500;
}

.yt-sidebar-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.yt-sidebar-item.active {
    background: rgba(255, 255, 255, 0.15) !important;
    font-weight: 600;
}

.yt-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background: #0f0f0f;
}

.yt-header {
    padding: 12px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(15, 15, 15, 0.95);
    backdrop-filter: blur(20px);
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.yt-header-left {
    display: flex;
    align-items: center;
}

.yt-user-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.yt-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-search-container {
    flex: 1;
    max-width: 500px;
    display: flex;
    align-items: center;
    background: #121212;
    border: 1px solid #333;
    border-radius: 40px;
    padding: 0 20px;
}

.yt-search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: #fff;
    padding: 8px 0;
    font-size: 14px;
    outline: none;
}

.yt-search-btn {
    background: none;
    border: none;
    color: #888;
    padding: 8px;
    cursor: pointer;
}

.yt-user-actions {
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.yt-profile-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.yt-video-grid {
    padding: 24px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px 16px;
}

.yt-video-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.yt-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9;
    background: #222;
    border-radius: 12px;
    overflow: hidden;
}

.yt-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s var(--smooth);
}

.yt-video-card:hover .yt-thumbnail {
    transform: scale(1.05);
}

.yt-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.yt-video-info {
    display: flex;
    gap: 12px;
}

.yt-chan-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.yt-video-meta {
    flex: 1;
}

.yt-video-card {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: transform 0.3s var(--smooth);
}

.yt-video-card:hover {
    transform: translateY(-4px);
}

.yt-video-meta h4 {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 6px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.yt-video-meta p {
    font-size: 12px;
    color: #888;
    margin: 0;
}

/* Video Player Overlay */
.yt-player-overlay {
    position: absolute;
    inset: 0;
    background: #000;
    z-index: 100;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.3s var(--smooth);
}

.yt-player-header {
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    background: #0f0f0f;
}

.yt-back-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
}


.yt-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.yt-video-frame {
    flex: 1;
    width: 100%;
    border: none;
}

/* ====================== SMOOTHNESS & POLISH ====================== */

/* Smooth scrolling in all window bodies */
.win-body {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Silky button interactions */
.btn-primary,
.btn-secondary {
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.btn-primary:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}

.btn-primary:active,
.btn-secondary:active {
    transform: scale(0.97);
    filter: brightness(0.9);
}

/* Smooth traffic light hover */
.tl {
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.tl:hover {
    transform: scale(1.15);
}

.tl:active {
    transform: scale(0.9);
}

/* GPU-composited dock icons */
.dock-item .dock-img {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Smoother dock tooltip */
.dock-tooltip {
    transition: opacity 0.2s var(--smooth), transform 0.2s var(--smooth);
}

/* Silky window chrome hover */
.win-chrome {
    transition: background 0.2s var(--smooth);
}

/* Smooth settings nav items */
.settings-nav-item {
    transition: background 0.15s var(--smooth), color 0.15s var(--smooth);
}

/* Smooth Finder items */
.fr {
    transition: background 0.12s var(--smooth);
}

/* Polished scrollbar for dark theme */
.win-body::-webkit-scrollbar {
    width: 8px;
}

.win-body::-webkit-scrollbar-track {
    background: transparent;
}

.win-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.win-body::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
    background-clip: padding-box;
}

/* No text selection flicker during drag */
.win-chrome {
    user-select: none;
    -webkit-user-select: none;
}

/* ====================== PYTHON ADE ====================== */
.ade-body {
    display: flex;
    flex-direction: column;
    height: calc(100% - 32px);
    /* win-chrome is 32px */
    background: #1e1e1e;
    color: #cccccc;
    font-family: 'JetBrains Mono', 'Menlo', monospace;
    overflow: hidden;
}

.ade-editor-container {
    flex: 1;
    position: relative;
    border-bottom: 1px solid #333;
}

.ade-editor {
    width: 100%;
    height: 100%;
    background: #1e1e1e;
    color: #9cdcfe;
    border: none;
    resize: none;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    outline: none;
    font-family: inherit;
}

.ade-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: #252526;
    border-bottom: 1px solid #333;
}

.ade-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    border: none;
}

.ade-run {
    background: #0e639c;
    color: #fff;
}

.ade-run:hover {
    background: #1177bb;
}

.ade-run:disabled {
    background: #3a3d41;
    cursor: not-allowed;
    opacity: 0.6;
}

.ade-clear {
    background: transparent;
    color: #cccccc;
    border: 1px solid #454545;
}

.ade-clear:hover {
    background: #333333;
}

.ade-status {
    margin-left: auto;
    font-size: 11px;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ade-console {
    height: 180px;
    background: #000000;
    padding: 12px;
    overflow-y: auto;
    font-size: 13px;
    border-top: 1px solid #333;
}

.console-line {
    margin-bottom: 4px;
    word-break: break-all;
    white-space: pre-wrap;
}

.console-line.system {
    color: #569cd6;
    font-style: italic;
}

.console-line.output {
    color: #d4d4d4;
}

.console-line.error {
    color: #f48771;
}

.console-line.info {
    color: #888;
}

.ade-console::-webkit-scrollbar {
    width: 10px;
}

.ade-console::-webkit-scrollbar-track {
    background: transparent;
}

.ade-console::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 5px;
}

.ade-console::-webkit-scrollbar-thumb:hover {
    background: #444;
}

@keyframes lpItemIn {
    0% {
        transform: scale(0.9);
        opacity: 0;
    }

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

/* Subtle hover glow for interactive cards */
.gh-repo,
.safari-contact-card,
.yt-video-card {
    transition: transform 0.25s var(--smooth), box-shadow 0.25s var(--smooth), background 0.25s var(--smooth);
}

.gh-repo:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

/* Smoother context menu */
.context-menu {
    transition: opacity 0.12s var(--smooth), transform 0.12s var(--smooth) !important;
}

/* Boot Screen Loader Fix */
.boot-progress-track {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    margin-top: 24px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3) inset;
}

.boot-progress-fill {
    width: 0%;
    height: 100%;
    background: #fff;
    border-radius: 4px;
    /* transition is applied via JS (1.5s ease-in-out) */
}

/* LOCK SCREEN */
#lock-screen {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10vh;
    color: white;
    opacity: 1;
    visibility: visible;
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
        visibility 0.8s ease,
        backdrop-filter 1.2s cubic-bezier(0.4, 0, 0.2, 1),
        -webkit-backdrop-filter 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
}

#lock-screen.blurred {
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
}

#lock-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.ls-clock {
    font-size: 160px;
    font-weight: 800;
    letter-spacing: -4px;
    margin-top: -20px;
    margin-bottom: auto;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1;
    opacity: 0.85;
}

.ls-date {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 0;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    opacity: 0.85;
}

.ls-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 15vh;
    animation: pulse 3s infinite;
}

.ls-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.ls-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
}

.ls-hint {
    font-size: 13px;
    opacity: 0.6;
}

@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }

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

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

/* ====================== WIDGET PANEL ====================== */
#desktop {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1.5px, transparent 1.5px);
    background-size: 100px 100px;
}

#widget-panel {
    position: absolute;
    top: 40px;
    right: 8px;
    width: 320px;
    height: fit-content;
    max-height: calc(95vh - 40px);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: rgba(30, 30, 40, 0.45);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border-radius: 24px;
    padding: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

/* Fullscreen adjustment */
body.fullscreen-active #widget-panel,
body:fullscreen #widget-panel {
    top: 10px;
}

.wp-music iframe {
    overflow: hidden !important;
}

#widget-panel::-webkit-scrollbar {
    display: none;
}

/* Widget Cards */
.wp-card {
    background: rgba(0, 0, 0, 0.35);
    border-radius: 16px;
    padding: 12px;
    color: #fff;
}

/* ---- Calendar Widget ---- */
.wp-calendar {
    padding: 10px 12px;
}

.wp-cal-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.wp-cal-left {
    flex: 0 0 auto;
    min-width: 90px;
}

.wp-cal-pipe {
    color: #FF9F0A;
    font-weight: 700;
    font-size: 14px;
}

.wp-cal-today {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.wp-cal-task {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 4px;
    line-height: 1.3;
}

.wp-cal-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1px;
    font-size: 10px;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

.wp-cal-grid .cal-head {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.4);
    padding: 2px 0;
    font-size: 9px;
}

.wp-cal-grid .cal-day {
    padding: 3px 0;
    border-radius: 50%;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin: 0 auto;
    font-size: 10px;
}

.wp-cal-grid .cal-day.today {
    background: #FF3B30;
    color: #fff;
    font-weight: 700;
}

.wp-cal-grid .cal-day.other {
    color: rgba(255, 255, 255, 0.2);
}

/* ---- App Shortcuts ---- */
.wp-apps {
    padding: 10px;
}

.wp-apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.wp-app-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: 14px;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    margin: 0 auto;
}

.wp-app-icon:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.08);
}

.wp-app-icon:active {
    transform: scale(0.95);
}

.wp-app-icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 8px;
}

/* ---- Location + Sliders Row ---- */
.wp-row {
    display: flex;
    gap: 10px;
}

.wp-location {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 16px;
    min-height: 120px;
}

.wp-loc-speed {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: -2px;
    line-height: 1;
    color: #fff;
}

.wp-loc-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.wp-loc-fill {
    height: 100%;
    width: 60%;
    background: #007AFF;
    border-radius: 3px;
    transition: width 1s ease;
}

/* ---- Sliders ---- */
.wp-sliders {
    flex: 0 0 90px;
    display: flex;
    gap: 8px;
    padding: 10px 8px;
    align-items: stretch;
    min-height: 120px;
}

.wp-slider-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
}

.wp-vslider {
    -webkit-appearance: none;
    appearance: none;
    writing-mode: vertical-lr;
    direction: rtl;
    width: 34px;
    flex: 1;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 17px;
    outline: none;
    cursor: pointer;
}

.wp-vslider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    cursor: pointer;
}

.wp-vslider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #e0e0e0;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
}

/* ---- Music Widget ---- */
.wp-music {
    flex: 1;
    padding: 0;
    overflow: hidden;
    border-radius: 12px;
    background: transparent;
    display: flex;
    min-height: 152px;
}

.wp-music iframe {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

/* Draggable & Grid Styles */
.desktop-icon,
#widget-panel {
    cursor: grab;
    user-select: none;
    -webkit-user-drag: none;
}

.desktop-icon:active,
#widget-panel:active {
    cursor: grabbing;
}

#desktop-icons {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
}

.dragging {
    z-index: 1000 !important;
    opacity: 0.8 !important;
    cursor: grabbing !important;
    transition: none !important;
}

/* News Widget Styling */
.nw-panel {
    position: absolute;
    top: 310px;
    left: 25px;
    width: 500px;
    /* Wider horizontal layout */
    padding: 30px;
    /* Increased padding */
    background: rgba(0, 0, 0, var(--nw-bg-opacity, 0.4));
    backdrop-filter: var(--nw-blur, blur(10px));
    -webkit-backdrop-filter: var(--nw-blur, blur(10px));
    border-radius: 24px;
    border: var(--nw-border, 1px solid rgba(255, 255, 255, 0.1));
    box-shadow: var(--nw-shadow, 0 8px 32px rgba(0, 0, 0, 0.3));
    color: white;
    font-family: var(--sf);
    z-index: 100;
    cursor: grab;
    user-select: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nw-panel:active {
    cursor: grabbing;
}

.nw-clock {
    font-size: 68px;
    /* ~80% of 84 */
    font-weight: 300;
    line-height: 1;
    letter-spacing: -2px;
}

.nw-date {
    font-size: 26px;
    /* ~80% of 32 */
    font-weight: 400;
    margin-bottom: 4px;
    opacity: 0.95;
}

.nw-content-row {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nw-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 0;
}

.nw-item {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    opacity: 0.85;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.95);
    cursor: pointer;
    transition: opacity 0.2s;
}

.nw-item:hover {
    opacity: 1;
    text-decoration: underline;
}

.nw-next {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
}

.nw-next:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

.nw-next:active {
    transform: scale(0.95);
    background: rgba(255, 255, 255, 0.15);
}

.nw-dots {
    display: flex;
    gap: 8px;
    /* Reduced gap */
    justify-content: flex-start;
    padding-left: 2px;
}

.nw-dot {
    width: 8px;
    /* ~80% of 10 */
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transition: background 0.3s;
}

.nw-dot.active {
    background: rgba(255, 255, 255, 0.8);
}

.notes-page a {
    color: white !important;
}