/* responsive.css — Desktop and mobile responsive breakpoints */

/* Desktop: center modal, wider layout */
@media (min-width: 600px) {
    .modal-backdrop {
        align-items: center;
    }

    .modal-sheet {
        border-radius: 24px;
        max-height: 85vh;
        animation: slideUpDesktop 0.25s ease;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }

    .modal-header {
        border-radius: 24px 24px 0 0;
    }

    .filter-bar {
        padding: var(--s2) var(--s6);
        gap: var(--s1);
    }

    .filter-tab {
        padding: var(--s2) var(--s4);
        font-size: 14px;
    }

    #main-content {
        padding: var(--s3) var(--s6) var(--s8);
    }

    .header-content {
        padding: var(--s3) var(--s6);
    }

    .list-row {
        padding: var(--s3) var(--s4);
    }

    .row-thumb {
        width: 56px;
        height: 56px;
    }

    .row-title {
        font-size: 16px;
    }

    .row-subtitle {
        font-size: 13px;
    }

    .auth-container {
        max-width: 420px;
    }

    .theme-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }

    .dropdown-menu {
        /* positioned dynamically by JS relative to + button */
    }
}

/* Large desktop */
@media (min-width: 1024px) {
    .modal-sheet {
        max-width: 560px;
    }

    .header-content {
        padding: var(--s4) var(--s7);
    }

    #main-content {
        padding: var(--s4) var(--s7) var(--s8);
    }
}

/* Small mobile adjustments */
@media (max-width: 380px) {
    .filter-tab {
        padding: var(--s2) var(--s2);
        font-size: 12px;
    }

    .header-title {
        font-size: 18px;
    }

    .row-thumb {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }

    .row-title {
        font-size: 14px;
    }

    .row-subtitle {
        font-size: 11px;
    }

    .theme-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--s2);
    }

    .option-row {
        flex-direction: column;
    }

    .modal-body {
        padding: var(--s3);
    }
}

/* Safe area insets for notched phones */
@supports (padding: env(safe-area-inset-bottom)) {
    .modal-sheet {
        padding-bottom: env(safe-area-inset-bottom);
    }

    #main-content {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }
}

/* Hover-capable devices: show edit hints */
@media (hover: hover) {
    .section-edit {
        opacity: 0;
        transition: opacity 0.2s;
    }

    .section-header:hover .section-edit {
        opacity: 0.5;
    }

    .sub-room-actions {
        opacity: 0;
        transition: opacity 0.2s;
    }

    .sub-room-group.expanded:hover .sub-room-actions {
        opacity: 1;
    }
}

/* Touch devices: always show edit cues */
@media (hover: none) {
    .section-edit {
        opacity: 0.4;
    }
}

/* Reduce motion preference */
@media (prefers-reduced-motion: reduce) {
    .modal-sheet {
        animation: none;
    }

    .modal-backdrop {
        animation: none;
    }

    * {
        transition-duration: 0.01ms !important;
    }
}
