/* === Responsive / Mobile Styles === */

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 210px;
    }

    .app-window {
        min-width: 180px;
        min-height: 140px;
    }

    .settings-panel {
        width: 260px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    :root {
        --sidebar-width: 56px;
    }

    .startup-content {
        padding: 1.5rem;
    }

    .startup-content h1 {
        font-size: 1.5rem;
    }

    .gesture-guide-preview {
        max-height: 30vh;
        overflow-y: auto;
    }

    /* Sidebar collapses to icon-only on mobile */
    .sidebar {
        width: var(--sidebar-width);
    }

    .sidebar-title,
    .sidebar-section-title,
    .sidebar-fps,
    .gesture-info,
    .gesture-desc,
    .status-label,
    .sidebar-window-list,
    .sidebar-actions,
    .sidebar-btn-row,
    .sidebar-select {
        display: none;
    }

    .sidebar-status {
        align-items: center;
    }

    .status-row {
        justify-content: center;
    }

    .sidebar .gesture-item {
        justify-content: center;
        padding: 0.4rem;
    }

    .sidebar .gesture-icon {
        width: auto;
        margin: 0;
    }

    .sidebar-collapse-btn {
        display: none;
    }

    .sidebar-header {
        justify-content: center;
        padding: 0.6rem;
    }

    .desktop {
        left: var(--sidebar-width);
    }

    .settings-panel {
        left: var(--sidebar-width);
        width: calc(100vw - var(--sidebar-width));
    }

    .app-window {
        min-width: 160px;
        min-height: 120px;
    }

    .window-titlebar {
        height: 32px;
    }

    .clock-time {
        font-size: 1.8rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    :root {
        --sidebar-width: 48px;
    }

    .startup-content h1 {
        font-size: 1.3rem;
    }

    .startup-icon svg {
        width: 48px;
        height: 48px;
    }

    .gesture-guide-preview .gesture-item {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
    }

    .sidebar .gesture-icon {
        font-size: 0.95rem;
    }
}

/* Touch devices */
@media (hover: none) and (pointer: coarse) {
    .app-window .resize-handle::after {
        opacity: 1;
    }

    .win-btn {
        width: 14px;
        height: 14px;
    }

    .win-btn svg {
        opacity: 1;
    }
}

/* Landscape mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .startup-overlay {
        overflow-y: auto;
    }

    .startup-content {
        padding: 1rem;
    }

    .gesture-guide-preview {
        max-height: 25vh;
        overflow-y: auto;
    }

    .sidebar .gesture-item {
        padding: 0.25rem 0.4rem;
    }

    .sidebar .gesture-icon {
        font-size: 0.9rem;
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .sidebar {
        padding-left: max(0px, env(safe-area-inset-left));
    }
}
