/* ========================================
   RESPONSIVE CSS FOR LICENSE PLATE MANAGEMENT SYSTEM
   ======================================== */

/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --mobile-breakpoint: 600px;
    --tablet-breakpoint: 960px;
    --desktop-breakpoint: 1280px;
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
}

/* ========================================
   RESPONSIVE TYPOGRAPHY
   ======================================== */

/* Responsive headings */
.responsive-title {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.responsive-subtitle {
    font-size: clamp(0.875rem, 2vw, 1.125rem);
}

/* ========================================
   RESPONSIVE CONTAINERS
   ======================================== */

/* Table scroll container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive::-webkit-scrollbar {
    height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ========================================
   RESPONSIVE IMAGES
   ======================================== */

/* Images in tables */
.responsive-table-image {
    width: 100%;
    max-width: 200px;
    height: auto;
    min-width: 80px;
    object-fit: cover;
    border-radius: 8px;
}

/* General responsive images */
.responsive-image {
    max-width: 100%;
    height: auto;
}

/* ========================================
   RESPONSIVE VISIBILITY CLASSES
   ======================================== */

/* Hide on mobile */
@media (max-width: 600px) {
    .hide-on-mobile {
        display: none !important;
    }
}

/* Hide on tablet */
@media (min-width: 601px) and (max-width: 960px) {
    .hide-on-tablet {
        display: none !important;
    }
}

/* Hide on desktop */
@media (min-width: 961px) {
    .hide-on-desktop {
        display: none !important;
    }
}

/* Show only on mobile */
@media (min-width: 601px) {
    .show-only-mobile {
        display: none !important;
    }
}

/* Show only on desktop */
@media (max-width: 960px) {
    .show-only-desktop {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE APPBAR
   ======================================== */

.responsive-appbar {
    padding: var(--spacing-sm) var(--spacing-md);
}

@media (max-width: 600px) {
    .responsive-appbar {
        padding: var(--spacing-xs) var(--spacing-sm);
    }

    .responsive-appbar .mud-typography-h4 {
        font-size: 1rem !important;
    }

    .responsive-appbar .mud-avatar {
        width: 32px !important;
        height: 32px !important;
    }

    .responsive-appbar .mud-chip {
        display: none;
    }
}

@media (max-width: 400px) {
    .responsive-appbar .mud-typography-h4 {
        font-size: 0.875rem !important;
        max-width: 150px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* ========================================
   RESPONSIVE NAVIGATION
   ======================================== */

.responsive-nav {
    width: 100%;
    max-width: 280px;
}

@media (max-width: 600px) {
    .responsive-nav {
        max-width: 100vw;
    }

    .responsive-nav .mud-typography-h6 {
        font-size: 0.9rem;
        padding: var(--spacing-sm) !important;
    }

    .responsive-nav .mud-nav-link {
        font-size: 0.875rem;
        padding: var(--spacing-sm) var(--spacing-md) !important;
    }
}

/* ========================================
   RESPONSIVE TABLES (MudTable)
   ======================================== */

@media (max-width: 960px) {
    /* Make table cells stack on mobile */
    .mud-table-container {
        overflow-x: auto;
    }

    .mud-table .mud-table-cell {
        padding: var(--spacing-sm) !important;
    }

    .mud-table .mud-table-cell img {
        max-width: 120px !important;
        height: auto !important;
    }
}

@media (max-width: 600px) {
    .mud-table .mud-table-cell {
        padding: var(--spacing-xs) !important;
        font-size: 0.8rem;
    }

    .mud-table .mud-table-cell img {
        max-width: 80px !important;
    }

    .mud-table-head .mud-table-cell {
        font-size: 0.75rem !important;
    }

    /* Hide less important columns on mobile */
    .mud-table .hide-on-mobile-table {
        display: none !important;
    }
}

/* ========================================
   RESPONSIVE CARDS (MudCard)
   ======================================== */

@media (max-width: 600px) {
    .mud-card {
        margin: var(--spacing-xs) 0;
    }

    .mud-card-header {
        padding: var(--spacing-sm) !important;
    }

    .mud-card-content {
        padding: var(--spacing-sm) !important;
    }

    .mud-card .mud-icon-size-large {
        font-size: 1.5rem !important;
    }

    .mud-card .mud-typography-h5 {
        font-size: 1.125rem !important;
    }

    .mud-card .mud-typography-h6 {
        font-size: 1rem !important;
    }
}

/* ========================================
   RESPONSIVE FORMS
   ======================================== */

@media (max-width: 600px) {
    .mud-input-control {
        margin-bottom: var(--spacing-sm) !important;
    }

    .mud-select, .mud-input {
        font-size: 0.9rem !important;
    }

    .form-responsive .mud-grid-item {
        padding: var(--spacing-xs) !important;
    }
}

/* ========================================
   RESPONSIVE DIALOGS
   ======================================== */

@media (max-width: 600px) {
    .mud-dialog {
        margin: var(--spacing-sm) !important;
        max-height: 95vh !important;
    }

    .mud-dialog-content {
        padding: var(--spacing-md) !important;
    }

    .mud-dialog-actions {
        padding: var(--spacing-sm) !important;
        flex-wrap: wrap;
        gap: var(--spacing-xs);
    }

    .mud-dialog-actions .mud-button {
        flex: 1 1 auto;
        min-width: 100px;
    }
}

/* ========================================
   RESPONSIVE GRID OVERRIDE
   ======================================== */

@media (max-width: 600px) {
    .full-width-mobile {
        width: 100% !important;
        flex-basis: 100% !important;
        max-width: 100% !important;
    }
}

/* ========================================
   RESPONSIVE PADDING & MARGIN UTILITIES
   ======================================== */

@media (max-width: 600px) {
    .pa-4-mobile {
        padding: var(--spacing-md) !important;
    }

    .pa-2-mobile {
        padding: var(--spacing-sm) !important;
    }

    .ma-0-mobile {
        margin: 0 !important;
    }

    .mt-2-mobile {
        margin-top: var(--spacing-sm) !important;
    }
}

/* ========================================
   RESPONSIVE BUTTON GROUPS
   ======================================== */

@media (max-width: 600px) {
    .mud-button-group {
        flex-wrap: wrap;
    }

    .button-stack-mobile {
        flex-direction: column !important;
        width: 100%;
    }

    .button-stack-mobile .mud-button {
        width: 100%;
        margin-bottom: var(--spacing-xs);
    }
}

/* ========================================
   RESPONSIVE DASHBOARD SUMMARY CARDS
   ======================================== */

.dashboard-card-responsive {
    transition: all 0.3s ease;
}

@media (max-width: 600px) {
    .dashboard-card-responsive .mud-card-header {
        flex-direction: column;
        text-align: center;
    }

    .dashboard-card-responsive .mud-card-header-avatar {
        margin-bottom: var(--spacing-sm);
    }
}

/* ========================================
   RESPONSIVE PAGER
   ======================================== */

@media (max-width: 600px) {
    .mud-table-pagination {
        flex-wrap: wrap;
        justify-content: center;
        padding: var(--spacing-sm) !important;
    }

    .mud-table-pagination .mud-table-pagination-select {
        margin: var(--spacing-xs);
    }

    .mud-table-pagination .mud-table-pagination-actions {
        margin-top: var(--spacing-sm);
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .no-print {
        display: none !important;
    }

    .mud-drawer,
    .mud-appbar {
        display: none !important;
    }

    .mud-main-content {
        margin: 0 !important;
        padding: 0 !important;
    }
}
