﻿/* ==========================================================================
   RESPONSIVE VARIANT CATEGORIES PAGE
   ========================================================================== */

/* Header responsiveness */
.responsive-header {
    flex-wrap: wrap;
    gap: 10px;
}


/* Button responsiveness */
.responsive-create-btn .mobile-text {
    display: none;
}

.responsive-create-btn .desktop-text {
    display: inline;
}

/* Table responsiveness */
.responsive-table {
    font-size: 0.875rem;
}

.table-title {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

.language-info {
    font-size: 0.75rem !important;
    color: #666 !important;
}

/* Filter inputs */
.filter-input, .filter-select {
    min-width: 120px !important;
}

/* Table cells */
.name-content {
    min-width: 150px;
}

.category-name {
    font-weight: 600 !important;
    color: #333 !important;
}

.mobile-localized {
    margin-top: 4px;
    padding-top: 4px;
    border-top: 1px solid #f0f0f0;
}

.localized-text {
    font-size: 0.7rem !important;
    color: #666 !important;
    margin-bottom: 2px !important;
}

.status-chip {
    font-size: 0.75rem !important;
}

.action-btn {
    min-width: 32px !important;
    height: 32px !important;
}

/* Mobile specific styles */
@media (max-width: 768px) {
  
    .responsive-create-btn {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        min-width: auto !important;
    }

        .responsive-create-btn .desktop-text {
            display: none;
        }

        .responsive-create-btn .mobile-text {
            display: inline;
        }

    .table-title {
        font-size: 1rem !important;
    }

    /* Make table more compact on mobile */
    .mud-table-dense .mud-table-row .mud-table-cell {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
    }

    .name-column {
        min-width: 140px !important;
    }

    .status-column {
        width: 80px !important;
    }

    .actions-column {
        width: 80px !important;
    }

    .filter-input {
        min-width: 100px !important;
        font-size: 0.8rem !important;
    }

    .filter-select {
        min-width: 80px !important;
        font-size: 0.8rem !important;
    }

    /* Stack header on very small screens */
    .responsive-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .responsive-create-btn {
        align-self: flex-end;
    }

    /* ADD THE NEW MOBILE FILTER STYLES HERE - INSIDE THE EXISTING @media (max-width: 768px) BLOCK */

    /* Mobile filter card */
    .mobile-filters-card {
        margin-bottom: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

        .mobile-filters-card .mud-input {
            font-size: 0.875rem;
        }

        .mobile-filters-card .mud-select {
            font-size: 0.875rem;
        }

    /* Ensure table header filters are hidden on mobile */
    .mud-table-head .mud-input,
    .mud-table-head .mud-select {
        display: none !important;
    }

    /* Hide sorting dropdowns */
    .mud-table-head .mud-table-sort-label {
        display: none !important;
    }

    .mud-table-head .mud-button {
        display: none !important;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
  

    .responsive-create-btn {
        padding: 6px 10px !important;
        font-size: 0.75rem !important;
    }

    .mud-table-dense .mud-table-row .mud-table-cell {
        padding: 6px 2px !important;
        font-size: 0.75rem !important;
    }

    .category-name {
        font-size: 0.8rem !important;
    }

    .localized-text {
        font-size: 0.65rem !important;
    }

    .action-btn {
        min-width: 28px !important;
        height: 28px !important;
    }
}

/* Hide elements on mobile using MudBlazor classes */
@media (max-width: 959px) {
    .d-none.d-md-block,
    .d-none.d-md-table-cell {
        display: none !important;
    }
}

@media (max-width: 1279px) {
    .d-none.d-lg-table-cell {
        display: none !important;
    }
}


/* Desktop - hide mobile filters */
@media (min-width: 769px) {
    .mobile-filters-card {
        display: none !important;
    }
}
/* Mobile specific styles */
@media (max-width: 768px) {

    .responsive-create-btn {
        padding: 8px 12px !important;
        font-size: 0.8rem !important;
        min-width: auto !important;
    }

        .responsive-create-btn .desktop-text {
            display: none;
        }

        .responsive-create-btn .mobile-text {
            display: inline;
        }

    .table-title {
        font-size: 1rem !important;
    }

    /* Make table more compact on mobile */
    .mud-table-dense .mud-table-row .mud-table-cell {
        padding: 8px 4px !important;
        font-size: 0.8rem !important;
    }

    .name-column {
        min-width: 140px !important;
    }

    .status-column {
        width: 80px !important;
    }

    .actions-column {
        width: 80px !important;
    }

    .filter-input {
        min-width: 100px !important;
        font-size: 0.8rem !important;
    }

    .filter-select {
        min-width: 80px !important;
        font-size: 0.8rem !important;
    }

    /* Stack header on very small screens */
    .responsive-header {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .responsive-create-btn {
        align-self: flex-end;
    }

    /* Mobile filter card */
    .mobile-filters-card {
        margin-bottom: 16px;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

        .mobile-filters-card .mud-input {
            font-size: 0.875rem;
        }

        .mobile-filters-card .mud-select {
            font-size: 0.875rem;
        }

    /* AGGRESSIVE HIDING OF TABLE HEADER ELEMENTS ON MOBILE */
    .mud-table-head .mud-input,
    .mud-table-head .mud-select {
        display: none !important;
    }

    .mud-table-head .mud-table-sort-label {
        display: none !important;
    }

    .mud-table-head .mud-button {
        display: none !important;
    }

    /* Hide MudBlazor's automatic mobile table controls */
    .mud-table .mud-table-toolbar-content > div:last-child {
        display: none !important;
    }

    /* Hide any dropdown controls that MudBlazor adds automatically */
    .mud-table .mud-select,
    .mud-table .mud-menu {
        display: none !important;
    }

    /* Hide the entire toolbar on mobile if it contains unwanted elements */
    .responsive-table .mud-toolbar > *:not(.d-block) {
        display: none !important;
    }

    /* Ensure only our custom mobile content shows */
    .responsive-table .mud-toolbar .d-block.d-sm-none {
        display: block !important;
    }
}
/* ==========================================================================
   DIALOG/MODAL FIXES FOR MOBILE
   ========================================================================== */

/* Fix modal dialog positioning on mobile */
@media (max-width: 768px) {
    /* Ensure dialogs appear above everything else on mobile */
    .mud-dialog-container {
        z-index: 1500 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        padding: 10px !important;
    }

    .mud-dialog {
        z-index: 1501 !important;
        margin-top: 60px !important; /* Adjust based on your app bar height */
        max-height: calc(100vh - 120px) !important;
        overflow-y: auto !important;
        border-radius: 8px !important;
        box-shadow: 0 8px 32px rgba(0,0,0,0.3) !important;
    }

    .mud-dialog-title {
        position: sticky !important;
        top: 0 !important;
        z-index: 1502 !important;
        background: white !important;
        border-bottom: 1px solid #e0e0e0 !important;
        padding: 16px !important;
    }

    .mud-dialog-content {
        max-height: calc(100vh - 200px) !important;
        overflow-y: auto !important;
        padding: 16px !important;
    }

    .mud-dialog-actions {
        position: sticky !important;
        bottom: 0 !important;
        background: white !important;
        border-top: 1px solid #e0e0e0 !important;
        padding: 16px !important;
        z-index: 1502 !important;
    }

    /* Make sure the backdrop/overlay is properly positioned */

}

/* Adjust app bar z-index to ensure dialogs appear above it */
.mud-appbar.mud-appbar-fixed-top {
    z-index: 1400 !important; /* Lower than dialog */
}

/* Ensure drawer doesn't interfere with dialogs on mobile */
@media (max-width: 768px) {
    .mud-drawer {
        z-index: 1300 !important; /* Lower than dialog */
    }
}

.actions-cell {
    text-align: right;
    white-space: nowrap;
}
.language-info {
    font-size: 0.65rem;
    color: #666;
}
.actionsright {
    text-align: right;
}