/* SokoGo E-Commerce System - Responsive Design Stylesheet */
/* Color Scheme: Green (#28a745), White (#ffffff), Black (#000000) */

/* Mobile First Approach - Base styles are for mobile */

/* Small devices (phones, 576px and up) */
@media (min-width: 576px) {
    .container {
        padding: 0 20px;
    }

    .hero-slider {
        height: 350px;
    }

    .slide h1 {
        font-size: 32px;
    }

    .slide p {
        font-size: 16px;
    }

    .products-grid,
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
    .container {
        padding: 0 25px;
    }

    .hero-slider {
        height: 400px;
    }

    .slide h1 {
        font-size: 36px;
    }

    .slide p {
        font-size: 18px;
    }

    .products-grid,
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .footer .container {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Admin responsive adjustments */
    .admin-sidebar {
        position: fixed;
        height: 100vh;
    }

    .admin-main {
        margin-left: 250px;
    }

    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large devices (desktops, 992px and up) */
@media (min-width: 992px) {
    .container {
        max-width: 1200px;
        padding: 0 30px;
    }

    .hero-slider {
        height: 450px;
    }

    .products-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer .container {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Admin enhancements */
    .dashboard-cards {
        grid-template-columns: repeat(4, 1fr);
    }

    .filter-row {
        grid-template-columns: repeat(4, 1fr);
    }

    .form-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Extra large devices (large desktops, 1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1400px;
    }

    .products-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .categories-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .dashboard-cards {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* Print styles */
@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    a,
    a:visited {
        text-decoration: underline;
    }

    .header,
    .footer,
    .admin-sidebar,
    .admin-header,
    .btn,
    .user-menu,
    .admin-user-menu {
        display: none !important;
    }

    .container {
        max-width: none !important;
        padding: 0 !important;
    }

    .product-card,
    .card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .table {
        border-collapse: collapse;
    }

    .table th,
    .table td {
        border: 1px solid #000;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn {
        border: 2px solid currentColor;
    }

    .card,
    .product-card {
        border: 2px solid #000;
    }

    .alert {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .slider-container {
        transition: none;
    }

    .product-card,
    .category-card {
        transition: none;
    }
}

/* Dark mode support (if needed in future) */
@media (prefers-color-scheme: dark) {
    /* These styles would be applied if dark mode is implemented */
    body {
        background-color: #1a1a1a;
        color: #ffffff;
    }

    .card,
    .product-card {
        background-color: #2d2d2d;
        color: #ffffff;
    }

    .table thead {
        background-color: #2d2d2d;
    }

    .table tbody tr:hover {
        background-color: #3d3d3d;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    .product-card:hover,
    .category-card:hover {
        transform: none;
    }

    .btn:hover {
        background-color: #28a745;
    }

    /* Larger touch targets for mobile */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-menu a,
    .cart-icon,
    .user-menu-toggle {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
}

/* Landscape orientation for mobile */
@media screen and (max-height: 500px) and (orientation: landscape) {
    .hero-slider {
        height: 250px;
    }

    .slide-content {
        padding: 15px;
    }

    .slide h1 {
        font-size: 24px;
    }

    .slide p {
        font-size: 14px;
    }
}

/* Focus visible for accessibility */
.btn:focus-visible,
.form-group input:focus-visible,
.form-group textarea:focus-visible,
.form-group select:focus-visible {
    outline: 2px solid #28a745;
    outline-offset: 2px;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 6px;
}
