/* Responsive Design */

/* Tablet */
@media (max-width: 1024px) {
    .main {
        padding: 1.5rem;
    }
    
    .view-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .view-header h2 {
        font-size: 1.8rem;
    }
    
    .shopping-controls {
        width: 100%;
        justify-content: flex-start;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
        text-align: center;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .nav {
        flex-wrap: wrap;
    }
    
    .nav-btn {
        flex: 1;
        min-width: 120px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .main {
        padding: 1rem;
    }
    
    .view-header {
        margin-bottom: 1.5rem;
    }
    
    .view-header h2 {
        font-size: 1.6rem;
    }
    
    .list-item {
        padding: 1rem;
    }
    
    .item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .item-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .item-actions .btn {
        flex: 1;
        min-width: 80px;
        font-size: 0.9rem;
        padding: 0.5rem 0.75rem;
    }
    
    .item-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .shopping-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .shopping-controls .btn {
        width: 100%;
    }
    
    .btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .btn-small {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    /* Shopping Mode Mobile */
    #shopping-mode-view .list-item {
        padding: 1rem;
    }
    
    #shopping-mode-view .item-name {
        font-size: 1.1rem;
    }
    
    /* Missing Items Indicator Mobile */
    .missing-indicator {
        bottom: 10px;
        right: 10px;
        left: 10px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    /* Notifications Mobile */
    .notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 1rem;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .header h1 {
        font-size: 1.3rem;
    }
    
    .nav-btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.8rem;
    }
    
    .main {
        padding: 0.75rem;
    }
    
    .view-header h2 {
        font-size: 1.4rem;
    }
    
    .list-item {
        padding: 0.75rem;
    }
    
    .item-name {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.6rem 0.8rem;
        font-size: 0.8rem;
    }
    
    .empty-state {
        padding: 2rem 1rem;
    }
    
    .empty-state h3 {
        font-size: 1.3rem;
    }
    
    .empty-state p {
        font-size: 1rem;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .header {
        flex-direction: row;
        padding: 0.75rem 1rem;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .main {
        padding: 1rem;
    }
    
    .view-header {
        margin-bottom: 1rem;
    }
    
    .view-header h2 {
        font-size: 1.5rem;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .btn {
        border: 0.5px solid transparent;
    }
    
    .list-item {
        border-left-width: 2px;
    }
}

/* Print Styles */
@media print {
    .header,
    .nav,
    .shopping-controls,
    .item-actions,
    .modal-overlay,
    .missing-indicator,
    .shopping-mode-indicator {
        display: none !important;
    }
    
    .main {
        padding: 0;
    }
    
    .list-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
        margin-bottom: 1rem;
    }
    
    .view-header h2 {
        color: #000;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }
    
    .list-item {
        background: #2a2a2a;
        color: #e0e0e0;
    }
    
    /* Preserve glass look for modals in dark mode */
    .modal {
        background: var(--glass-bg);
        color: #e0e0e0;
        border: 1px solid var(--glass-border);
        backdrop-filter: blur(var(--glass-blur));
        -webkit-backdrop-filter: blur(var(--glass-blur));
    }
    
    .modal-header {
        background: #333;
        border-bottom-color: #444;
    }
    
    .form-group input,
    .form-group textarea,
    .form-group select {
        background: #333;
        border-color: #555;
        color: #e0e0e0;
    }
    
    .form-group input:focus,
    .form-group textarea:focus,
    .form-group select:focus {
        border-color: var(--primary-color);
    }
}
