/* ==========================================================================
   macOS Desktop Widgets — Sonoma / Sequoia Frosted Glass Live Widgets
   ========================================================================== */

.desktop-widgets-column {
    position: absolute;
    top: 20px;
    left: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 2; /* Below windows (z-index: 10+) but above wallpaper */
    pointer-events: auto;
    transition: opacity 0.3s ease, transform 0.3s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* Hide widgets where they'd crowd the windows. */
@media (max-width: 1100px), (max-height: 640px) {
    .desktop-widgets-column {
        display: none !important;
    }
}

.mac-widget-card {
    background: rgba(28, 28, 34, 0.45);
    backdrop-filter: blur(30px) saturate(170%);
    -webkit-backdrop-filter: blur(30px) saturate(170%);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 22px;
    padding: 14px 16px;
    box-shadow: 0 14px 35px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.22);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, background 0.2s ease;
    cursor: default;
    width: 250px;
    position: relative;
    overflow: hidden;
    color: #fff;
    text-align: left;
    font: inherit;
}

button.mac-widget-card { cursor: pointer; display: block; }
button.mac-widget-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.mac-widget-card:hover {
    background: rgba(36, 36, 44, 0.55);
    transform: translateY(-2px);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* ── 1. Clock Widget ─────────────────────────────────────────────────── */
.widget-clock-wrap {
    display: flex;
    align-items: center;
    gap: 16px;
}

.analog-clock {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: #111114;
    border: 2px solid rgba(255, 255, 255, 0.25);
    position: relative;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.8), 0 4px 12px rgba(0, 0, 0, 0.4);
    flex-shrink: 0;
}

.clock-center-dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
}

.clock-hand {
    position: absolute;
    bottom: 50%;
    left: 50%;
    transform-origin: bottom center;
    border-radius: 4px;
}

.clock-hand.hour {
    width: 3px;
    height: 20px;
    background: #ffffff;
    margin-left: -1.5px;
    z-index: 2;
}

.clock-hand.minute {
    width: 2px;
    height: 26px;
    background: rgba(255, 255, 255, 0.85);
    margin-left: -1px;
    z-index: 3;
}

.clock-hand.second {
    width: 1.5px;
    height: 30px;
    background: #ff3b30;
    margin-left: -0.75px;
    z-index: 4;
}

.clock-meta {
    display: flex;
    flex-direction: column;
}

.clock-city {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.clock-digital-time {
    font-size: 20px;
    font-weight: 800;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.clock-date-tag {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 2px;
}

/* ── 2. Weather Widget ───────────────────────────────────────────────── */
.widget-weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.weather-city-name {
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
}

.weather-temp-main {
    font-size: 32px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1;
    margin: 4px 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", sans-serif;
}

.weather-icon {
    font-size: 26px;
    color: rgba(255, 255, 255, 0.92);
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.25));
}

.weather-icon.is-sun {
    color: #ffb300;
    filter: drop-shadow(0 2px 8px rgba(255, 179, 0, 0.4));
    animation: weatherSunGlow 4s ease-in-out infinite alternate;
}

@keyframes weatherSunGlow {
    from { transform: scale(1) rotate(0deg); }
    to { transform: scale(1.08) rotate(15deg); }
}

.weather-sub {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    gap: 8px;
}

/* ── 3. GitHub activity ──────────────────────────────────────────────── */
.widget-github-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 8px;
}

.widget-github-header img { filter: invert(1); opacity: 0.85; }

.widget-github-list { display: flex; flex-direction: column; gap: 2px; }

.widget-github-row {
    display: flex;
    flex-direction: column;
    padding: 6px 8px;
    margin: 0 -8px;
    border-radius: 9px;
    transition: background 0.15s ease;
}

.widget-github-row:hover { background: rgba(255, 255, 255, 0.1); }

.widget-github-name {
    font-size: 12.5px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.widget-github-meta { font-size: 11px; color: rgba(255, 255, 255, 0.55); }

.widget-github-skel {
    height: 30px;
    border-radius: 8px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06), rgba(255,255,255,0.13), rgba(255,255,255,0.06));
    background-size: 200% 100%;
    animation: widgetShimmer 1.4s linear infinite;
    margin-bottom: 4px;
}
.widget-github-skel.short { width: 60%; }

@keyframes widgetShimmer { to { background-position: -200% 0; } }

/* ── 4. Welcome Sticky Note Widget ───────────────────────────────────── */
.mac-sticky-note {
    background: rgba(255, 235, 133, 0.22);
    border: 1px solid rgba(255, 235, 133, 0.35);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
}

.sticky-header {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    color: #ffe680;
    margin-bottom: 6px;
}

.sticky-text {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.9);
}

.sticky-text kbd {
    font: 600 11px/1 var(--font-ui);
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.16);
    border: 0.5px solid rgba(255, 255, 255, 0.25);
}

@media (prefers-reduced-motion: reduce) {
    .weather-icon.is-sun, .widget-github-skel { animation: none; }
}
