/*
 * File: AuthStackNavigator.tsx
 * Description: Stack navigator for authentication screens within the Auth module
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */

import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';

// Import authentication screens
import LoginScreen from '../screens/LoginScreen';
import SignUpScreen from '../screens/SignUpScreen';

// Import navigation types
import { AuthStackParamList } from './navigationTypes';
import { theme } from '../../../theme';

// Create stack navigator for Auth module
const Stack = createStackNavigator<AuthStackParamList>();

/**
 * AuthStackNavigator - Manages navigation between authentication screens
 * 
 * This navigator handles the flow between:
 * - LoginScreen: Main authentication screen
 * - SignUpScreen: Multi-step registration process
 * 
 * Features:
 * - Clean header styling
 * - Smooth transitions between screens
 * - Type-safe navigation parameters
 */
const AuthStackNavigator: React.FC = () => {
  return (
    <Stack.Navigator
      initialRouteName="Login"
      screenOptions={{
        // Header styling for authentication screens
        headerStyle: {
          backgroundColor: '#FFFFFF',
          elevation: 0, // Remove shadow on Android
          shadowOpacity: 0, // Remove shadow on iOS
        },
        headerTitleStyle: {
          fontFamily: theme.typography.fontFamily.medium,
          fontSize: 18,
          color: '#212121',
        },
        headerTintColor: '#2196F3', // Back button and title color
        // headerBackTitleVisible: false, // Hide back title on iOS
        cardStyle: {
          backgroundColor: '#FFFFFF',
        },
        // Smooth transitions
        transitionSpec: {
          open: {
            animation: 'timing',
            config: {
              duration: 300,
            },
          },
          close: {
            animation: 'timing',
            config: {
              duration: 300,
            },
          },
        },
      }}
    >
      {/* Login Screen - Main authentication entry point */}
      <Stack.Screen
        name="Login"
        component={LoginScreen}
        options={{
          title: 'Sign In',
          headerShown: false, // Hide header for login screen
        }}
      />

      {/* Sign Up Screen - Multi-step registration process */}
      <Stack.Screen
        name="SignUp"
        component={SignUpScreen}
        options={{
          title: 'Create Account',
          headerShown: false, // Hide header for signup screen
        }}
      />
    </Stack.Navigator>
  );
};

export default AuthStackNavigator;

/*
 * End of File: AuthStackNavigator.tsx
 * Design & Developed by Tech4Biz Solutions
 * Copyright (c) Spurrin Innovations. All rights reserved.
 */ 