/* ============================================
   ADMIN RESPONSIVE STYLESHEET
   ============================================ */

/* Base responsive utilities */
.table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0.5rem;
}

.responsive-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Mobile First - 480px and below */
@media (max-width: 480px) {
    .admin-container {
        padding: 60px 0.5rem 2rem !important;
    }

    .page-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }

    .page-header h1 {
        font-size: 1.5rem !important;
    }

    .btn, .btn-primary, .btn-secondary, .btn-action {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.75rem 1rem !important;
    }

    .action-buttons {
        flex-direction: column !important;
        width: 100% !important;
    }

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

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .search-form {
        flex-direction: column !important;
        gap: 0.75rem !important;
    }

    .search-form input,
    .search-form select,
    .search-form button {
        width: 100% !important;
    }

    /* Hide less important table columns on mobile */
    .hide-mobile {
        display: none !important;
    }

    /* Table responsive adjustments */
    .users-table td,
    .users-table th {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
    }

    .badge {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
    }

    /* Form inputs */
    .form-group input,
    .form-group textarea,
    .form-group select {
        font-size: 16px !important; /* Prevent iOS zoom */
    }

    /* Modal adjustments */
    .modal-content {
        width: 95% !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
    }

    /* Cards */
    .card {
        padding: 1rem !important;
    }

    /* User meta info */
    .user-meta {
        flex-direction: column !important;
        gap: 0.5rem !important;
    }

    .user-avatar {
        width: 40px !important;
        height: 40px !important;
        font-size: 1rem !important;
    }
}

/* Tablet - 481px to 768px */
@media (min-width: 481px) and (max-width: 768px) {
    .admin-container {
        padding: 70px 1rem 2rem !important;
    }

    .page-header h1 {
        font-size: 1.75rem !important;
    }

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

    .form-grid {
        grid-template-columns: 1fr !important;
    }

    .hide-tablet {
        display: none !important;
    }

    .users-table td,
    .users-table th {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .action-buttons {
        flex-wrap: wrap !important;
    }
}

/* Small Desktop - 769px to 1024px */
@media (min-width: 769px) and (max-width: 1024px) {
    .admin-container {
        padding: 80px 1.5rem 2rem !important;
    }

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

    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)) !important;
    }
}

/* Large screens - 1025px and above */
@media (min-width: 1025px) {
    .stats-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .responsive-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    }
}

/* Utility classes */
.flex-wrap-mobile {
    flex-wrap: wrap;
}

.gap-mobile {
    gap: 0.5rem;
}

/* Word break for long content */
.word-break {
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Scrollbar styling for overflow containers */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive text sizes */
@media (max-width: 480px) {
    .responsive-text {
        font-size: 0.875rem !important;
    }

    .responsive-heading {
        font-size: 1.25rem !important;
    }
}

/* Flex utilities */
.flex-column-mobile {
    display: flex;
}

@media (max-width: 768px) {
    .flex-column-mobile {
        flex-direction: column !important;
    }
}

/* Grid to stack on mobile */
.stack-mobile {
    display: grid;
}

@media (max-width: 768px) {
    .stack-mobile {
        grid-template-columns: 1fr !important;
    }
}
