@import url('open-iconic/font/css/open-iconic-bootstrap.min.css');

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800;900&display=swap');

/* Modern Color Palette */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --dark-bg: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
}

html, body {
    font-family: 'Vazirmatn', 'Tahoma', 'Arial', sans-serif;
    direction: rtl;
    text-align: right;
    background: var(--bg-light);
    color: var(--text-primary);
    line-height: 1.6;
}

* {
    direction: rtl;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

.content {
    padding-top: 1.1rem;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

/* Custom Styles for Yektashop */
.nav-link {
    transition: all 0.3s ease;
    border-radius: 8px;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    transform: translateY(-2px);
}

.footer-link:hover {
    color: white !important;
    transform: translateX(-5px);
}

.social-icon:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    transform: scale(1.1);
}

.cart-button {
    position: relative;
}

/* Hero Banner Styles */
.hero-banner {
    position: relative;
    width: 100%;
    margin-bottom: 3rem;
}

.banner-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 20px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

@media (min-width: 600px) {
    .banner-container {
        height: 350px;
    }
}

@media (min-width: 960px) {
    .banner-container {
        height: 450px;
    }
}

.banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.banner-container:hover .banner-image {
    transform: scale(1.05);
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.85) 0%, rgba(118, 75, 162, 0.85) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.banner-content {
    text-align: center;
    max-width: 600px;
    animation: fadeInUp 0.8s ease;
}

.hero-button {
    transition: all 0.3s ease;
}

.hero-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4) !important;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Section Header Styles */
.section-header {
    position: relative;
    margin-bottom: 2rem;
}

.section-title-underline {
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

/* Category Card Styles */
.category-card {
    position: relative;
    overflow: hidden;
}

.category-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.category-gradient-1 {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.category-gradient-2 {
    background: linear-gradient(135deg, rgba(240, 147, 251, 0.1) 0%, rgba(245, 87, 108, 0.1) 100%);
}

.category-gradient-3 {
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
}

.category-gradient-4 {
    background: linear-gradient(135deg, rgba(67, 233, 123, 0.1) 0%, rgba(56, 249, 215, 0.1) 100%);
}

.category-gradient-5 {
    background: linear-gradient(135deg, rgba(250, 112, 154, 0.1) 0%, rgba(254, 225, 64, 0.1) 100%);
}

.category-gradient-6 {
    background: linear-gradient(135deg, rgba(48, 207, 208, 0.1) 0%, rgba(51, 8, 103, 0.1) 100%);
}

.category-card:hover .category-card-overlay {
    opacity: 1;
}

.category-image-wrapper {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 10px;
}

.category-card:hover .category-image {
    transform: scale(1.1);
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover .category-overlay {
    opacity: 1;
}

.category-info {
    position: relative;
    z-index: 1;
}

/* Product Card Styles */
.product-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    transform: translateY(-10px);
}

.product-image-container {
    position: relative;
    overflow: hidden;
    height: 250px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s ease;
    padding: 10px;
}

.product-card:hover .product-image {
    transform: scale(1.1);
}

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .product-overlay {
    opacity: 1;
}

.product-card:hover .quick-view-btn {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.product-badge.in-stock {
    background: rgba(16, 185, 129, 0.9);
    color: white;
}

.product-badge.out-of-stock {
    background: rgba(239, 68, 68, 0.9);
    color: white;
}

.product-info {
    background: white;
}

/* Enhanced Navigation */
.mud-app-bar {
    backdrop-filter: blur(10px);
    background: var(--dark-bg) !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1) !important;
}

.logo-text {
    transition: transform 0.2s ease;
}

.logo-text:hover {
    transform: scale(1.05);
}

/* Improved Footer */
footer {
    background: var(--dark-bg) !important;
    position: relative;
    overflow: hidden;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
}

/* Smooth Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mud-card {
    animation: slideInRight 0.5s ease;
}

/* Loading States */
.mud-progress-linear {
    border-radius: 4px;
    overflow: hidden;
}

/* Responsive Improvements */
@media (max-width: 600px) {
    .banner-content {
        padding: 1rem;
    }
    
    .banner-title {
        font-size: 1.5rem !important;
    }
    
    .banner-subtitle {
        font-size: 0.9rem !important;
    }
}

/* Product Detail Page Styles */
.product-image-wrapper {
    position: relative;
    background: #f8fafc;
    overflow: hidden;
}

.product-detail-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    transition: transform 0.3s ease;
    background: white;
    border-radius: 12px;
}

@media (min-width: 960px) {
    .product-detail-image {
        height: 500px;
    }
}

.product-image-wrapper:hover .product-detail-image {
    transform: scale(1.05);
}

.price-section {
    position: relative;
}

/* Enhanced Paper Styles */
.mud-paper {
    border-radius: 16px !important;
}

/* Better Chip Styles */
.mud-chip {
    border-radius: 20px !important;
    font-weight: 500;
}

/* Improved Alert Styles */
.mud-alert {
    border-radius: 12px !important;
}

/* Better Text Field Styles */
.mud-text-field .mud-input-outlined {
    border-radius: 12px !important;
}

/* Loading Spinner Improvements */
.mud-progress-linear {
    height: 4px;
    border-radius: 2px;
}

/* Gradient backgrounds for cards */
.gradient-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

/* Colorful cards */
.color-card-1 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.color-card-2 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.color-card-3 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.color-card-4 {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
}

.color-card-5 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
}

.color-card-6 {
    background: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    color: white;
}

/* Smooth transitions for interactive elements */
a, button, .mud-card, .mud-button, .mud-paper {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Modern Card Styles */
.mud-card {
    border-radius: 16px !important;
    overflow: hidden;
    border: 1px solid var(--border-color) !important;
    background: white !important;
    box-shadow: var(--card-shadow) !important;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mud-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--card-shadow-hover) !important;
    border-color: rgba(102, 126, 234, 0.3) !important;
}

/* Modern Button Styles */
.mud-button-filled-primary {
    background: var(--primary-gradient) !important;
    box-shadow: 0 4px 14px 0 rgba(102, 126, 234, 0.39) !important;
    border-radius: 12px !important;
    font-weight: 600 !important;
    padding: 12px 24px !important;
    text-transform: none !important;
    letter-spacing: 0.5px;
}

.mud-button-filled-primary:hover {
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5) !important;
    transform: translateY(-2px);
}

.mud-button-text-primary {
    border-radius: 8px !important;
    font-weight: 500 !important;
}

.mud-button-text-primary:hover {
    background: rgba(102, 126, 234, 0.08) !important;
}

/* RTL-friendly dialog styles for admin forms */
.mud-dialog.rtl-dialog {
    max-width: 720px;
    width: 100%;
}

.mud-dialog.rtl-dialog .mud-dialog-content {
    text-align: right;
}

.mud-dialog.rtl-dialog .mud-input-label {
    right: 0;
    left: auto;
    text-align: right;
    transform-origin: top right;
}

.mud-dialog.rtl-dialog .mud-input-root,
.mud-dialog.rtl-dialog .mud-input,
.mud-dialog.rtl-dialog .mud-select {
    text-align: right;
}

/* Remove numeric spinner arrows in RTL dialogs (for supporting browsers) */
.mud-dialog.rtl-dialog input[type="number"]::-webkit-outer-spin-button,
.mud-dialog.rtl-dialog input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mud-dialog.rtl-dialog input[type="number"] {
    -moz-appearance: textfield;
}

/* Category dialog content - scrollable */
.mud-dialog .mud-dialog-content .category-dialog-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.category-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.category-dialog-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.category-dialog-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.category-dialog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Category dialog specific styling */
.category-dialog-form {
    padding: 24px 28px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.05));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: fit-content;
}

.category-dialog-form .mud-typography.mud-typography-caption {
    color: #555;
    font-weight: 500;
    margin-bottom: 6px;
}

.category-dialog-form .mud-input-root,
.category-dialog-form .mud-input,
.category-dialog-form .mud-select {
    border-radius: 10px;
}

.category-dialog-form .mud-text-field {
    margin-bottom: 4px;
}

/* Active switch container - aligned and styled */
.active-switch-container {
    display: flex;
    align-items: center;
    margin: 8px 0 16px 0;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.category-dialog-form .mud-switch {
    margin: 0;
}

/* Image upload input styling */
.image-upload-input {
    padding: 12px;
    border: 2px dashed rgba(102, 126, 234, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s ease;
    cursor: pointer;
}

.image-upload-input:hover {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(102, 126, 234, 0.05);
}

/* Category image preview container - beautiful frame */
.category-image-preview {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(102, 126, 234, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.category-image-preview:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Category preview image - larger and styled */
.category-preview-image {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: contain;
    transition: all 0.3s ease;
}

.category-preview-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Category dialog actions - align buttons to left (right in RTL) - always visible */
.category-dialog-actions {
    display: flex;
    justify-content: flex-start;
    padding: 16px 28px 20px;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    direction: rtl;
    width: 100%;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.mud-dialog-actions {
    padding: 0 !important;
}

.category-dialog-actions .save-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.category-dialog-actions .save-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.category-dialog-actions .save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.category-dialog-actions .cancel-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.category-dialog-actions .cancel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Enhanced dialog container styling - target dialogs containing category-dialog-form */
.mud-dialog-container .mud-dialog:has(.category-dialog-form),
.mud-dialog:has(.category-dialog-form) {
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title,
.mud-dialog:has(.category-dialog-form) .mud-dialog-title {
    padding: 20px 28px 16px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
    border-bottom: 1px solid rgba(102, 126, 234, 0.1);
}

/* Hide close icon SVG from dialog title */
.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title-container .mud-icon-button[aria-label*="close"],
.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title-container .mud-icon-button[aria-label*="Close"],
.mud-dialog:has(.category-dialog-form) .mud-dialog-title .mud-icon-button,
.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title-container button.mud-icon-button {
    display: none !important;
}

/* Alternative: Hide all close buttons in title area for category dialogs */
.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title-container > button:last-child,
.mud-dialog-container .mud-dialog:has(.category-dialog-form) .mud-dialog-title-container > .mud-icon-root {
    display: none !important;
}

/* Fallback for browsers that don't support :has() */
.mud-dialog-container .mud-dialog .category-dialog-form ~ .mud-dialog-title .mud-icon-button,
.mud-dialog-container .mud-dialog .mud-dialog-title-container:has(+ .mud-dialog-content .category-dialog-form) .mud-icon-button {
    display: none !important;
}

/* Delete Category Dialog Styling - Hide close icon from title */
.mud-dialog-container .mud-dialog:has(.delete-category-dialog-content) .mud-dialog-title-container .mud-icon-button,
.mud-dialog-container .mud-dialog:has(.delete-category-dialog-content) .mud-dialog-title-container button.mud-icon-button,
.mud-dialog:has(.delete-category-dialog-content) .mud-dialog-title .mud-icon-button {
    display: none !important;
}

/* Fallback for browsers without :has() support */
.mud-dialog-container .mud-dialog .delete-category-dialog-content ~ .mud-dialog-title .mud-icon-button,
.mud-dialog-container .mud-dialog .mud-dialog-title-container:has(+ .mud-dialog-content .delete-category-dialog-content) .mud-icon-button {
    display: none !important;
}

.mud-dialog .mud-dialog-content .delete-category-dialog-content {
    padding: 32px 40px 24px;
    text-align: center;
}

.delete-category-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    padding: 16px;
    background: rgba(244, 67, 54, 0.1);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    align-items: center;
    justify-content: center;
}

.delete-category-title {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    line-height: 1.6;
}

.delete-category-name-inline {
    font-weight: 600;
    color: #667eea;
    padding: 4px 12px;
    background: rgba(102, 126, 234, 0.15);
    border-radius: 6px;
    display: inline-block;
}

.delete-category-alert {
    text-align: right;
    margin-top: 16px;
    border-radius: 8px;
}

.delete-category-dialog-actions {
    display: flex;
    padding: 16px 40px 24px;
    gap: 12px;
    justify-content: center;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(248, 250, 252, 0.5);
    width: 100%;
}

.delete-category-dialog-actions .cancel-delete-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 500;
}

.delete-category-dialog-actions .confirm-delete-btn {
    min-width: 120px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
    transition: all 0.3s ease;
}

.delete-category-dialog-actions .confirm-delete-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
    transform: translateY(-2px);
}

.delete-category-dialog-actions .confirm-delete-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Product search input styling - similar to category search */
.product-search-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.product-search-wrapper {
    display: flex;
    gap: 48px;
    align-items: center;
    flex-wrap: wrap;
    direction: rtl;
    justify-content: flex-start;
}

.product-search-input {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.product-add-button {
    white-space: nowrap;
    height: 56px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    margin-right: auto;
}

.product-add-button:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.product-search-input .mud-input-root {
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.product-search-input .mud-input-root:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.product-search-input .mud-input-outlined {
    border-color: rgba(0, 0, 0, 0.1);
    border-width: 1px;
    transition: all 0.3s ease;
}

.product-search-input .mud-input-outlined:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.product-search-input .mud-input-outlined.mud-input-outlined-focused {
    border-color: rgba(0, 0, 0, 0.3);
    border-width: 1px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.product-search-input .mud-input {
    padding: 14px 16px;
    font-size: 1rem;
}

.product-search-input .mud-input-label {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.product-search-input .mud-input-label.mud-input-label-shrink {
    color: rgba(0, 0, 0, 0.8);
    font-weight: 600;
}

.product-search-input .mud-input-adornment {
    background: white;
    border-radius: 0 12px 12px 0;
    padding: 0 8px;
}

.product-search-input .mud-icon-button {
    color: rgba(0, 0, 0, 0.6);
}

.product-search-input .mud-icon-button:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.08);
}

/* Products table styling */
.products-table-container {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.products-table {
    border-radius: 12px;
}

.products-table .mud-table-head {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
}

.products-table .mud-table-head .mud-table-cell {
    font-weight: 600;
    color: #1e293b;
    padding: 16px;
    text-align: center;
}

.products-table .mud-table-body .mud-table-row {
    transition: all 0.2s ease;
}

.products-table .mud-table-body .mud-table-row:hover {
    background: rgba(102, 126, 234, 0.03);
    transform: scale(1.01);
}

.products-table .mud-table-body .mud-table-cell {
    padding: 16px;
    vertical-align: middle;
    text-align: center;
}

.products-table .mud-table-body .mud-table-cell .mud-text,
.products-table .mud-table-body .mud-table-cell .mud-chip {
    display: inline-block;
}

.product-image-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.product-actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-start;
}

.product-actions-cell .mud-icon-button {
    transition: all 0.2s ease;
}

.product-actions-cell .mud-icon-button:hover {
    transform: scale(1.1);
}

/* Status column styling */
.status-toggle-button {
    font-weight: 500;
    min-width: auto;
    padding: 4px 12px;
}

.status-toggle-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Product dialog styling - similar to category dialog */
.mud-dialog .mud-dialog-content .product-dialog-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.product-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.product-dialog-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.product-dialog-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.product-dialog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* Product dialog form styling */
.product-dialog-form {
    padding: 24px 28px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.05));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: fit-content;
}

.product-dialog-form .mud-typography.mud-typography-caption {
    color: #555;
    font-weight: 500;
    margin-bottom: 6px;
}

.product-dialog-form .mud-input-root,
.product-dialog-form .mud-input,
.product-dialog-form .mud-select {
    border-radius: 10px;
}

.product-dialog-form .mud-text-field,
.product-dialog-form .mud-numeric-field,
.product-dialog-form .mud-select {
    margin-bottom: 4px;
}

.product-dialog-form .mud-switch {
    margin-top: 8px;
}

/* Remove spinner arrows from numeric fields in product dialog */
.product-dialog-form input[type="number"]::-webkit-outer-spin-button,
.product-dialog-form input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.product-dialog-form input[type="number"] {
    -moz-appearance: textfield;
}

/* User search input styling */
.user-search-wrapper {
    display: flex;
    gap: 48px;
    align-items: center;
    flex-wrap: wrap;
    direction: rtl;
    justify-content: flex-start;
}

.user-search-input {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.user-search-input .mud-input-root {
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.user-search-input .mud-input-root:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.user-search-input .mud-input-outlined {
    border-color: rgba(0, 0, 0, 0.1);
    border-width: 1px;
    transition: all 0.3s ease;
}

.user-search-input .mud-input-outlined:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.user-search-input .mud-input-outlined.mud-input-outlined-focused {
    border-color: rgba(0, 0, 0, 0.3);
    border-width: 1px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.user-search-input .mud-input {
    padding: 14px 16px;
    font-size: 1rem;
}

.user-search-input .mud-input-label {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.user-search-input .mud-input-label.mud-input-label-shrink {
    color: rgba(0, 0, 0, 0.8);
    font-weight: 600;
}

.user-search-input .mud-input-adornment {
    background: white;
    border-radius: 0 12px 12px 0;
    padding: 0 8px;
}

.user-search-input .mud-icon-button {
    color: rgba(0, 0, 0, 0.6);
}

.user-search-input .mud-icon-button:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.08);
}

/* Users table styling */
.users-table-container {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.users-table {
    border-radius: 12px;
}

.users-table .mud-table-head {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.08));
}

.users-table .mud-table-head .mud-table-cell {
    font-weight: 600;
    color: #1e293b;
    padding: 16px;
    text-align: center;
}

.users-table .mud-table-body .mud-table-row {
    transition: all 0.2s ease;
}

.users-table .mud-table-body .mud-table-row:hover {
    background: rgba(102, 126, 234, 0.03);
    transform: scale(1.01);
}

.users-table .mud-table-body .mud-table-cell {
    padding: 16px;
    vertical-align: middle;
    text-align: center;
}

.users-table .mud-table-body .mud-table-cell .mud-text,
.users-table .mud-table-body .mud-table-cell .mud-chip {
    display: inline-block;
}

.user-actions-cell {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}

.role-toggle-button {
    font-weight: 500;
    min-width: auto;
    padding: 4px 12px;
    white-space: nowrap;
}

.role-toggle-button:hover {
    background: rgba(0, 0, 0, 0.05);
}

.user-add-button {
    white-space: nowrap;
    height: 56px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    margin-right: auto;
}

.user-add-button:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

/* User dialog styling - similar to category and product dialogs */
.mud-dialog .mud-dialog-content .user-dialog-content {
    max-height: 60vh;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
}

.user-dialog-content::-webkit-scrollbar {
    width: 8px;
}

.user-dialog-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.user-dialog-content::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.3);
    border-radius: 10px;
}

.user-dialog-content::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.5);
}

/* User dialog form styling */
.user-dialog-form {
    padding: 24px 28px 20px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.05));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: fit-content;
}

.user-dialog-form .mud-typography.mud-typography-caption {
    color: #555;
    font-weight: 500;
    margin-bottom: 6px;
}

.user-dialog-form .mud-input-root,
.user-dialog-form .mud-input,
.user-dialog-form .mud-select {
    border-radius: 10px;
}

.user-dialog-form .mud-text-field,
.user-dialog-form .mud-select {
    margin-bottom: 4px;
}

.user-dialog-form .mud-switch {
    margin-top: 8px;
}

/* User dialog actions */
.user-dialog-actions {
    display: flex;
    justify-content: flex-start;
    padding: 16px 28px 20px;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    direction: rtl;
    width: 100%;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.user-dialog-actions .save-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.user-dialog-actions .save-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.user-dialog-actions .save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.user-dialog-actions .cancel-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.user-dialog-actions .cancel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Delete user dialog content */
.mud-dialog .mud-dialog-content .delete-user-dialog-content {
    padding: 32px 40px 24px;
    text-align: center;
}

/* Product image preview container - beautiful frame */
.product-image-preview {
    margin-top: 12px;
    padding: 16px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.9));
    border-radius: 16px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(102, 126, 234, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.product-image-preview:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 6px 16px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

/* Product preview image - larger and styled */
.product-preview-image {
    max-width: 100%;
    max-height: 250px;
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    object-fit: contain;
    transition: all 0.3s ease;
}

.product-preview-image:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

/* Product dialog actions - align buttons to left (right in RTL) - always visible */
.product-dialog-actions {
    display: flex;
    justify-content: flex-start;
    padding: 16px 28px 20px;
    gap: 12px;
    background: rgba(255, 255, 255, 0.95);
    border-top: 1px solid rgba(102, 126, 234, 0.1);
    direction: rtl;
    width: 100%;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
}

.product-dialog-actions .save-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.product-dialog-actions .save-btn:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.product-dialog-actions .save-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.product-dialog-actions .cancel-btn {
    min-width: 100px;
    height: 40px;
    border-radius: 10px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.product-dialog-actions .cancel-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Use active-switch-container for product dialog too */
.product-dialog-form .active-switch-container {
    display: flex;
    align-items: center;
    margin: 8px 0 16px 0;
    padding: 12px 16px;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.product-dialog-form .mud-switch {
    margin: 0;
}

/* Category card image container */
.category-image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.category-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 8px;
    transition: transform 0.3s ease;
    padding: 10px;
}

.category-card-image:hover {
    transform: scale(1.05);
}

/* When no image, show placeholder with icon */
.category-image-container:has(img[src*="product-placeholder"]) {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
}

.category-image-container img[src*="product-placeholder"] {
    object-fit: contain;
    padding: 20px;
    opacity: 0.6;
    max-width: 80%;
    max-height: 80%;
}

/* Fallback for browsers without :has() support */
.category-image-container img[src="/images/product-placeholder.svg"] {
    object-fit: contain;
    padding: 20px;
    opacity: 0.6;
    max-width: 80%;
    max-height: 80%;
}

/* Category search input styling */
.category-search-container {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.category-search-wrapper {
    display: flex;
    gap: 48px;
    align-items: center;
    flex-wrap: wrap;
    direction: rtl;
    justify-content: flex-start;
}

.category-search-input {
    flex: 1;
    min-width: 300px;
    max-width: 600px;
}

.category-add-button {
    margin-left: 0;
    margin-right: auto;
}

.category-add-button {
    white-space: nowrap;
    height: 56px;
    border-radius: 12px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.category-add-button:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
}

.category-search-input .mud-input-root {
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.category-search-input .mud-input-root:hover {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.1);
}

.category-search-input .mud-input-outlined {
    border-color: rgba(0, 0, 0, 0.1);
    border-width: 1px;
    transition: all 0.3s ease;
}

.category-search-input .mud-input-outlined:hover {
    border-color: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.05);
}

.category-search-input .mud-input-outlined.mud-input-outlined-focused {
    border-color: rgba(0, 0, 0, 0.3);
    border-width: 1px;
    box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.08);
}

.category-search-input .mud-input {
    padding: 14px 16px;
    font-size: 1rem;
}

.category-search-input .mud-input-label {
    color: rgba(0, 0, 0, 0.6);
    font-weight: 500;
}

.category-search-input .mud-input-label.mud-input-label-shrink {
    color: rgba(0, 0, 0, 0.8);
    font-weight: 600;
}

.category-search-input .mud-input-adornment {
    background: white;
    border-radius: 0 12px 12px 0;
    padding: 0 8px;
}

.category-search-input .mud-icon-button {
    color: rgba(0, 0, 0, 0.6);
}

.category-search-input .mud-icon-button:hover {
    color: rgba(0, 0, 0, 0.8);
    background: rgba(0, 0, 0, 0.08);
}

/* Category card actions styling */
.category-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 12px 16px !important;
    justify-content: flex-start;
    align-items: center;
}

/* Group delete and status buttons together without gap */
.action-buttons-group {
    display: flex;
    gap: 0;
    margin-right: auto;
    border-radius: 4px;
    overflow: hidden;
}

.action-buttons-group .delete-btn {
    margin: 0;
    border-radius: 0;
    border-left: none;
}

.action-buttons-group .delete-btn:not(:first-child) {
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.action-buttons-group .status-toggle-btn {
    margin: 0;
    border-radius: 0;
    font-weight: 500;
    border-left: 1px solid rgba(0, 0, 0, 0.12);
}

.category-card-actions .status-toggle-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}