/* Brand grid layout - NOW 7 COLUMNS WITH CREATED_BY */
.brand-grid {
    // Brand ID, Name, Branch ID, Branch Name, Image, Created By, Actions (7 columns)
    grid-template-columns: 120px 1fr 120px 150px 80px 150px 120px;

    @media (max-width: 1279px) { // xl breakpoint - hide Created By
        grid-template-columns: 120px 1fr 120px 150px 80px 120px;
    }

    @media (max-width: 1023px) { // lg breakpoint - hide branch name
        grid-template-columns: 120px 1fr 120px 80px 120px;
    }

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

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

/* Created By Column Styling */
.brand-grid > div:nth-child(6) {
    display: flex;
    align-items: center;
    gap: 6px;
}

.brand-grid > div:nth-child(6) mat-icon {
    color: #6b7280;
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.brand-grid > div:nth-child(6) span {
    font-size: 13px;
    color: #374151;
}

.dark .brand-grid > div:nth-child(6) mat-icon {
    color: #9ca3af;
}

.dark .brand-grid > div:nth-child(6) span {
    color: #d1d5db;
}

/* 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-8 {
    width: 32px;
    height: 32px;
    font-size: 32px;
}

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

/* Brand image styling */
.brand-image {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.brand-image-placeholder {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f3f4f6;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

/* Image preview styling */
.image-preview-container {
    position: relative;
    
    img {
        border: 2px solid #e5e7eb;
        transition: border-color 0.2s ease;
        
        &:hover {
            border-color: #3b82f6;
        }
    }
}

/* Upload button styling */
.upload-button {
    transition: all 0.2s ease;
    
    &:hover {
        background-color: #f9fafb;
        border-color: #3b82f6;
    }
}

/* Minimal button styles */
mat-icon-button {
    width: 36px;
    height: 36px;
    
    mat-icon {
        transition: all 0.2s ease;
    }
    
    &:hover mat-icon {
        transform: scale(1.1);
    }
}

/* Form field minimal styling */
mat-form-field {
    &.mat-mdc-form-field {
        width: 100%;
    }

    .mat-mdc-text-field-wrapper {
        background-color: #ffffff;
    }
}

/* Brand row hover effect */
.brand-grid > div:not(.sticky):not(.bg-blue-50) {
    transition: background-color 0.15s ease;
}

/* Loading state */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Empty state styling */
.empty-state {
    min-height: 400px;
}

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

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    mat-form-field {
        .mat-mdc-text-field-wrapper {
            background-color: rgba(255, 255, 255, 0.05);
        }
    }

    .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);
    }

    .brand-grid > div:hover {
        background-color: rgba(255, 255, 255, 0.05) !important;
    }
    
    .brand-image,
    .brand-image-placeholder {
        border-color: #374151;
        background-color: #1f2937;
    }
}

/* Custom scrollbar - minimal */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

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

::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

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

/* Clean transitions */
* {
    transition-property: background-color, border-color, color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Pagination styling - minimal */
mat-paginator {
    background-color: transparent;
}

/* Brand ID badge styling */
.font-mono {
    letter-spacing: 0.05em;
}

/* Clean form appearance */
.mat-mdc-form-field-appearance-outline {
    .mat-mdc-form-field-outline {
        color: #e5e7eb;
    }

    &.mat-focused .mat-mdc-form-field-outline {
        color: #3b82f6;
    }
}

/* Minimal hint text */
.mat-mdc-form-field-hint {
    font-size: 12px;
    color: #6b7280;
}

/* Error state - clean */
.mat-mdc-form-field-error {
    font-size: 12px;
}

/* Button height consistency */
.mat-mdc-raised-button,
.mat-mdc-outlined-button {
    height: 40px;
    line-height: 40px;
}

/* Clean dividers */
.border-b {
    border-color: #e5e7eb;
}

.border-t {
    border-color: #e5e7eb;
}

/* Typography - clean hierarchy */
h2 {
    font-weight: 600;
    line-height: 1.2;
}

h3 {
    font-weight: 600;
    line-height: 1.3;
}

/* Minimal shadow on details panel */
.overflow-hidden {
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

/* Clean action button group */
.flex.gap-1 {
    button {
        &:hover {
            background-color: rgba(0, 0, 0, 0.04);
        }
    }
}

/* Smooth hover transitions */
.transition-colors {
    transition-property: background-color, color;
    transition-duration: 200ms;
}

/* Clean badge for brand ID */
.text-blue-600 {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Minimal progress bar */
mat-progress-bar {
    height: 2px;
}

/* Clean tooltip */
.mat-mdc-tooltip {
    font-size: 12px;
    padding: 6px 12px;
}

/* Responsive typography */
@media (max-width: 640px) {
    .text-4xl {
        font-size: 1.875rem;
    }
}

/* Clean focus ring */
button:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Minimal snackbar */
.snackbar-success {
    background-color: #10b981;
}

.snackbar-error {
    background-color: #ef4444;
}

/* Image upload area */
.image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.2s ease;
    
    &:hover {
        border-color: #3b82f6;
        background-color: #eff6ff;
    }
}

/* Preview badge style */
.preview-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    background-color: #eff6ff;
    color: #1e40af;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    font-weight: 600;
}