/* 
================================================
macOS Big Sur / Monterey Style Theme
Desktop Simulator Design
================================================
*/

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

:root {
    /* macOS Colors */
    --mac-bg: #url('/assets/img/macos-wallpaper.jpg');
    /* Fallback needed */
    --mac-system-gray: #f5f5f7;
    --mac-window-bg: rgba(255, 255, 255, 0.85);
    --mac-sidebar-bg: rgba(245, 245, 247, 0.5);
    --mac-glass-border: rgba(255, 255, 255, 0.4);
    --mac-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    --mac-dock-bg: rgba(255, 255, 255, 0.2);
    --mac-dock-border: rgba(255, 255, 255, 0.2);
    --mac-accent: #007aff;
    --mac-text: #1d1d1f;
    --mac-text-secondary: #86868b;

    /* Font */
    --font-stack: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Custom Cursor */
body {
    cursor: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M5.5 3.5L11.5 20.5L14.5 13.5L21.5 10.5L5.5 3.5Z" fill="black" stroke="white" stroke-width="1.5"/></svg>'), auto;
}

a,
button,
.clickable {
    cursor: url('data:image/svg+xml;utf8,<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M9 3C9 3 9 8 13 8C17 8 17 3 17 3" stroke="black" stroke-width="1.5"/><path d="M13 8V21" stroke="black" stroke-width="1.5"/><path d="M9 21H17" stroke="black" stroke-width="1.5"/></svg>'), pointer;
    /* Simple hand fallback idea, usually just pointer */
}

/* Reset & Base */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background: url('https://images.unsplash.com/photo-1493246507139-91e8fad9978e?ixlib=rb-4.0.3&auto=format&fit=crop&w=2070&q=80') no-repeat center center fixed;
    background-size: cover;
    color: var(--mac-text);
    margin: 0;
    padding: 0;
    height: 100vh;
    overflow: hidden;
    /* Desktop doesn't scroll, windows do */
    display: flex;
    flex-direction: column;
}

/* Menu Bar */
.macos-menubar {
    height: 28px;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    font-size: 13px;
    font-weight: 500;
    color: #000;
    z-index: 9999;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.05);
}

.menubar-left,
.menubar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.apple-logo {
    font-size: 16px;
}

.app-name {
    font-weight: 700;
}

.menu-items span {
    margin-right: 15px;
    cursor: default;
}

.menu-items span:hover {
    opacity: 0.7;
}

.menubar-right i {
    font-size: 14px;
}

/* Desktop Area */
.desktop-area {
    flex: 1;
    position: relative;
    padding: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* Finder Window */
/* Finder Window styles moved to end of file for maximize override */

@keyframes windowOpen {
    from {
        transform: scale(0.95);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.window-titlebar {
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.traffic-lights {
    display: flex;
    gap: 8px;
    margin-right: 20px;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.traffic-light.close {
    background: #ff5f57;
    border: 1px solid #e0443e;
}

.traffic-light.minimize {
    background: #febc2e;
    border: 1px solid #dba520;
}

.traffic-light.maximize {
    background: #28c840;
    border: 1px solid #1aa02e;
}

.window-toolbar {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.toolbar-title {
    font-weight: 600;
    color: #333;
}

.toolbar-actions {
    display: flex;
    gap: 15px;
    color: #666;
}

/* Window Content Layout */
.window-body {
    flex: 1;
    display: flex;
    overflow: hidden;
    min-height: 0;
    /* Crucial for nested flex scrolling */
}

.window-sidebar {
    width: 220px;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.sidebar-group {
    margin-bottom: 20px;
}

.sidebar-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--mac-text-secondary);
    margin-bottom: 8px;
    padding-left: 10px;
    text-transform: uppercase;
}

.sidebar-item {
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    color: var(--mac-text);
    font-size: 13px;
    text-decoration: none;
    margin-bottom: 2px;
}

.sidebar-item i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: var(--mac-accent);
}

.sidebar-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.sidebar-item.active {
    background: rgba(0, 0, 0, 0.1);
}

.window-main {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #fff;
}

/* Content Styling inside Window */
.finder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.finder-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    transition: background 0.2s;
    text-decoration: none;
    color: var(--mac-text);
}

.finder-item:hover {
    background: #e5f1fb;
}

.finder-icon {
    font-size: 48px;
    margin-bottom: 10px;
    color: var(--mac-accent);
}

.finder-name {
    font-size: 13px;
    font-weight: 500;
}

/* Dock */
.macos-dock-container {
    position: fixed;
    bottom: 20px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    z-index: 10000;
}

.macos-dock {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 8px 10px;
    display: flex;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: width 0.3s;
}

.dock-item {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: #fff;
    background: linear-gradient(180deg, #4facfe 0%, #00f2fe 100%);
    /* Default App Gradient */
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), margin 0.2s;
    position: relative;
    text-decoration: none;
}

.dock-item:hover {
    transform: scale(1.2) translateY(-10px);
    margin: 0 10px;
}

/* App Specific Colors */
.app-finder {
    background: linear-gradient(180deg, #1cb5e0 0%, #000851 100%);
}

.app-safari {
    background: #fff;
    color: #007aff;
}

.app-mail {
    background: linear-gradient(180deg, #30cfd0 0%, #330867 100%);
}

.app-photos {
    background: #fff;
}

.app-settings {
    background: #ccc;
    color: #555;
}

/* Spotlight Overlay */
.spotlight-overlay {
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 600px;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(40px);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 15px;
    z-index: 10001;
    display: none;
    /* Hidden by default */
}

.spotlight-overlay.active {
    display: block;
    animation: spotlightFade 0.2s ease-out;
}

@keyframes spotlightFade {
    from {
        transform: translate(-50%, -45%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

.spotlight-search {
    width: 100%;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #000;
    outline: none;
    padding-left: 40px;
    font-weight: 300;
}

.spotlight-icon {
    position: absolute;
    left: 20px;
    top: 22px;
    font-size: 20px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .window-sidebar {
        display: none;
    }

    .macos-window {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .macos-dock-container {
        display: none;
        /* Hide dock on mobile usually, or make it smaller */
    }

    .macos-menubar {
        padding: 0 10px;
    }

    .menu-items {
        display: none;
    }
}

/* Context Menu */
.context-menu {
    position: absolute;
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 0, 0, 0.1);
    padding: 5px 0;
    z-index: 20000;
    display: none;
    font-size: 13px;
    color: #333;
}

.context-menu.active {
    display: block;
}

.context-item {
    padding: 6px 15px;
    cursor: default;
    display: flex;
    justify-content: space-between;
}

.context-item:hover {
    background: var(--mac-accent);
    color: #fff;
}

.context-separator {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin: 4px 0;
}

/* Sticky Notes */
.sticky-note {
    position: absolute;
    width: 300px;
    min-height: 200px;
    background: #fff7a1;
    /* Default Yellow */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    border-radius: 2px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    transform: rotate(-1deg);
    transition: transform 0.2s, box-shadow 0.2s;
    animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    from {
        transform: scale(0.5) rotate(0deg);
        opacity: 0;
    }

    to {
        transform: scale(1) rotate(-1deg);
        opacity: 1;
    }
}

.sticky-note:active {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    transform: scale(1.02) rotate(0deg);
    z-index: 1001;
}

.sticky-header {
    height: 30px;
    background: rgba(0, 0, 0, 0.05);
    cursor: move;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 0 5px;
}

.sticky-close {
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    opacity: 0.5;
    font-size: 14px;
}

.sticky-close:hover {
    opacity: 1;
}

.sticky-content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.sticky-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    line-height: 1.3;
}

.sticky-text {
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
}

.sticky-action {
    margin-top: 15px;
    text-align: right;
}

.sticky-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    font-family: inherit;
}

.sticky-btn:hover {
    background: rgba(0, 0, 0, 0.2);
}

/* Note Colors */
.note-yellow {
    background: #fff7a1;
}

.note-pink {
    background: #ffcce0;
}

.note-blue {
    background: #ccf2ff;
}

.note-green {
    background: #ccffcc;
}

/* Dock Enhancements */
.dock-item {
    position: relative;
}

.dock-item.active::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #333;
    /* Dark dot for light dock */
    border-radius: 50%;
}

.dock-item:active {
    animation: bounce 0.4s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.dock-tooltip {
    position: absolute;
    top: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    color: #333;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.dock-item:hover .dock-tooltip {
    opacity: 1;
}

.app-trash {
    background: linear-gradient(180deg, #d3d3d3 0%, #999 100%);
    margin-left: 20px;
    /* Separator */
    position: relative;
}

.app-trash::before {
    content: '';
    position: absolute;
    left: -14px;
    top: 10%;
    height: 80%;
    width: 1px;
    background: rgba(0, 0, 0, 0.1);
}

/* Desktop Category Stacks */
.desktop-board {
    display: flex;
    gap: 30px;
    padding: 40px;
    overflow-x: auto;
    height: 100%;
    align-items: flex-start;
    width: 100%;
}

.category-zone {
    min-width: 320px;
    width: 320px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    flex-direction: column;
    max-height: 85vh;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.category-zone:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.25);
}

.zone-header {
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-weight: 600;
    font-size: 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 10px;
}

.zone-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Static Sticky Note (in stack) */
.static-sticky-note {
    background: #fff7a1;
    padding: 15px;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-family: 'Comic Sans MS', 'Chalkboard SE', sans-serif;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    color: #333;
    text-decoration: none;
    display: block;
}

.static-sticky-note:hover {
    transform: scale(1.02) rotate(-1deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.static-sticky-note:nth-child(even) {
    transform: rotate(1deg);
}

.static-sticky-note:nth-child(even):hover {
    transform: scale(1.02) rotate(2deg);
}

.note-pin {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d32f2f;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 5;
}

.static-note-title {
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 8px;
    line-height: 1.3;
}

.static-note-summary {
    font-size: 13px;
    line-height: 1.4;
    margin-bottom: 10px;
    opacity: 0.9;
}

.static-note-footer {
    font-size: 11px;
    text-align: right;
    opacity: 0.7;
    font-weight: 600;
}

/* Scrollbar for zones */
.zone-content::-webkit-scrollbar {
    width: 6px;
}

.zone-content::-webkit-scrollbar-track {
    background: transparent;
}

.zone-content::-webkit-scrollbar-thumb:hover {}

/* Responsive */
@media (max-width: 768px) {
    .desktop-board {
        flex-direction: column;
        overflow-x: hidden;
        overflow-y: auto;
        padding: 20px;
    }

    .category-zone {
        width: 100%;
        min-width: auto;
        max-height: none;
    }
}

/* Fix for Sticky Note Colors */
.static-sticky-note.note-yellow {
    background: #fff7a1;
}

.static-sticky-note.note-pink {
    background: #ffcce0;
}

.static-sticky-note.note-blue {
    background: #ccf2ff;
}

.static-sticky-note.note-green {
    background: #ccffcc;
}

/* Mac Terminal Code Block (Simple Dark Style) */
.mac-terminal {
    background: #0d1117;
    /* Deep Dark Background */
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    margin: 20px 0;
    overflow: hidden;
    font-family: 'Menlo', 'Monaco', 'Courier New', monospace;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mac-terminal-header {
    background: transparent;
    /* Transparent header to blend with body */
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: none;
    position: relative;
}

.mac-terminal-lang {
    color: #ffbd2e;
    /* Orange Color */
    font-weight: bold;
    font-size: 14px;
    text-transform: lowercase;
    /* Ensure lowercase like 'css' */
}

.mac-terminal-dots {
    display: flex;
    gap: 8px;
}

.mac-terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.mac-terminal-dot.red {
    background: #ff5f56;
}

.mac-terminal-dot.yellow {
    background: #ffbd2e;
}

.mac-terminal-dot.green {
    background: #27c93f;
}

.mac-terminal-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: #999;
    font-size: 12px;
    font-weight: 500;
}

.mac-terminal-content {
    padding: 0 20px 20px 20px;
    /* Adjust padding since header is transparent/merged */
    color: #e6edf3;
    /* Light text color for visibility */
    overflow-x: auto;
    position: relative;
}

.mac-terminal-content pre {
    margin: 0;
    padding: 0;
    /* background: transparent; Removed to allow original background */
    border: none;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    color: inherit;
    /* Inherit light color */
}

.mac-terminal-content code {
    color: inherit;
    /* Ensure code inherits light color */
    background: transparent;
    /* Ensure no background clash */
}

.mac-copy-btn {
    background: transparent;
    border: none;
    color: #666;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    transition: color 0.2s;
    padding: 5px;
}

.mac-copy-btn:hover {
    color: #fff;
}

/* Force hide legacy copy buttons */
.copy-btn {
    display: none !important;
}

/* Notes App Styling */
.app-notes .window-sidebar {
    background: rgba(245, 245, 245, 0.9);
    backdrop-filter: blur(20px);
    width: 220px;
    flex-shrink: 0;
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

/* Middle Column: Note List */
.note-list-col {
    width: 300px;
    background: #fff;
    border-right: 1px solid #e5e5e5;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
}

.note-list-header {
    padding: 15px 20px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.note-list-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.note-count {
    font-size: 12px;
    color: #999;
}

.note-list-items {
    flex: 1;
    overflow-y: auto;
}

.note-item {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    transition: background 0.1s;
}

.note-item:hover {
    background: #f9f9f9;
}

.note-item.active {
    background: #ffeeba;
    /* Light yellow highlight like Notes */
}

.note-item-title {
    font-weight: 600;
    font-size: 14px;
    color: #222;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.note-item-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: #888;
}

.note-item-date {
    flex-shrink: 0;
}

.note-item-preview {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #999;
}

/* Main Content Column */
.app-notes .window-main {
    background: #fff;
    padding: 40px 50px;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    flex: 1;
    min-height: 0;
    /* Crucial for nested flex scrolling */
    overflow-y: auto;
}

.app-notes .article-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.app-notes .article-meta-top {
    color: #999;
    font-size: 13px;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.app-notes .article-title {
    font-size: 32px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.app-notes .article-content {
    font-size: 17px;
    line-height: 1.6;
    color: #333;
}

/* Window Management */
.macos-window {
    position: absolute;
    /* Maximized by default */
    top: 40px;
    /* Below Menu Bar (28px) + margin */
    bottom: 100px;
    /* Above Dock (~80px) + margin */
    left: 20px;
    right: 20px;
    width: auto;
    height: auto;
    min-width: 600px;
    min-height: 400px;
    transform: none;

    background: var(--mac-window-bg);
    border-radius: 12px;
    box-shadow: var(--mac-shadow);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid var(--mac-glass-border);
    display: flex;
    flex-direction: column;
    animation: windowOpen 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    margin: 0;
}

.macos-window.maximized {
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    border-radius: 0;
}

.window-titlebar {
    cursor: default;
    /* Will be overridden by JS for draggable area */
}

/* Resize Handles */
.resize-handle {
    position: absolute;
    z-index: 100;
}

.resize-r {
    cursor: col-resize;
    right: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.resize-b {
    cursor: row-resize;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
}

.resize-br {
    cursor: nwse-resize;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
}

.resize-l {
    cursor: col-resize;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
}

.resize-t {
    cursor: row-resize;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
}

.resize-tl {
    cursor: nwse-resize;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
}

.resize-tr {
    cursor: nesw-resize;
    top: 0;
    right: 0;
    width: 10px;
    height: 10px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {

    /* Hide Desktop Elements */
    .macos-menubar,
    .macos-dock-container {
        display: none !important;
    }

    .macos-window {
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 60px !important;
        /* Space for mobile nav */
        width: 100% !important;
        height: auto !important;
        min-width: 0 !important;
        /* Reset min-width */
        min-height: 0 !important;
        /* Reset min-height */
        border-radius: 0 !important;
        transform: none !important;
        border: none;
        box-shadow: none;
    }

    /* iOS Notes Style Header */
    .window-titlebar {
        padding: 0 15px;
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(20px);
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        height: 44px;
        /* Standard iOS nav bar height */
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .traffic-lights {
        display: none;
        /* Hide traffic lights on mobile */
    }

    .window-toolbar {
        padding: 0;
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .toolbar-actions {
        color: #e0a025 !important;
        /* iOS Notes Yellow/Orange */
        font-size: 17px;
        flex: 0 0 auto;
        /* Don't shrink */
    }

    .toolbar-actions a {
        color: #e0a025 !important;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    /* Back button chevron adjustment */
    .toolbar-actions .fa-chevron-left {
        font-size: 20px;
        font-weight: 400;
    }

    .toolbar-title {
        font-size: 17px;
        font-weight: 600;
        color: #000;
        flex: 1;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0 10px;
    }

    /* Hide the inactive right chevron on mobile */
    .toolbar-actions .fa-chevron-right {
        display: none;
    }

    .app-notes .window-sidebar,
    .note-list-col {
        display: none !important;
        /* Hide sidebar and note list on mobile */
    }

    .app-notes .window-main {
        padding: 15px !important;
        padding-top: 10px !important;
    }

    .app-notes .article-title {
        font-size: 24px;
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }

    .app-notes .article-content {
        font-size: 17px;
        /* Standard iOS body size */
        line-height: 1.5;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .app-notes .article-content img {
        max-width: 100%;
        height: auto;
    }

    .app-notes .article-content pre {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre-wrap;
        /* Wrap code lines on mobile */
        word-wrap: break-word;
    }

    /* Hide resize handles on mobile */
    .resize-handle {
        display: none !important;
    }
}

/* Custom Scrollbar for macOS Theme */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Auto-Hide Dock on Article Pages */
.page-article .macos-dock-container {
    transform: translateY(100%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    /* Prevent accidental clicks when hidden */
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: 80px;
    /* Ensure hover area exists */
}

.page-article .macos-dock-container:hover,
.page-article .macos-dock-container:focus-within {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* Maximize Window on Article Pages */
/* Maximize Window on Article Pages */
.page-article .macos-window {
    bottom: 0 !important;
    /* Cover full height */
    border-radius: 0 !important;
    /* Fully square */
    border-bottom: none;
    top: 0 !important;
    /* Start at very top to cover gap */
    padding-top: 0;
    /* Remove padding from container */
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    transform: none !important;
    box-shadow: none;
    border: none;
}

.page-article .window-titlebar {
    padding-top: 28px;
    /* Add padding to titlebar instead */
    height: 80px;
    /* 52px original + 28px padding */
    background: rgba(255, 255, 255, 0.95);
    /* Ensure background covers menu bar area */
}