/* Responsive Design */

/* Tablet Styles */
@media (max-width: 1024px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .sales-container {
        grid-template-columns: 1.5fr 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
    
    .settings-container {
        grid-template-columns: 1fr;
    }
    
    .report-cards {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .logo h1 {
        font-size: 1.5rem;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        width: 250px;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
        padding: 1rem;
    }
    
    .page-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .search-bar {
        margin-left: 0;
        max-width: 100%;
    }
    
    .sales-container {
        grid-template-columns: 1fr;
        height: auto;
        gap: 1rem;
    }
    
    .products-section {
        order: 2;
    }
    
    .cart-section {
        order: 1;
        position: sticky;
        top: 1rem;
        z-index: 100;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        max-height: 400px;
    }
    
    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 0.5rem;
    }
    
    .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    .data-table {
        min-width: 600px;
    }
    
    .modal {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-footer {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-footer button {
        width: 100%;
    }
    
    .payment-options {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .backup-actions {
        flex-direction: column;
    }
    
    .report-cards {
        grid-template-columns: 1fr;
    }
    
    .settings-container {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Navigation */
    .mobile-menu-btn {
        display: block;
        background: none;
        border: none;
        color: white;
        font-size: 1.5rem;
        cursor: pointer;
        padding: 0.5rem;
    }
    
    .nav-menu {
        padding-top: 2rem;
    }
    
    .nav-link {
        padding: 1.2rem 1.5rem;
    }
    
    .nav-icon {
        font-size: 1.4rem;
        margin-right: 1rem;
    }
    
    .nav-text {
        font-size: 1rem;
    }
}

/* Small Mobile Styles */
@media (max-width: 480px) {
    .header {
        padding: 0.8rem;
        height: 60px;
    }
    
    .main-content {
        margin-top: 60px;
        padding: 0.8rem;
    }
    
    .sidebar {
        top: 60px;
        height: calc(100vh - 60px);
    }
    
    .logo h1 {
        font-size: 1.3rem;
    }
    
    .logo span {
        font-size: 0.8rem;
    }
    
    .page-header h2 {
        font-size: 1.5rem;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 0.8rem;
    }
    
    .product-card {
        padding: 0.8rem;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .product-name {
        font-size: 0.85rem;
    }
    
    .product-price {
        font-size: 1rem;
    }
    
    .cart-section {
        padding: 1rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .cart-item-controls {
        align-self: flex-end;
    }
    
    .modal {
        width: 98%;
        margin: 0.5rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-header h3 {
        font-size: 1rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.6rem;
        font-size: 0.9rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.6rem 0.4rem;
        font-size: 0.8rem;
    }
    
    .report-card {
        padding: 1.5rem;
    }
    
    .report-value {
        font-size: 1.5rem;
    }
}

/* Print Styles */
@media print {
    .header,
    .sidebar,
    .page-header,
    .modal-overlay {
        display: none !important;
    }
    
    .main-content {
        margin: 0;
        padding: 0;
    }
    
    .page {
        display: block !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .data-table {
        border-collapse: collapse;
    }
    
    .data-table th,
    .data-table td {
        border: 1px solid #000;
        padding: 0.5rem;
    }
    
    .data-table th {
        background: #f0f0f0 !important;
        color: black !important;
    }
}

/* High DPI Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image,
    .nav-icon {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Landscape Orientation for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .sales-container {
        grid-template-columns: 1.5fr 1fr;
    }
    
    .products-grid {
        max-height: 300px;
    }
    
    .cart-items {
        max-height: 200px;
    }
}

/* Dark Mode Support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here */
}

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

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .nav-link,
    .product-card,
    .cart-item,
    .modal {
        border-width: 2px;
    }
    
    .btn-primary,
    .add-btn,
    .checkout-btn {
        border: 2px solid currentColor;
    }
}

