/**
 * Feature Flag Configuration Types
 * 
 * Provides type-safe configuration for feature flags across different environments
 * 
 * FEATURE STATES:
 * - 'enabled': Feature is fully available to users
 * - 'disabled': Feature is turned off (not visible/functional)
 * - 'coming_soon': Feature is visible but not yet available (shows "coming soon")
 * - 'hidden': Feature is completely invisible (internal/experimental only)
 */

export type FeatureState = 'enabled' | 'disabled' | 'coming_soon' | 'hidden';

/**
 * Individual feature configuration
 */
export interface FeatureConfig {
  [featureName: string]: FeatureState | FeatureConfig;
}

/**
 * Environment-specific feature configurations
 */
export interface EnvironmentConfig {
  [featureGroup: string]: FeatureConfig;
}

/**
 * Complete feature flag configuration
 */
export interface FeatureFlagConfig {
  development: EnvironmentConfig;
  test: EnvironmentConfig;
  staging: EnvironmentConfig;
  production: EnvironmentConfig;
}

/**
 * Flattened feature map for runtime lookup
 * Example: { 'sponsors.portal': 'enabled', 'admin.dashboard': 'enabled' }
 */
export type FlattenedFeatures = Record<string, FeatureState>;

/**
 * Configuration loader result
 */
export interface ConfigLoadResult {
  features: FlattenedFeatures;
  loadedFrom: 'config-file' | 'env-var' | 'defaults';
  configPath?: string;
}

/**
 * Legacy JSON format for backward compatibility
 */
export interface LegacyFeatureConfig {
  [key: string]: FeatureState | LegacyFeatureConfig;
}