/* ============================================
   Blazor-Specific Styles
   ============================================ */

/* Loading Container */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-base);
}

.loading-spinner {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
}

.loading-progress {
    width: 100%;
    height: 100%;
}

.loading-progress circle {
    fill: none;
    stroke-width: 3;
    transform-origin: 50% 50%;
}

.loading-progress circle:first-child {
    stroke: var(--border-default);
}

.loading-progress circle:last-child {
    stroke: var(--accent-primary);
    stroke-dasharray: 251.2;
    animation: loading-spin 1.5s linear infinite;
}

@keyframes loading-spin {
    0% {
        stroke-dashoffset: 251.2;
        transform: rotate(0deg);
    }
    50% {
        stroke-dashoffset: 62.8;
        transform: rotate(180deg);
    }
    100% {
        stroke-dashoffset: 251.2;
        transform: rotate(360deg);
    }
}

.loading-text {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Blazor Error UI */
#blazor-error-ui {
    background: var(--status-danger-bg);
    border: 1px solid var(--status-danger);
    border-radius: var(--radius-md);
    bottom: 1rem;
    color: var(--status-danger);
    display: none;
    left: 50%;
    max-width: 400px;
    padding: 1rem 1.25rem;
    position: fixed;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    z-index: 9999;
}

#blazor-error-ui .reload {
    color: var(--status-danger);
    font-weight: 600;
    margin-left: 0.5rem;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
}

/* Loading Overlay for components */
.loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(var(--bg-surface-rgb, 18, 21, 26), 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
}

.loading-overlay .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-default);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Blazor validation styles */
.validation-message {
    color: var(--status-danger);
    font-size: 0.8rem;
    margin-top: 0.35rem;
}

.invalid,
.modified.invalid {
    border-color: var(--status-danger) !important;
}

/* Only show valid state when explicitly using validation and field has been modified */
.modified.valid {
    /* Don't show green border by default - it's distracting */
    /* border-color: var(--status-success) !important; */
}

/* NavLink active styles */
.nav-link.active {
    background: var(--accent-primary-muted) !important;
    color: var(--accent-primary) !important;
}

/* Modal backdrop for Blazor */
.modal-backdrop-custom {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1040;
    animation: fadeIn 0.2s ease;
}

.modal.show-custom {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: fixed;
    inset: 0;
    z-index: 1050;
    animation: fadeIn 0.2s ease;
}

/* Toast notifications */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast-item {
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    box-shadow: var(--shadow-lg);
    animation: slideIn 0.3s ease;
    min-width: 300px;
}

.toast-item.success {
    border-left: 3px solid var(--status-success);
}

.toast-item.error {
    border-left: 3px solid var(--status-danger);
}

.toast-item.warning {
    border-left: 3px solid var(--status-warning);
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Customer Avatar Styles */
.customer-avatar {
    width: 40px;
    height: 40px;
    border-radius: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.7rem;
    flex-shrink: 0;
}

.type-education { background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%); color: white; }
.type-business { background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%); color: white; }
.type-charity { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: white; }
.type-government { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: white; }
.type-academytrust { background: linear-gradient(135deg, #ec4899 0%, #be185d 100%); color: white; }
.type-default { background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%); color: white; }

/* Customer table specific styles */
.customer-row {
    transition: all 0.15s ease;
}

.customer-row:hover {
    background: var(--bg-elevated) !important;
}

.customer-row.inactive {
    opacity: 0.6;
}

.customer-row.inactive:hover {
    opacity: 0.8;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

.status-badge {
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-left: 0.5rem;
}

.status-badge.inactive {
    background: var(--status-danger-bg);
    color: var(--status-danger);
}

.type-badge {
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

/* Filter bar styles */
.filter-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.filter-bar-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.filter-bar-search {
    flex: 1;
    min-width: 280px;
    max-width: 400px;
}

.search-wrapper {
    position: relative;
}

.search-wrapper .search-icon {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.search-wrapper input {
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    background: var(--bg-base);
    border: 1px solid var(--border-subtle);
    transition: all 0.2s ease;
    height: 42px;
    width: 100%;
}

.search-wrapper input:focus {
    background: var(--bg-surface);
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-muted);
}

.filter-select {
    width: auto;
    min-width: 150px;
    height: 42px;
    padding: 0.625rem 2.25rem 0.625rem 0.875rem;
    font-size: 0.875rem;
    flex-shrink: 0;
    background-color: var(--bg-base);
    border: 1px solid var(--border-subtle);
    cursor: pointer;
}

.filter-select:hover {
    border-color: var(--border-hover);
    background-color: var(--bg-elevated);
}

.filter-select:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px var(--accent-primary-muted);
    background-color: var(--bg-surface);
}

.filter-bar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.results-count {
    background: var(--bg-elevated);
    padding: 0.5rem 0.875rem;
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background: var(--accent-primary-muted);
    color: var(--accent-primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

.filter-tag button {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

.filter-tag button:hover {
    opacity: 1;
}

.filter-divider {
    width: 1px;
    height: 24px;
    background: var(--border-subtle);
}

/* Empty illustration */
.empty-illustration {
    width: 120px;
    height: 120px;
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-surface) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    border: 2px dashed var(--border-default);
}

.empty-illustration i {
    font-size: 3rem;
    color: var(--text-muted);
    opacity: 0.5;
}
