/* Fluent UI Component Style Overrides for StockCraft Branding */

/* FluentCard Enhancements */
fluent-card,
.fluent-card {
    box-shadow: var(--brand-card-shadow);
    border-radius: var(--brand-border-radius);
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    border: 1px solid var(--border-color);
}

fluent-card:hover,
.fluent-card:hover {
    box-shadow: var(--brand-card-hover-shadow);
}

fluent-card.hover-lift:hover {
    transform: translateY(-2px);
}

/* FluentButton Accent Override */
fluent-button[appearance="accent"],
.fluent-button-accent {
    background: var(--brand-gradient);
    border: none !important;
    outline: none !important;
    color: white;
    font-weight: 600;
    border-radius: var(--brand-border-radius-sm);
    padding: 0.75rem 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

fluent-button[appearance="accent"]::part(control),
.fluent-button-accent::part(control) {
    border: none !important;
    outline: none !important;
    box-shadow: none;
}

fluent-button[appearance="accent"]:hover,
.fluent-button-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

fluent-button[appearance="accent"]:active,
.fluent-button-accent:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

fluent-button[appearance="accent"]:focus,
fluent-button[appearance="accent"]:focus-visible {
    outline: none !important;
    border: none !important;
}

/* FluentButton Outline */
fluent-button[appearance="outline"] {
    border: 2px solid var(--brand-primary);
    color: var(--brand-primary);
    font-weight: 600;
    border-radius: var(--brand-border-radius-sm);
    padding: 0.75rem 1.5rem;
    transition: all 0.2s ease;
    background: transparent;
}

fluent-button[appearance="outline"]:hover {
    background: var(--brand-primary);
    color: white;
}

fluent-button[appearance="outline"]:focus,
fluent-button[appearance="outline"]:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* FluentButton Lightweight/Link */
fluent-button[appearance="lightweight"],
fluent-button[appearance="stealth"] {
    color: var(--brand-primary);
    transition: color 0.2s ease, background 0.2s ease;
    background: transparent;
    border: none;
}

fluent-button[appearance="lightweight"]:hover,
fluent-button[appearance="stealth"]:hover {
    background: rgba(102, 126, 234, 0.1);
}

fluent-button[appearance="lightweight"]:focus,
fluent-button[appearance="lightweight"]:focus-visible,
fluent-button[appearance="stealth"]:focus,
fluent-button[appearance="stealth"]:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Remove default focus ring from Fluent buttons */
fluent-button:focus-visible {
    outline: none;
}

fluent-button:focus:not(:focus-visible) {
    outline: none;
}

/* Specifically remove focus styling from accent buttons */
fluent-button[appearance="accent"]:focus,
fluent-button[appearance="accent"]:focus-visible,
fluent-button[appearance="accent"]:focus-within {
    outline: none !important;
    border: none !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1) !important;
}

/* Remove any text decoration and styling artifacts from buttons */
fluent-button::part(control) {
    text-decoration: none;
    background-image: none;
    text-decoration-skip-ink: none;
    border: none;
}

fluent-button::part(content) {
    text-decoration: none;
    background-image: none;
    border: none;
}

fluent-button a {
    text-decoration: none;
}

/* Ensure no default browser styling on button text */
fluent-button {
    text-decoration: none;
    -webkit-text-decoration-skip: none;
    text-decoration-skip-ink: none;
}

/* Remove any borders from all button states */
fluent-button::part(control)::before,
fluent-button::part(control)::after {
    border: none !important;
    outline: none !important;
}

/* Header button overrides */
.app-header fluent-button {
    color: white;
    background: transparent;
}

.app-header fluent-button[appearance="outline"] {
    background: white;
    color: #667eea;
    border: none;
    font-weight: 600;
}

.app-header fluent-button[appearance="outline"]:hover {
    background: rgba(255, 255, 255, 0.9);
    color: #667eea;
}

.app-header fluent-button[appearance="lightweight"] {
    color: white;
}

.app-header fluent-button[appearance="lightweight"]:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* FluentLabel Typography */
fluent-label h1,
fluent-label[typo="h1"] {
    font-weight: 700;
    line-height: var(--brand-line-height-tight);
}

fluent-label h2,
fluent-label[typo="h2"] {
    font-weight: 700;
    line-height: var(--brand-line-height-tight);
}

fluent-label h3,
fluent-label[typo="h3"] {
    font-weight: 600;
    line-height: var(--brand-line-height-tight);
}

fluent-label h4,
fluent-label[typo="h4"] {
    font-weight: 600;
    line-height: var(--brand-line-height-tight);
}

fluent-label h5,
fluent-label[typo="h5"] {
    font-weight: 600;
}

fluent-label h6,
fluent-label[typo="h6"] {
    font-weight: 600;
}

/* FluentHeader Styling */
fluent-header {
    background: var(--brand-gradient);
    color: white;
    box-shadow: var(--brand-header-shadow);
    height: 70px;
    display: flex;
    align-items: center;
}

fluent-header fluent-button {
    color: white;
}

fluent-header fluent-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* FluentDataGrid Enhancements */
fluent-data-grid {
    border: 1px solid var(--border-color);
    border-radius: var(--brand-border-radius);
    overflow: hidden;
}

fluent-data-grid-row:hover {
    background: rgba(102, 126, 234, 0.05);
}

fluent-data-grid-cell {
    padding: 1rem;
}

/* FluentTextField */
fluent-text-field,
fluent-text-area,
fluent-number-field,
fluent-select {
    border-radius: var(--brand-border-radius-sm);
}

fluent-text-field:focus-within,
fluent-text-area:focus-within,
fluent-number-field:focus-within,
fluent-select:focus-within {
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* FluentDialog */
fluent-dialog {
    border-radius: var(--brand-border-radius-lg);
}

fluent-dialog::part(control) {
    border-radius: var(--brand-border-radius-lg);
}

/* FluentStack Spacing */
fluent-stack[orientation="vertical"] {
    gap: var(--brand-spacing-md);
}

fluent-stack[orientation="horizontal"] {
    gap: var(--brand-spacing-md);
}

/* FluentDivider */
fluent-divider {
    border-color: var(--border-color);
}

/* FluentBadge */
fluent-badge {
    border-radius: 20px;
}

/* FluentMenu and Navigation */
fluent-nav-menu {
    padding: var(--brand-spacing-sm);
}

fluent-nav-link {
    border-radius: var(--brand-border-radius-sm);
    margin-bottom: 0.25rem;
    transition: background 0.2s ease, color 0.2s ease;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
}

fluent-nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: var(--brand-primary);
}

fluent-nav-link[active] {
    background: var(--brand-gradient);
    color: white !important;
    font-weight: 600;
}

fluent-nav-link[active]:hover {
    background: var(--brand-gradient);
    color: white !important;
}

/* FluentNavGroup styling */
fluent-nav-group {
    color: var(--text-primary);
}

fluent-nav-group::part(title) {
    color: var(--text-primary);
    font-weight: 600;
}

/* FluentAccordion */
fluent-accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--brand-border-radius-sm);
    margin-bottom: var(--brand-spacing-sm);
}

/* FluentProgress */
fluent-progress {
    --accent-fill-rest: var(--brand-primary);
}

fluent-progress-ring {
    --accent-fill-rest: var(--brand-primary);
}

/* FluentToast */
fluent-toast[appearance="success"] {
    border-left: 4px solid var(--status-success);
}

fluent-toast[appearance="error"] {
    border-left: 4px solid var(--status-error);
}

fluent-toast[appearance="warning"] {
    border-left: 4px solid var(--status-warning);
}

fluent-toast[appearance="info"] {
    border-left: 4px solid var(--status-info);
}

/* FluentCheckbox */
fluent-checkbox::part(control) {
    border-color: var(--brand-primary);
}

fluent-checkbox[checked]::part(control) {
    background: var(--brand-primary);
}

/* FluentSwitch */
fluent-switch::part(switch) {
    background: var(--brand-primary);
}

/* FluentAutocomplete */
fluent-autocomplete {
    border-radius: var(--brand-border-radius-sm);
}

fluent-option:hover {
    background: rgba(102, 126, 234, 0.1);
}

fluent-option[selected] {
    background: rgba(102, 126, 234, 0.2);
    color: var(--brand-primary);
}

/* Feature Card Grid Layout */
.feature-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--brand-spacing-lg);
}

.feature-card {
    padding: var(--brand-spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--brand-border-radius);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.feature-card:hover {
    box-shadow: var(--brand-card-hover-shadow);
}

.feature-card h3 {
    color: var(--brand-primary);
    margin-bottom: var(--brand-spacing-sm);
    font-size: 1.25rem;
}

/* Quick Action Cards */
.quick-action-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--brand-spacing-lg);
    background: var(--bg-primary);
    border-radius: var(--brand-border-radius);
    box-shadow: var(--brand-card-shadow);
    transition: transform 0.2s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.quick-action-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--brand-card-hover-shadow);
}

.quick-action-card-icon {
    font-size: 3rem;
    margin-bottom: var(--brand-spacing-sm);
}

.quick-action-card-title {
    color: var(--brand-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--brand-spacing-sm);
}

.quick-action-card-description {
    color: var(--text-secondary);
    flex: 1;
    margin-bottom: var(--brand-spacing-md);
}

/* Search Bar Component */
.search-bar {
    position: relative;
    width: 100%;
    max-width: 500px;
}

.search-bar fluent-text-field {
    width: 100%;
}

.search-bar-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-hint);
}

/* Filter Chips */
.filter-chips {
    display: flex;
    gap: var(--brand-spacing-sm);
    flex-wrap: wrap;
}

.filter-chip {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.filter-chip:hover {
    border-color: var(--brand-primary);
    background: rgba(102, 126, 234, 0.05);
}

.filter-chip.active {
    background: var(--brand-gradient);
    color: white;
    border-color: transparent;
}

/* Form Layout */
.form-two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--brand-spacing-md);
}

@media (max-width: 768px) {
    .form-two-column {
        grid-template-columns: 1fr;
    }
}

.form-group {
    margin-bottom: var(--brand-spacing-md);
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-hint {
    font-size: 0.875rem;
    color: var(--text-hint);
    margin-top: 0.25rem;
}

.form-error {
    font-size: 0.875rem;
    color: var(--status-error);
    margin-top: 0.25rem;
}

/* Action Buttons Container */
.action-buttons {
    display: flex;
    gap: var(--brand-spacing-sm);
    justify-content: flex-end;
    margin-top: var(--brand-spacing-lg);
}

@media (max-width: 768px) {
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons fluent-button {
        width: 100%;
    }
}

/* Page Header Actions */
.page-header-actions {
    display: flex;
    gap: var(--brand-spacing-sm);
    align-items: center;
}

/* Table Action Icons */
.table-action-icons {
    display: flex;
    gap: 0.5rem;
}

.table-action-icon {
    padding: 0.5rem;
    border-radius: var(--brand-border-radius-sm);
    cursor: pointer;
    transition: background 0.2s ease;
}

.table-action-icon:hover {
    background: rgba(102, 126, 234, 0.1);
}

/* Coming Soon Badge */
.coming-soon-badge {
    background: rgba(102, 126, 234, 0.1);
    color: var(--brand-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

/* Info Cards Grid */
.info-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--brand-spacing-md);
    margin-bottom: var(--brand-spacing-lg);
}

.info-card {
    padding: var(--brand-spacing-md);
    background: var(--bg-primary);
    border-radius: var(--brand-border-radius);
    box-shadow: var(--brand-card-shadow);
    border: 1px solid var(--border-color);
}

.info-card-label {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.info-card-value {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 600;
}

/* Responsive Grid */
.responsive-grid {
    display: grid;
    gap: var(--brand-spacing-md);
}

.responsive-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.responsive-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.responsive-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 1024px) {
    .responsive-grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    .responsive-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .responsive-grid-2,
    .responsive-grid-3,
    .responsive-grid-4 {
        grid-template-columns: 1fr;
    }
}

