/* Responsive Design and Mobile Optimizations */

/* Tablet and smaller desktops (1024px and below) */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        padding: 1rem;
    }

    .hero {
        min-height: 80vh;
        padding: 4rem 0;
    }

    .hero h1 {
        font-size: clamp(2rem, 6vw, 3rem);
    }

    .feature-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-section {
        padding: 1.5rem;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .users-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .modal {
        width: 90%;
        max-width: 600px;
    }
}

/* Tablets (768px and below) */
@media (max-width: 768px) {
    nav {
        padding: 0.75rem 0;
    }

    nav .container {
        padding: 0.5rem 1rem;
    }

    nav h2 {
        font-size: 1.25rem;
    }

    .nav-buttons {
        gap: 0.5rem;
    }

    .nav-buttons .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .hero {
        text-align: center;
        padding: 3rem 0;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .section-header {
        flex-direction: column;
        gap: 1rem;
    }

    .section-actions {
        flex-direction: column;
        width: 100%;
    }

    .search-box {
        width: 100%;
    }

    .search-box input {
        width: 100%;
    }

    select {
        width: 100%;
    }

    .users-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .user-card {
        padding: 1.25rem;
    }

    .user-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .user-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .user-actions .btn {
        width: 100%;
    }

    .feature {
        padding: 1.5rem;
    }

    .modal {
        padding: 1.25rem;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .modal-actions .btn {
        width: 100%;
    }
}

/* Mobile Landscape (576px and below) */
@media (max-width: 576px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-item span {
        font-size: 1.25rem;
    }

    .admin-form {
        padding: 1rem;
    }

    .admin-form .form-group {
        margin-bottom: 1rem;
    }

    .admin-form label {
        font-size: 0.85rem;
    }

    .admin-form input,
    .admin-form textarea,
    .admin-form select {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
}

/* Mobile Portrait (375px and below) */
@media (max-width: 375px) {
    .hero h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .user-header h3 {
        font-size: 1rem;
    }

    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.75rem;
    }
}

/* Height-based Media Queries */
@media (max-height: 700px) {
    .hero {
        min-height: auto;
        padding: 5rem 0;
    }

    .modal {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets for better accessibility */
    .btn,
    .nav-buttons .btn,
    select,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects that might cause issues on touch devices */
    .btn:hover,
    .user-card:hover,
    .feature:hover,
    .admin-card:hover {
        transform: none;
    }

    /* Adjust scrolling behavior for touch devices */
    .modal-content,
    .users-grid {
        -webkit-overflow-scrolling: touch;
    }
}

/* Dark Mode Optimizations */
@media (prefers-color-scheme: dark) {
    .search-box input,
    select,
    textarea {
        background: rgba(0, 0, 0, 0.2);
    }

    .stat-item {
        background: rgba(0, 0, 0, 0.2);
    }
}

/* Print Styles */
@media print {
    .nav-buttons,
    .user-actions,
    .modal-overlay,
    .search-box,
    select {
        display: none !important;
    }

    .container {
        width: 100%;
        padding: 0;
    }

    .user-card,
    .admin-card,
    .feature {
        break-inside: avoid;
        page-break-inside: avoid;
        border: 1px solid #ccc;
        box-shadow: none;
        background: none;
    }

    body {
        background: none;
        color: #000;
    }

    a {
        text-decoration: none;
        color: #000;
    }

    .status-badge,
    .stat-item {
        border: 1px solid #ccc;
        background: none !important;
        color: #000 !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --glass-bg: rgba(0, 0, 0, 0.9);
        --glass-border: rgba(255, 255, 255, 0.2);
    }

    .btn,
    .status-badge,
    .stat-item {
        border-width: 2px;
    }

    .user-card,
    .admin-card,
    .feature {
        border-width: 2px;
        backdrop-filter: none;
    }
}

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

    .user-card:hover,
    .feature:hover,
    .admin-card:hover,
    .btn:hover {
        transform: none;
    }
} 