/* Fluent UI Dark Theme Customizations */
:root {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --bg-tertiary: #3a3a3a;
    --bg-card: #252525;
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --app-accent: #22D3EE;
}

html, body {
    font-family: 'Segoe UI', 'Segoe UI Web (West European)', -apple-system, BlinkMacSystemFont, Roboto, 'Helvetica Neue', sans-serif;
    background-color: #1a1a1a !important;
    color: #e0e0e0 !important;
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Force FluentUI components to dark mode */
fluent-design-system-provider,
fluent-card,
fluent-text-field,
fluent-text-area,
fluent-select,
fluent-number-field,
fluent-time-picker,
fluent-button,
fluent-data-grid {
    --accent-fill-rest: #22D3EE;
    --accent-fill-hover: #67E8F9;
    --accent-fill-active: #06B6D4;
    --accent-foreground-rest: #22D3EE;
    --accent-stroke-control-rest: #22D3EE;
    --neutral-layer-1: #1a1a1a;
    --neutral-layer-2: #2d2d2d;
    --neutral-layer-3: #3a3a3a;
    --neutral-layer-4: #4a4a4a;
    --neutral-fill-rest: #3a3a3a;
    --neutral-fill-hover: #4a4a4a;
    --neutral-fill-active: #4a4a4a;
    --neutral-fill-input-rest: #3a3a3a;
    --neutral-fill-input-hover: #4a4a4a;
    --neutral-fill-secondary: #3a3a3a;
    --neutral-foreground-rest: #e0e0e0;
    --neutral-stroke-rest: #404040;
}

/* Force all cards to have dark background */
fluent-card {
    background-color: #2d2d2d !important;
    border: 1px solid #404040 !important;
    padding: 16px;
}

/* FluentUI overrides for better spacing */
.main {
    width: 100vw;
    min-height: calc(100vh - 48px);
    min-width: 0;
    overflow: hidden;
}

.app-sidebar {
    box-sizing: border-box;
    width: 250px;
    min-width: 220px;
    max-width: 420px;
    flex: 0 0 auto;
    scrollbar-width: thin;
    position: relative;
    z-index: 2;
}

.app-sidebar * {
    box-sizing: border-box;
    max-width: 100%;
}

.sidebar-user {
    min-width: 0;
    width: 100%;
}

.sidebar-resizer {
    position: absolute;
    top: 0;
    right: 0;
    width: 10px;
    height: 100vh;
    background: transparent;
    cursor: col-resize;
    touch-action: none;
    z-index: 3;
}

.sidebar-resizer::before {
    content: "";
    display: block;
    width: 2px;
    height: 100%;
    margin-left: auto;
    margin-right: 0;
    background: #404040;
}

.sidebar-resizer:hover,
body.sidebar-resizing .sidebar-resizer {
    background: transparent;
}

.sidebar-resizer:hover::before,
body.sidebar-resizing .sidebar-resizer::before {
    background: var(--app-accent, #22D3EE);
}

.sidebar-live-data-button::part(control) {
    background: #20252b;
    border-color: #374151;
}

.sidebar-live-data-button:hover::part(control) {
    background: #25303a;
}

.sidebar-live-data-button--active::part(control),
.sidebar-live-data-button--active:hover::part(control),
.sidebar-live-data-button--active:focus-visible::part(control) {
    background: var(--app-accent, #22D3EE);
    border-color: var(--app-accent, #22D3EE);
    color: #0f172a;
}

body.sidebar-resizing {
    cursor: col-resize;
    user-select: none;
}

.app-main-content {
    box-sizing: border-box;
    width: auto;
    min-width: 0;
    max-width: 100%;
}

/* Custom scrollbar */
::-webkit-scrollbar {
width: 12px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
  background: #4a4a4a;
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: #5a5a5a;
}

/* Ensure good contrast for ordered lists */
ol {
    color: #e0e0e0;
}

ol li {
    margin-bottom: 8px;
}

/* Validation */
.validation-message {
    color: #ff6b6b;
}

/* Blazor Error Boundary */
.blazor-error-boundary {
    background: #d32f2f;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

#blazor-error-ui {
    background: #2d2d2d;
    border-top: 2px solid #d32f2f;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.5);
  display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
    color: #e0e0e0;
}

#blazor-error-ui .dismiss {
 cursor: pointer;
    position: absolute;
    right: 0.75rem;
 top: 0.5rem;
    color: #e0e0e0;
}

/* Ensure FluentCard has proper spacing */
fluent-card {
  padding: 16px;
}

/* Responsive table container */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-search-input {
    box-sizing: border-box;
    width: 100%;
    max-width: 320px;
    min-height: 32px;
    border: 1px solid var(--neutral-stroke-rest);
    border-radius: 4px;
    background: var(--neutral-fill-input-rest);
    color: var(--neutral-foreground-rest);
    padding: 4px 8px;
    font: inherit;
}

.table-search-input:focus {
    border-color: var(--accent-fill-rest);
    outline: none;
}

.table-search-input::placeholder {
    color: var(--text-secondary);
}

.asset-upload-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.asset-upload-preview {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border: 1px solid #404040;
    border-radius: 6px;
    background: #202020;
    padding: 6px;
}

.table-asset-images {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    max-height: 36px;
    overflow: hidden;
}

.table-asset-image {
    display: block;
    width: 36px !important;
    height: 36px !important;
    max-width: 36px !important;
    max-height: 36px !important;
    object-fit: contain !important;
    flex: 0 0 36px;
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 0;
}

.team-name-full {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}
.connection-recovery-card {
    max-width: 380px;
    padding: 24px;
    border: 1px solid #404040;
    border-radius: 8px;
    background: #252525;
    color: #f0f0f0;
    text-align: center;
}

#connection-recovery:not([hidden]) {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgb(0 0 0 / 60%);
}

.connection-recovery-card button {
    padding: 8px 16px;
    border: 1px solid #666;
    border-radius: 4px;
    background: #333;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
