/* Place custom styles for MFMud here. */
body {
    font-family: 'Roboto', 'Segoe UI', Arial, sans-serif;
    margin: 0;
}

/* Product Image Thumbnails - Hover Zoom Effect */
.product-image-card {
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
    z-index: 1;
}

.product-image-card:not(.marked-for-deletion):hover {
    transform: scale(1.5);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3) !important;
    z-index: 100;
    transition: transform 0.3s ease, box-shadow 0.3s ease, z-index 0s 0s;
}

/* Marked for deletion state */
.product-image-card.marked-for-deletion {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-image-card.marked-for-deletion::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(244, 67, 54, 0.1);
    pointer-events: none;
    z-index: 1;
}

/* Rotating animation for code generation icon */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.generating-code .mud-input-adornment-end svg {
    animation: rotate 1s linear infinite;
}

.deletion-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    pointer-events: none;
    background: rgba(244, 67, 54, 0.95);
    padding: 6px 12px;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.compact-panel .mud-collapse-container,
.compact-panel .mud-collapse-wrapper,
.compact-panel .mud-collapse-wrapper-inner {
    overflow: visible !important;
}

.compact-panel .mud-expand-panel-content {
    padding: 8px 8px !important;
    overflow: visible !important;
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .product-image-card:not(.marked-for-deletion):hover {
        transform: scale(1.3);
    }
}

/* Global Row Selection Styles */
.mud-table-row.selected-row,
tr.selected-row {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.12) !important;
    border-left: 4px solid var(--mud-palette-primary) !important;
    font-weight: 500;
}

.mud-table-row.disabled-row,
tr.disabled-row {
    opacity: 0.5;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.11764705882352941)
}

.mud-table-row.selected-row:hover,
tr.selected-row:hover {
    background-color: rgba(var(--mud-palette-primary-rgb), 0.18) !important;
}

/* Custom Layout Background & Drawer Transparency */
/* These rules ONLY apply in light mode (scoped to .light-theme) */

.light-theme.mud-layout {
    background-color: transparent !important;
}

/* On mobile/small screens, the drawer overlays content - use semi-transparent background */
@media (max-width: 959.98px) {
    .light-theme .responsive-drawer {
        background-color: rgba(255, 255, 255, 0.95) !important;
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}

/* On desktop, drawer is usually docked - make transparent to see background image */
@media (min-width: 960px) {
    .light-theme .responsive-drawer {
        background-color: transparent !important;
        background: transparent !important;
        --mud-palette-drawer-background: transparent !important;
        --mud-palette-surface: transparent !important;
    }

    .light-theme .responsive-drawer.mud-drawer-fixed,
    .light-theme .responsive-drawer.mud-drawer-clipped {
        background-color: transparent !important;
    }

    .light-theme .responsive-drawer .mud-drawer-content {
        background-color: transparent !important;
    }
}

/* Ensure NavMenu itself is transparent in light mode */
.light-theme .responsive-drawer .mud-nav-menu,
.light-theme .responsive-drawer .mud-nav-item,
.light-theme .responsive-drawer .mud-nav-link,
.light-theme .responsive-drawer .mud-nav-group {
    background-color: transparent !important;
}

/* Ensure Main Content is transparent in light mode */
.light-theme .layout-content {
    background-color: transparent !important;
}

/* Sales page - Force error (red) border on customer autocomplete when no customer is selected.
   The .customer-error class is on a wrapper div around the MudAutocomplete component. */
.customer-error .mud-input-outlined-border {
    border-color: var(--mud-palette-error) !important;
}

.customer-error fieldset {
    border-color: var(--mud-palette-error) !important;
}

.customer-error .mud-input-label {
    color: var(--mud-palette-error) !important;
}