/* User grid layout */
.user-grid {
    // Default: ID, Username, Email, Contact, Role, Status, Details (7 columns)
    grid-template-columns: 60px 2fr 2fr 1.5fr 1fr 1fr 80px;

    @media (max-width: 1023px) { // lg breakpoint - hide contact and role
        grid-template-columns: 60px 2fr 2fr 1fr 80px;
    }

    @media (max-width: 767px) { // md breakpoint - hide ID
        grid-template-columns: 2fr 2fr 1fr 80px;
    }

    @media (max-width: 639px) { // sm breakpoint - hide email and status
        grid-template-columns: 1fr 80px;
    }
}

/* Material form field customizations */
.fuse-mat-dense {
    .mat-mdc-form-field-subscript-wrapper {
        display: none;
    }

    .mat-mdc-form-field-infix {
        min-height: 40px;
    }
}

.fuse-mat-rounded {
    .mat-mdc-form-field-flex {
        border-radius: 20px;
        background-color: rgba(0, 0, 0, 0.04);
        border: none;
    }

    &.mat-focused .mat-mdc-form-field-flex {
        background-color: rgba(0, 0, 0, 0.06);
    }
}

/* Icon size utilities */
.icon-size-5 {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

.icon-size-4 {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* Custom button styles */
.mat-mdc-button {
    &.mat-primary {
        --mdc-text-button-label-text-color: #1976d2;
    }
}

.mat-mdc-raised-button {
    &.mat-primary {
        --mdc-protected-button-container-color: #1976d2;
        --mdc-protected-button-label-text-color: #ffffff;
    }
}

/* Avatar styles */
.user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
}

/* Status badge styles */
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    
    &.active {
        background-color: #dcfce7;
        color: #166534;
    }
    
    &.inactive {
        background-color: #f3f4f6;
        color: #374151;
    }
}

/* Role badge styles */
.role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;

    &.admin {
        background-color: #fef2f2;
        color: #991b1b;
        border: 1px solid #fecaca;
    }

    &.vendor {
        background-color: #eff6ff;
        color: #1e40af;
        border: 1px solid #bfdbfe;
    }

    &.reseller {
        background-color: #f0fdf4;
        color: #166534;
        border: 1px solid #bbf7d0;
    }

    &.refiller {
        background-color: #fffbeb;
        color: #92400e;
        border: 1px solid #fed7aa;
    }
}

/* Form section styles */
.form-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);

    h3 {
        margin: 0 0 16px 0;
        font-size: 18px;
        font-weight: 600;
        color: #1f2937;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .form-section {
        background: #1f2937;
        color: #f9fafb;

        h3 {
            color: #f9fafb;
        }
    }

    .fuse-mat-rounded .mat-mdc-form-field-flex {
        background-color: rgba(255, 255, 255, 0.06);
    }

    .fuse-mat-rounded.mat-focused .mat-mdc-form-field-flex {
        background-color: rgba(255, 255, 255, 0.08);
    }
}

/* Loading states */
.loading-overlay {
    position: relative;
    
    &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(255, 255, 255, 0.8);
        z-index: 10;
        pointer-events: none;
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
    }

    &.loading::after {
        opacity: 1;
        pointer-events: all;
    }
}

/* Flash message animations */
.flash-message {
    transition: all 0.3s ease-in-out;
    
    &.fade-enter {
        opacity: 0;
        transform: translateY(-10px);
    }
    
    &.fade-enter-active {
        opacity: 1;
        transform: translateY(0);
    }
    
    &.fade-exit {
        opacity: 1;
        transform: translateY(0);
    }
    
    &.fade-exit-active {
        opacity: 0;
        transform: translateY(-10px);
    }
}

/* Responsive table adjustments */
@media (max-width: 768px) {
    .user-grid {
        gap: 8px;
        padding: 12px 16px;
    }

    .form-section {
        padding: 16px;
        margin-bottom: 12px;
    }
}

/* Custom scrollbar for better UX */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Focus states for accessibility */
.mat-mdc-form-field.mat-focused .mat-mdc-form-field-flex {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .role-badge,
    .status-badge {
        border-width: 2px;
    }
    
    .mat-mdc-button {
        border: 1px solid currentColor;
    }
}
/* Additional styles for user.component.scss */

/* File upload section styles */
.document-upload-zone {
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    
    &:hover {
        border-color: #4299e1;
        background-color: #ebf8ff;
    }
}

/* Photo/Logo upload containers */
.upload-container {
    position: relative;
    
    .upload-overlay {
        position: absolute;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(0, 0, 0, 0.5);
        opacity: 0;
        transition: opacity 0.2s ease-in-out;
        cursor: pointer;
        
        &:hover {
            opacity: 1;
        }
    }
}

/* Document list styles */
.document-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background-color: #f7fafc;
    border-radius: 8px;
    margin-bottom: 8px;
    transition: background-color 0.2s ease;
    
    &:hover {
        background-color: #edf2f7;
    }
    
    .document-info {
        display: flex;
        align-items: center;
        flex: 1;
        
        mat-icon {
            margin-right: 12px;
            color: #4a5568;
        }
        
        .document-name {
            font-size: 14px;
            font-weight: 500;
            color: #2d3748;
        }
        
        .document-meta {
            font-size: 12px;
            color: #718096;
            margin-top: 2px;
        }
    }
    
    .document-actions {
        display: flex;
        gap: 8px;
    }
}

/* New document indicator */
.new-document {
    background-color: #ebf8ff;
    border-left: 4px solid #4299e1;
    
    &:hover {
        background-color: #bee3f8;
    }
}

/* User ID badge */
.user-id-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Form section headers */
.section-header {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
    
    h3 {
        margin: 0;
        font-size: 18px;
        font-weight: 600;
        color: #2d3748;
    }
    
    mat-icon {
        margin-right: 8px;
        color: #4299e1;
    }
}

/* Photo preview container */
.photo-preview-container {
    position: relative;
    width: 128px;
    height: 128px;
    
    img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
    }
    
    .photo-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-radius: 50%;
        color: white;
        font-size: 48px;
        font-weight: 600;
        text-transform: uppercase;
    }
}

/* Logo preview container */
.logo-preview-container {
    position: relative;
    width: 96px;
    height: 96px;
    border: 2px dashed #cbd5e0;
    border-radius: 8px;
    background-color: #f7fafc;
    
    img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        padding: 8px;
    }
    
    .logo-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        color: #a0aec0;
    }
}

/* Status toggle enhanced styles */
.status-toggle-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px;
    background-color: #f7fafc;
    border-radius: 8px;
    
    .status-label {
        font-size: 14px;
        font-weight: 600;
        color: #2d3748;
        margin-bottom: 4px;
    }
    
    mat-slide-toggle {
        margin-top: 4px;
    }
}

/* Animate file upload */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.document-list-item {
    animation: slideInUp 0.3s ease-out;
}

/* Loading state for images */
.image-loading {
    position: relative;
    
    &::after {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
        background-size: 200% 100%;
        animation: loading 1.5s infinite;
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* File type icons */
.file-icon {
    &.pdf { color: #e53e3e; }
    &.doc, &.docx { color: #3182ce; }
    &.jpg, &.jpeg, &.png { color: #38a169; }
    &.default { color: #718096; }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .photo-preview-container {
        width: 96px;
        height: 96px;
        
        .photo-placeholder {
            font-size: 36px;
        }
    }
    
    .logo-preview-container {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 768px) {
    .document-list-item {
        flex-direction: column;
        align-items: flex-start;
        
        .document-actions {
            margin-top: 8px;
            width: 100%;
            justify-content: flex-end;
        }
    }
}

/* Dark mode support for new elements */
@media (prefers-color-scheme: dark) {
    .document-list-item {
        background-color: #2d3748;
        
        &:hover {
            background-color: #4a5568;
        }
        
        .document-name {
            color: #e2e8f0;
        }
        
        .document-meta {
            color: #a0aec0;
        }
    }
    
    .new-document {
        background-color: #2c5282;
        border-left-color: #63b3ed;
    }
    
    .status-toggle-container {
        background-color: #2d3748;
        
        .status-label {
            color: #e2e8f0;
        }
    }
    
    .user-id-badge {
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    }
}
.doc-type-badge {
    &.aadhar { background: #fef2f2; color: #991b1b; }
    &.pan { background: #eff6ff; color: #1e40af; }
    &.gst { background: #f0fdf4; color: #166534; }
    &.msme { background: #fefce8; color: #854d0e; }
    &.fssai { background: #fef3c7; color: #92400e; }
    &.other { background: #f3f4f6; color: #374151; }
}