/* Responsive Design - HDU Inventory Management System */

/* Large Desktop (1200px and up) */
@media (min-width: 1200px) {
    .content-wrapper {
        padding: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .action-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* Desktop (992px to 1199px) */
@media (max-width: 1199px) {
    .search-container {
        width: 300px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .action-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Tablet (768px to 991px) */
@media (max-width: 991px) {
    :root {
        --sidebar-width: 250px;
    }
    
    .navbar {
        padding: 0 1.5rem;
    }
    
    .navbar-center {
        flex: 1;
        justify-content: center;
    }
    
    .search-container {
        width: 250px;
    }
    
    .content-wrapper {
        padding: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .action-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .page-title {
        font-size: var(--font-size-2xl);
    }
    
    .dropdown-menu {
        min-width: 200px;
    }
    
    /* Hide some navbar items on tablet */
    .breadcrumb {
        display: none;
    }
}

/* Mobile Large (576px to 767px) */
@media (max-width: 767px) {
    .sidebar {
        transform: translateX(-100%);
        width: 280px;
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .navbar {
        padding: 0 1rem;
    }
    
    .navbar-center {
        display: none;
    }
    
    .navbar-right {
        gap: 0.5rem;
    }
    
    .user-name-small {
        display: none;
    }
    
    .content-wrapper {
        padding: 1rem;
    }
    
    .page-header {
        margin-bottom: 1.5rem;
    }
    
    .page-title {
        font-size: var(--font-size-xl);
    }
    
    .page-subtitle {
        font-size: var(--font-size-base);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.25rem;
    }
    
    .stat-number {
        font-size: var(--font-size-xl);
    }
    
    .action-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .action-card {
        padding: 1rem;
    }
    
    .action-card i {
        font-size: 1.5rem;
    }
    
    .recent-activity {
        padding: 1rem;
    }
    
    .activity-item {
        padding: 0.75rem;
    }
    
    .activity-icon {
        width: 35px;
        height: 35px;
        font-size: 0.875rem;
    }
    
    .footer {
        padding: 1rem;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .footer-right {
        justify-content: center;
    }
    
    /* Dropdown adjustments for mobile */
    .dropdown-menu {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .notification-dropdown,
    .user-dropdown {
        min-width: 100%;
    }
    
    /* User profile in sidebar adjustments */
    .user-profile {
        padding: 1rem;
    }
    
    .user-avatar {
        width: 40px;
        height: 40px;
        font-size: 1.25rem;
    }
    
    .user-info h4 {
        font-size: var(--font-size-sm);
    }
    
    .user-role {
        font-size: var(--font-size-xs);
    }
    
    /* Navigation adjustments */
    .nav-link {
        padding: 0.75rem 1rem;
    }
    
    .submenu li a {
        padding: 0.5rem 1rem 0.5rem 2.5rem;
    }
}

/* Mobile Small (up to 575px) */
@media (max-width: 575px) {
    .navbar {
        padding: 0 0.75rem;
    }
    
    .content-wrapper {
        padding: 0.75rem;
    }
    
    .page-title {
        font-size: var(--font-size-lg);
    }
    
    .page-subtitle {
        font-size: var(--font-size-sm);
    }
    
    .stats-grid {
        gap: 0.75rem;
    }
    
    .stat-card {
        padding: 0.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.75rem;
    }
    
    .stat-icon {
        width: 45px;
        height: 45px;
        font-size: 1.125rem;
    }
    
    .action-grid {
        grid-template-columns: 1fr;
    }
    
    .action-card {
        padding: 1rem;
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
    
    .action-card i {
        font-size: 1.25rem;
    }
    
    .recent-activity {
        padding: 0.75rem;
    }
    
    .section-title {
        font-size: var(--font-size-lg);
    }
    
    .activity-item {
        padding: 0.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .activity-icon {
        width: 30px;
        height: 30px;
        font-size: 0.75rem;
    }
    
    /* Sidebar adjustments for very small screens */
    .sidebar {
        width: 100%;
    }
    
    .sidebar-header {
        padding: 1rem 0.75rem;
    }
    
    .logo {
        font-size: var(--font-size-lg);
    }
    
    .user-profile {
        padding: 0.75rem;
    }
    
    .nav-link {
        padding: 0.75rem;
        font-size: var(--font-size-sm);
    }
    
    .nav-text {
        font-size: var(--font-size-sm);
    }
    
    .sidebar-footer {
        padding: 0.75rem;
    }
    
    .logout-btn {
        padding: 0.75rem;
        font-size: var(--font-size-sm);
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }
    
    .user-profile {
        padding: 0.75rem;
    }
    
    .nav-link {
        padding: 0.5rem 1rem;
    }
    
    .sidebar-footer {
        position: relative;
        margin-top: 1rem;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .navbar,
    .footer,
    .mobile-menu-toggle,
    .sidebar-toggle,
    .notification-btn,
    .quick-action-btn,
    .user-menu-btn,
    .search-container,
    .quick-actions,
    .loading-spinner,
    .alert {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
    }
    
    .content-wrapper {
        padding: 0 !important;
    }
    
    .page-header {
        margin-bottom: 1rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .stat-card {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    .recent-activity {
        box-shadow: none;
        border: 1px solid var(--gray-300);
    }
    
    body {
        background: white;
        color: black;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --gray-50: #ffffff;
        --gray-100: #f0f0f0;
        --gray-200: #d0d0d0;
        --gray-300: #b0b0b0;
        --gray-400: #808080;
        --gray-500: #606060;
        --gray-600: #404040;
        --gray-700: #202020;
        --gray-800: #101010;
        --gray-900: #000000;
    }
    
    .sidebar {
        border-right: 2px solid var(--gray-800);
    }
    
    .navbar {
        border-bottom: 2px solid var(--gray-800);
    }
    
    .stat-card,
    .action-card,
    .recent-activity {
        border: 2px solid var(--gray-300);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .spinner {
        animation: none;
    }
    
    .loading-spinner {
        display: none;
    }
}

/* Dark mode support (for future implementation) */
@media (prefers-color-scheme: dark) {
    /* Dark mode styles can be added here in the future */
}

/* Focus styles for accessibility */
@media (any-hover: none) {
    .nav-link:focus,
    .dropdown-item:focus,
    .action-card:focus,
    .search-input:focus,
    .notification-btn:focus,
    .quick-action-btn:focus,
    .user-menu-btn:focus {
        outline: 2px solid var(--primary-color);
        outline-offset: 2px;
    }
}

/* Hover effects only for devices that support hover */
@media (hover: hover) {
    .stat-card:hover,
    .action-card:hover {
        transform: translateY(-2px);
    }
    
    .nav-link:hover,
    .dropdown-item:hover {
        background-color: var(--gray-50);
    }
}

/* Touch-friendly adjustments */
@media (any-pointer: coarse) {
    .nav-link,
    .dropdown-item,
    .notification-btn,
    .quick-action-btn,
    .user-menu-btn {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .search-input {
        min-height: 44px;
        padding: 0.75rem 1rem;
    }
    
    .action-card {
        min-height: 80px;
    }
}

/* Container queries for modern browsers */
@supports (container-type: inline-size) {
    .stats-grid {
        container-type: inline-size;
    }
    
    @container (max-width: 600px) {
        .stats-grid {
            grid-template-columns: 1fr;
        }
    }
    
    @container (min-width: 601px) and (max-width: 900px) {
        .stats-grid {
            grid-template-columns: repeat(2, 1fr);
        }
    }
    
    @container (min-width: 901px) {
        .stats-grid {
            grid-template-columns: repeat(4, 1fr);
        }
    }
}