import gradio as gr

def render_about_tab():    
    with gr.TabItem("🀝 Support Us"):
        
        # def create_tool_section(tool_name, korean_description, english_description):
        #     with gr.Accordion(tool_name, open=False):
        #         with gr.Accordion("ν•œκ΅­μ–΄", open=False):    
        #             gr.Markdown(korean_description)
        #         with gr.Accordion("English", open=False):        
        #             gr.Markdown(english_description)

        # # Portfolio Rebalancing Tool Section
        # create_tool_section(
        #     "RE-BALANCING CALCULATOR",
        #     """
        #     ## πŸ“Š λ¦¬λ°ΈλŸ°μ‹± 계산기

        #     이 λ„κ΅¬λŠ” 주어진 주식 λ³΄μœ λŸ‰, ν˜„κΈˆ κΈˆμ•‘ 및 ν˜„κΈˆ λΉ„μœ¨μ„ λ°”νƒ•μœΌλ‘œ 포트폴리였λ₯Ό λΆ„μ„ν•˜κ³  μž¬μ‘°μ •ν•©λ‹ˆλ‹€. 

        #     ### μž…λ ₯κ°’

        #     - **주식 λ³΄μœ λŸ‰ (holdings)**: 각 μ£Όμ‹μ˜ μ½”λ“œ, 톡화 μ½”λ“œ, μˆ˜λŸ‰, λͺ©ν‘œ λΉ„μœ¨μ„ μž…λ ₯ν•©λ‹ˆλ‹€. μ—¬λŸ¬ 주식 μ’…λͺ©μ€ μ‰Όν‘œλ‘œ κ΅¬λΆ„ν•˜μ—¬ μž…λ ₯ν•©λ‹ˆλ‹€. 예: `AAPL USD 10 0.30,TSLA USD 5 0.20` 
        #     - **ν˜„κΈˆ κΈˆμ•‘ (cash_amount)**: ν¬νŠΈν΄λ¦¬μ˜€μ— ν¬ν•¨λœ ν˜„κΈˆμ˜ κΈˆμ•‘μž…λ‹ˆλ‹€. 예: `1000`
        #     - **ν˜„κΈˆ λΉ„μœ¨ (cash_ratio)**: ν¬νŠΈν΄λ¦¬μ˜€μ—μ„œ ν˜„κΈˆμ΄ μ°¨μ§€ν•˜λŠ” λΉ„μœ¨μž…λ‹ˆλ‹€. 예: `10` (10%)

        #     ### κΈ°λŠ₯

        #     1. **μž…λ ₯ νŒŒμ‹±**: 주식 λ³΄μœ λŸ‰, ν˜„κΈˆ κΈˆμ•‘ 및 λΉ„μœ¨μ„ λΆ„μ„ν•˜μ—¬ 각 μ£Όμ‹μ˜ λͺ©ν‘œ λΉ„μœ¨μ„ κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     2. **ν™˜μœ¨ 쑰회**: 각 μ£Όμ‹μ˜ 톡화 μ½”λ“œμ™€ 메인 톡화 κ°„μ˜ ν™˜μœ¨μ„ μ‘°νšŒν•˜μ—¬ 주식 가격을 λ³€ν™˜ν•©λ‹ˆλ‹€.
        #     3. **포트폴리였 ꡬ좕**: 주식과 ν˜„κΈˆ 정보λ₯Ό λ°”νƒ•μœΌλ‘œ 포트폴리였λ₯Ό κ΅¬μΆ•ν•©λ‹ˆλ‹€.
        #     4. **포트폴리였 μž¬μ‘°μ • 정보 제곡**: ν˜„μž¬ 포트폴리였의 κ°€μΉ˜μ™€ λͺ©ν‘œ λΉ„μœ¨μ„ λΉ„κ΅ν•˜μ—¬ μž¬μ‘°μ • ν•„μš”μ„±μ„ λΆ„μ„ν•©λ‹ˆλ‹€.
        #     - **ν˜„μž¬ λ³΄μœ λŸ‰ 및 κ°€μΉ˜**: 각 주식 및 ν˜„κΈˆμ˜ ν˜„μž¬ λ³΄μœ λŸ‰κ³Ό κ°€μΉ˜λ₯Ό κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     - **μž¬μ‘°μ • ν•­λͺ©**: λͺ©ν‘œ λΉ„μœ¨μ— λ§žμΆ”κΈ° μœ„ν•΄ 맀수 λ˜λŠ” 맀도해야 ν•  주식 μˆ˜λŸ‰κ³Ό κΈˆμ•‘μ„ κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     - **톡화별 μš”μ•½**: 포트폴리였의 톡화별 뢄포λ₯Ό μš”μ•½ν•©λ‹ˆλ‹€.

        #     ### κ²°κ³Ό

        #     - **포트폴리였 정보**: ν˜„μž¬ 포트폴리였의 총 κ°€μΉ˜ 및 ν˜„κΈˆ 정보λ₯Ό ν¬ν•¨ν•œ HTML μ½”λ“œμž…λ‹ˆλ‹€.
        #     - **ν˜„μž¬ λ³΄μœ λŸ‰ 및 κ°€μΉ˜**: 각 μ£Όμ‹μ˜ ν˜„μž¬ λΉ„μœ¨ 및 κ°€μΉ˜μ— λŒ€ν•œ μ •λ³΄μž…λ‹ˆλ‹€.
        #     - **μž¬μ‘°μ • 뢄석**: μ£Όμ‹μ˜ 맀수/맀도 쑰정이 ν•„μš”ν•œ ν•­λͺ© 및 κΈˆμ•‘μ— λŒ€ν•œ 상세 λΆ„μ„μž…λ‹ˆλ‹€.
        #     - **톡화별 μš”μ•½**: 포트폴리였의 톡화별 λΉ„μœ¨ 및 총 κ°€μΉ˜λ₯Ό μš”μ•½ν•œ μ •λ³΄μž…λ‹ˆλ‹€.

        #     이 도ꡬλ₯Ό 톡해 포트폴리였λ₯Ό 효율적으둜 μž¬μ‘°μ •ν•˜κ³ , 주식 및 ν˜„κΈˆμ˜ λΉ„μœ¨μ„ μ΅œμ ν™”ν•  수 μžˆμŠ΅λ‹ˆλ‹€! πŸ“ˆπŸ’Ό

        #     ### μ€‘μš” 사항
        #     - 주식 μ½”λ“œμ™€ 톡화 μ½”λ“œκ°€ μœ νš¨ν•œμ§€ ν™•μΈν•˜μ„Έμš”.
        #     - 이 λ„κ΅¬λŠ” 주가와 ν™˜μœ¨μ˜ μ‹€μ‹œκ°„ 데이터λ₯Ό μ‚¬μš©ν•˜λ―€λ‘œ 인터넷 연결이 ν•„μš”ν•©λ‹ˆλ‹€.
        #     - Yahoo Finance 및 FinanceDataReader의 데이터λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

        #     ### λ©΄μ±… μ‘°ν•­
        #     이 λ„κ΅¬μ—μ„œ μ œκ³΅ν•˜λŠ” μ •λ³΄λŠ” 일반적인 정보 제곡 λͺ©μ λ§Œμ„ μœ„ν•΄ μ œκ³΅λ©λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ λͺ¨λ“  μ •λ³΄λŠ” μ„ μ˜λ‘œ μ œκ³΅λ˜μ§€λ§Œ, μ‚¬μ΄νŠΈμ˜ μ •λ³΄μ˜ μ •ν™•μ„±, μ μ ˆμ„±, μœ νš¨μ„±, μ‹ λ’°μ„±, κ°€μš©μ„± λ˜λŠ” 완전성에 λŒ€ν•΄ λͺ…μ‹œμ μ΄λ“  λ¬΅μ‹œμ μ΄λ“  μ–΄λ– ν•œ μ’…λ₯˜μ˜ μ§„μˆ μ΄λ‚˜ 보증을 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ μ‚¬μš©κ³Ό μ‚¬μ΄νŠΈμ˜ 정보λ₯Ό μ‹ λ’°ν•˜λŠ” 것은 μ „μ μœΌλ‘œ μ‚¬μš©μžμ˜ μ±…μž„μž…λ‹ˆλ‹€.
        #     """,
        #     """
        #     ## πŸ“Š RE-BALANCING CALCULATOR

        #     This tool analyzes and rebalances a portfolio based on given stock holdings, cash amount, and cash ratio.

        #     ### Input Values

        #     - **Stock Holdings (holdings)**: Enter the stock code, currency code, quantity, and target weight for each stock. Separate multiple stocks with commas. Example: `AAPL USD 10 0.30,TSLA USD 5 0.20`
        #     - **Cash Amount (cash_amount)**: The amount of cash in the portfolio. Example: `1000`
        #     - **Cash Ratio (cash_ratio)**: The proportion of cash in the portfolio. Example: `10` (10%)

        #     ### Functionality

        #     1. **Parse Input**: Analyzes stock holdings, cash amount, and ratio to calculate the target weights for each stock.
        #     2. **Exchange Rate Lookup**: Retrieves exchange rates between each stock's currency code and the main currency to convert stock prices.
        #     3. **Build Portfolio**: Constructs the portfolio based on stock and cash information.
        #     4. **Get Portfolio Rebalancing Information**: Compares the current portfolio value and target weights to analyze rebalancing needs.
        #     - **Current Holdings and Value**: Calculates the current holdings and value of each stock and cash.
        #     - **Rebalancing Items**: Calculates the quantities and amounts of stocks to buy or sell to meet target weights.
        #     - **Currency Summary**: Summarizes the portfolio's distribution by currency.

        #     ### Results

        #     - **Portfolio Information**: HTML code containing the total value of the current portfolio and cash information.
        #     - **Current Holdings and Value**: Information on the current weights and values of each stock.
        #     - **Rebalancing Analysis**: Detailed analysis of the adjustments needed to buy/sell stocks to meet target weights.
        #     - **Currency Summary**: Summary of portfolio distribution by currency, including total value.

        #     Use this tool to efficiently rebalance your portfolio and optimize the ratio of stocks and cash! πŸ“ˆπŸ’Ό

        #     ### Important Notes
        #     - Ensure stock codes and currency codes are valid.
        #     - This tool requires an internet connection as it uses real-time stock prices and exchange rates.
        #     - Data is sourced from Yahoo Finance and FinanceDataReader.

        #     ### Disclaimer
        #     The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
        #     """
        # )

        # # Stock Comparison Tool Section
        # create_tool_section(
        #     "STOCK PRICE TREND VISUALIZATION",
        #     """
        #     ## πŸ“ˆ 주식 가격 μΆ”μ„Έ μ‹œκ°ν™”

        #     이 μ½”λ“œλŠ” 주어진 주식 μ½”λ“œλ“€μ˜ 가격 μΆ”μ„Έλ₯Ό μ‹œκ°ν™”ν•©λ‹ˆλ‹€. μ—¬λŸ¬ μ£Όμ‹μ˜ 가격을 μΆ”μ ν•˜κ³  λΉ„κ΅ν•˜κΈ° μœ„ν•΄ μ‚¬μš©λ©λ‹ˆλ‹€. πŸ“Š

        #     ### μž…λ ₯κ°’

        #     - **주식 μ½”λ“œ (stock_codes)**: 가격을 좔적할 μ£Όμ‹μ˜ μ½”λ“œλ“€μž…λ‹ˆλ‹€. μ‰Όν‘œλ‘œ κ΅¬λΆ„λœ λ¬Έμžμ—΄ ν˜•μ‹μœΌλ‘œ μž…λ ₯ν•©λ‹ˆλ‹€. 예: `AAPL,GOOGL,MSFT`
        #     - **일수 (days)**: 가격을 μ‘°νšŒν•  κΈ°κ°„μž…λ‹ˆλ‹€. 예: `30` (졜근 30일)

        #     ### κΈ°λŠ₯

        #     1. **주식 가격 데이터 κ°€μ Έμ˜€κΈ°**: 주어진 주식 μ½”λ“œμ™€ 기간에 λŒ€ν•΄ 주식 가격 데이터λ₯Ό κ°€μ Έμ˜΅λ‹ˆλ‹€.
        #     2. **가격 변동 μ‹œκ°ν™”**: 각 μ£Όμ‹μ˜ 가격 변동을 μ‹œκ°ν™”ν•˜μ—¬ 비ꡐ할 수 μžˆλŠ” κ·Έλž˜ν”„λ₯Ό μƒμ„±ν•©λ‹ˆλ‹€.
        #     - **μƒλŒ€ 가격**: 각 μ£Όμ‹μ˜ 가격을 처음 가격에 λŒ€ν•΄ μƒλŒ€μ μœΌλ‘œ 변동을 λ³΄μ—¬μ€λ‹ˆλ‹€.
        #     - **μŠ€νƒ€μΌ**: κ·Έλž˜ν”„μ—λŠ” 색상 κ·ΈλΌλ””μ–ΈνŠΈμ™€ 그림자 νš¨κ³Όκ°€ μ μš©λ©λ‹ˆλ‹€.
        #     - **μ• λ‹ˆλ©”μ΄μ…˜**: μ„ μ˜ μ• λ‹ˆλ©”μ΄μ…˜ νš¨κ³Όκ°€ μΆ”κ°€λ˜μ–΄ μ‹œκ°μ μœΌλ‘œ λ”μš± 맀λ ₯μ μž…λ‹ˆλ‹€.
        #     3. **데이터 ν…Œμ΄λΈ” 생성**: 각 λ‚ μ§œμ™€ μ£Όμ‹μ˜ 가격을 ν¬ν•¨ν•œ HTML ν…Œμ΄λΈ”μ„ μƒμ„±ν•©λ‹ˆλ‹€.

        #     ### κ²°κ³Ό

        #     - **κ·Έλž˜ν”„**: 졜근 `days` 일 λ™μ•ˆμ˜ μƒλŒ€ 주식 가격 μΆ”μ„Έλ₯Ό λ³΄μ—¬μ£ΌλŠ” κ·Έλž˜ν”„μž…λ‹ˆλ‹€.
        #     - **데이터 ν…Œμ΄λΈ”**: λ‚ μ§œλ³„λ‘œ 각 μ£Όμ‹μ˜ 가격을 ν¬ν•¨ν•˜λŠ” HTML ν…Œμ΄λΈ”μž…λ‹ˆλ‹€.

        #     ### μ‚¬μš© 예제

        #     주식 μ½”λ“œμ™€ 기간을 μž…λ ₯ν•˜λ©΄, λ‹€μŒκ³Ό 같은 κ²°κ³Όλ₯Ό 얻을 수 μžˆμŠ΅λ‹ˆλ‹€:

        #     - **주식 μ½”λ“œ**: `AAPL,GOOGL,MSFT`
        #     - **일수**: `30`

        #     κ²°κ³ΌλŠ” 졜근 30일 λ™μ•ˆμ˜ 주식 가격 변동을 λ³΄μ—¬μ£ΌλŠ” κ·Έλž˜ν”„μ™€ 데이터 ν…Œμ΄λΈ”μ΄ ν¬ν•¨λ©λ‹ˆλ‹€.

        #     이 도ꡬλ₯Ό 톡해 주식 κ°€κ²©μ˜ 변동 μΆ”μ„Έλ₯Ό ν•œλˆˆμ— ν™•μΈν•˜κ³  뢄석할 수 μžˆμŠ΅λ‹ˆλ‹€! πŸ“ˆπŸ’‘

        #     ### μ€‘μš” 사항
        #     - 주식 μ½”λ“œκ°€ μœ νš¨ν•œμ§€ ν™•μΈν•˜μ„Έμš”.
        #     - 이 λ„κ΅¬λŠ” μ£Όκ°€μ˜ μ‹€μ‹œκ°„ 데이터λ₯Ό μ‚¬μš©ν•˜λ―€λ‘œ 인터넷 연결이 ν•„μš”ν•©λ‹ˆλ‹€.
        #     - Yahoo Finance 및 FinanceDataReader의 데이터λ₯Ό μ‚¬μš©ν•©λ‹ˆλ‹€.

        #     ### λ©΄μ±… μ‘°ν•­
        #     이 λ„κ΅¬μ—μ„œ μ œκ³΅ν•˜λŠ” μ •λ³΄λŠ” 일반적인 정보 제곡 λͺ©μ λ§Œμ„ μœ„ν•΄ μ œκ³΅λ©λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ λͺ¨λ“  μ •λ³΄λŠ” μ„ μ˜λ‘œ μ œκ³΅λ˜μ§€λ§Œ, μ‚¬μ΄νŠΈμ˜ μ •λ³΄μ˜ μ •ν™•μ„±, μ μ ˆμ„±, μœ νš¨μ„±, μ‹ λ’°μ„±, κ°€μš©μ„± λ˜λŠ” 완전성에 λŒ€ν•΄ λͺ…μ‹œμ μ΄λ“  λ¬΅μ‹œμ μ΄λ“  μ–΄λ– ν•œ μ’…λ₯˜μ˜ μ§„μˆ μ΄λ‚˜ 보증을 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ μ‚¬μš©κ³Ό μ‚¬μ΄νŠΈμ˜ 정보λ₯Ό μ‹ λ’°ν•˜λŠ” 것은 μ „μ μœΌλ‘œ μ‚¬μš©μžμ˜ μ±…μž„μž…λ‹ˆλ‹€.
        #     """,
        #     """
        #     ## πŸ“ˆ Stock Price Trend Visualization

        #     This script visualizes the price trends of given stock codes over a specified period. It allows you to track and compare the price movements of multiple stocks. πŸ“Š

        #     ### Input Values

        #     - **Stock Codes (stock_codes)**: The codes of the stocks you want to track. Enter them as a comma-separated string. Example: `AAPL,GOOGL,MSFT`
        #     - **Days (days)**: The period for which you want to fetch the price data. Example: `30` (last 30 days)

        #     ### Functionality

        #     1. **Fetch Stock Price Data**: Retrieves stock price data for the given stock codes and period.
        #     2. **Visualize Price Trends**: Creates a graph to visualize and compare the price trends of each stock.
        #     - **Relative Price**: Shows each stock's price relative to its initial price.
        #     - **Style**: The graph includes color gradients and shadow effects.
        #     - **Animation**: Line animation effects are added for visual appeal.
        #     3. **Generate Data Table**: Creates an HTML table with the price data for each stock and date.

        #     ### Results

        #     - **Graph**: A graph showing the relative stock price trends over the last `days` days.
        #     - **Data Table**: An HTML table displaying the prices of each stock by date.

        #     ### Example Usage

        #     Given stock codes and days, you can obtain results such as:

        #     - **Stock Codes**: `AAPL,GOOGL,MSFT`
        #     - **Days**: `30`

        #     The result will include a graph showing the price trends over the last 30 days and an HTML table with the price data.

        #     Use this tool to easily analyze and visualize stock price movements! πŸ“ˆπŸ’‘

        #     ### Important Notes
        #     - Ensure stock codes are valid.
        #     - This tool requires an internet connection as it uses real-time stock prices.
        #     - Data is sourced from Yahoo Finance and FinanceDataReader.

        #     ### Disclaimer
        #     The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
        #     """
        # )

        # # Cost Averaging Tool Section
        # create_tool_section(
        #     "DOLLAR-COST AVERAGING CALCULATOR",
        #     """
        #     ## πŸ’Έ 물타기 계산기

        #     물타기(Dollar-Cost Averaging, DCA) 계산기λ₯Ό μ΄μš©ν•΄ λ³΄μ„Έμš”! 이 κ³„μ‚°κΈ°λŠ” νŠΉμ • 주식에 λŒ€ν•œ μΆ”κ°€ 투자λ₯Ό ν•  λ•Œ 평균 ꡬ맀 가격을 κ³„μ‚°ν•΄μ€λ‹ˆλ‹€. πŸ“ˆ

        #     ### μž…λ ₯κ°’ μ„€μ • πŸ“Š

        #     λ‹€μŒμ˜ 값을 μž…λ ₯ν•΄ μ£Όμ„Έμš”:

        #     - **이전 평균 가격 (old_avg_price)**: κΈ°μ‘΄ μ£Όμ‹μ˜ 평균 가격 πŸ’΅
        #     - **이전 μˆ˜λŸ‰ (old_quantity)**: κΈ°μ‘΄ μ£Όμ‹μ˜ μˆ˜λŸ‰ πŸ“¦
        #     - **μƒˆ 가격 (new_price)**: μƒˆλ‘œ κ΅¬λ§€ν•œ μ£Όμ‹μ˜ 가격 πŸ’²
        #     - **μƒˆ μˆ˜λŸ‰ (new_quantity)**: μƒˆλ‘œ κ΅¬λ§€ν•œ μ£Όμ‹μ˜ μˆ˜λŸ‰ πŸ“ˆ

        #     ### 계산 방법 πŸ”’

        #     1. **ν˜„μž¬ 투자 κΈˆμ•‘ 계산**: 이전 평균 가격과 이전 μˆ˜λŸ‰μ„ κ³±ν•˜μ—¬ ν˜„μž¬ 투자 κΈˆμ•‘μ„ κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     2. **μΆ”κ°€ 투자 κΈˆμ•‘ 계산**: μƒˆ 가격과 μƒˆ μˆ˜λŸ‰μ„ κ³±ν•˜μ—¬ μΆ”κ°€ 투자 κΈˆμ•‘μ„ κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     3. **총 투자 κΈˆμ•‘ 및 총 주식 수 계산**: ν˜„μž¬ 투자 κΈˆμ•‘κ³Ό μΆ”κ°€ 투자 κΈˆμ•‘μ„ ν•©μ³μ„œ 총 투자 κΈˆμ•‘μ„ κ³„μ‚°ν•˜κ³ , 이전 μˆ˜λŸ‰κ³Ό μƒˆ μˆ˜λŸ‰μ„ λ”ν•˜μ—¬ 총 주식 수λ₯Ό κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     4. **μƒˆ 평균 가격 계산**: 총 투자 κΈˆμ•‘μ„ 총 주식 수둜 λ‚˜λˆ„μ–΄ μƒˆλ‘œμš΄ 평균 가격을 κ³„μ‚°ν•©λ‹ˆλ‹€.
        #     5. **수읡λ₯  계산**: 이전과 μƒˆλ‘œμš΄ 수읡λ₯ μ„ κ³„μ‚°ν•˜μ—¬ 투자 κ²°κ³Όλ₯Ό λΆ„μ„ν•©λ‹ˆλ‹€.

        #     ### 결과 🎯

        #     **1) 이전 수읡λ₯  (Old Return)**

        #     이전 평균 가격을 κΈ°μ€€μœΌλ‘œ ν•œ 수읡λ₯ μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     **2) μƒˆλ‘œμš΄ 수읡λ₯  (New Return)**

        #     μƒˆλ‘œμš΄ 평균 가격을 κΈ°μ€€μœΌλ‘œ ν•œ 수읡λ₯ μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     **3) μΆ”κ°€ 투자 κΈˆμ•‘ (Additional Investment)**

        #     μΆ”κ°€λ‘œ νˆ¬μžν•œ κΈˆμ•‘μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     **4) μƒˆλ‘œμš΄ 평균 가격 (Average Price)**

        #     μƒˆλ‘­κ²Œ κ³„μ‚°λœ 평균 가격을 ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     **5) 총 μˆ˜λŸ‰ (Total Quantity)**

        #     총 주식 μˆ˜λŸ‰μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     **6) 총 투자 κΈˆμ•‘ (Total Investment)**

        #     총 투자 κΈˆμ•‘μ„ ν‘œμ‹œν•©λ‹ˆλ‹€.

        #     ### 예제 πŸ“‰

        #     - **이전 평균 가격**: 100
        #     - **이전 μˆ˜λŸ‰**: 10
        #     - **μƒˆ 가격**: 120
        #     - **μƒˆ μˆ˜λŸ‰**: 5

        #     κ²°κ³Ό:
        #     - μƒˆλ‘œμš΄ 평균 가격: 105
        #     - 총 μˆ˜λŸ‰: 15
        #     - 총 투자 κΈˆμ•‘: 1,575
        #     - 이전 수읡λ₯ : 20.00%
        #     - μƒˆλ‘œμš΄ 수읡λ₯ : 14.29%
        #     - μΆ”κ°€ 투자 κΈˆμ•‘: 600

        #     물타기 계산기λ₯Ό 톡해 투자의 평균 ꡬ맀 가격을 μ‰½κ²Œ 계산해 λ³΄μ„Έμš”! πŸ“ŠπŸ’°

        #     ### λ©΄μ±… μ‘°ν•­
        #     이 λ„κ΅¬μ—μ„œ μ œκ³΅ν•˜λŠ” μ •λ³΄λŠ” 일반적인 정보 제곡 λͺ©μ λ§Œμ„ μœ„ν•΄ μ œκ³΅λ©λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ λͺ¨λ“  μ •λ³΄λŠ” μ„ μ˜λ‘œ μ œκ³΅λ˜μ§€λ§Œ, μ‚¬μ΄νŠΈμ˜ μ •λ³΄μ˜ μ •ν™•μ„±, μ μ ˆμ„±, μœ νš¨μ„±, μ‹ λ’°μ„±, κ°€μš©μ„± λ˜λŠ” 완전성에 λŒ€ν•΄ λͺ…μ‹œμ μ΄λ“  λ¬΅μ‹œμ μ΄λ“  μ–΄λ– ν•œ μ’…λ₯˜μ˜ μ§„μˆ μ΄λ‚˜ 보증을 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ μ‚¬μš©κ³Ό μ‚¬μ΄νŠΈμ˜ 정보λ₯Ό μ‹ λ’°ν•˜λŠ” 것은 μ „μ μœΌλ‘œ μ‚¬μš©μžμ˜ μ±…μž„μž…λ‹ˆλ‹€.                
        #     """,
        #     """
        #     ## πŸ’Έ Dollar-Cost Averaging Calculator

        #     Try out the Dollar-Cost Averaging (DCA) calculator! This tool helps you calculate the average purchase price of stocks when making additional investments. πŸ“ˆ

        #     ### Input Values πŸ“Š

        #     Please enter the following details:

        #     - **Old Average Price (old_avg_price)**: The average price of the existing stocks πŸ’΅
        #     - **Old Quantity (old_quantity)**: The quantity of the existing stocks πŸ“¦
        #     - **New Price (new_price)**: The price of the newly purchased stocks πŸ’²
        #     - **New Quantity (new_quantity)**: The quantity of the newly purchased stocks πŸ“ˆ

        #     ### Calculation Process πŸ”’

        #     1. **Current Investment**: Calculate the current investment amount by multiplying the old average price by the old quantity.
        #     2. **Additional Investment**: Calculate the additional investment amount by multiplying the new price by the new quantity.
        #     3. **Total Investment and Total Quantity**: Add the current investment amount and additional investment amount to get the total investment. Sum the old quantity and new quantity to get the total quantity of stocks.
        #     4. **New Average Price**: Calculate the new average price by dividing the total investment by the total quantity of stocks.
        #     5. **Return Calculation**: Calculate the old and new returns to analyze the investment results.

        #     ### Results 🎯

        #     **1) Old Return**

        #     Displays the return based on the old average price.

        #     **2) New Return**

        #     Displays the return based on the new average price.

        #     **3) Additional Investment**

        #     Shows the amount of additional investment made.

        #     **4) Average Price**

        #     Displays the newly calculated average price.

        #     **5) Total Quantity**

        #     Shows the total quantity of stocks.

        #     **6) Total Investment**

        #     Displays the total investment amount.

        #     ### Example πŸ“‰

        #     - **Old Average Price**: 100
        #     - **Old Quantity**: 10
        #     - **New Price**: 120
        #     - **New Quantity**: 5

        #     Results:
        #     - New Average Price: 105
        #     - Total Quantity: 15
        #     - Total Investment: 1,575
        #     - Old Return: 20.00%
        #     - New Return: 14.29%
        #     - Additional Investment: 600

        #     Use the Dollar-Cost Averaging Calculator to easily compute the average purchase price of your investments! πŸ“ŠπŸ’°

        #     ### Disclaimer
        #     The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
        #     """
        # )

        # # Retirement Planning Tool Section
        # create_tool_section(
        #     "RETIREMENT PLANNING CALCULATOR",
        #     """
        #     ## πŸ–οΈ 은퇴 κ³„νš 계산기 μ‚¬μš©λ²•

        #     μ•ˆλ…•ν•˜μ„Έμš”! 😊 은퇴 κ³„νš 계산기에 μ˜€μ‹  것을 ν™˜μ˜ν•©λ‹ˆλ‹€. 이 λ„κ΅¬λŠ” μ—¬λŸ¬λΆ„μ˜ 은퇴 ν›„ μž¬μ • 상황을 μ˜ˆμΈ‘ν•˜κ³  μ€€λΉ„ν•˜λŠ” 데 도움을 쀄 κ±°μ˜ˆμš”. μ•„λž˜λŠ” 이 κ³„μ‚°κΈ°μ˜ μž‘λ™ 방식과 ν•„μš”ν•œ μ •λ³΄μž…λ‹ˆλ‹€. 

        #     ### 1. μž…λ ₯ κ°’ πŸ“Š

        #     κ³„μ‚°κΈ°μ—μ„œ λ‹€μŒ 정보λ₯Ό μž…λ ₯ν•΄ μ£Όμ„Έμš”:

        #     - **ν˜„μž¬ λ‚˜μ΄ (current_age)**: ν˜„μž¬ λ‚˜μ΄ πŸŽ‚
        #     - **은퇴 λ‚˜μ΄ (retirement_age)**: μ€ν‡΄ν•˜κ³  싢은 λ‚˜μ΄ πŸŽ‰
        #     - **평생 κΈ°λŒ€ 수λͺ… (life_expectancy)**: μ˜ˆμƒλ˜λŠ” 평생 수λͺ… 🌟
        #     - **월별 ν•„μš”ν•œ μƒν™œλΉ„ (monthly_income_required)**: 맀월 ν•„μš”ν•œ μƒν™œλΉ„ πŸ’΅
        #     - **μΈν”Œλ ˆμ΄μ…˜μœ¨ (inflation_rate)**: λ¬Όκ°€ μƒμŠΉλ₯  πŸ“ˆ
        #     - **ν˜„μž¬ νˆ¬μžμ•‘ (current_investment)**: ν˜„μž¬ λ³΄μœ ν•œ νˆ¬μžμ•‘ πŸ’°
        #     - **월별 μΆ”κ°€ νˆ¬μžμ•‘ (monthly_investment)**: 맀월 μΆ”κ°€λ‘œ νˆ¬μžν•  κΈˆμ•‘ πŸ’Έ
        #     - **μ›” νˆ¬μžμ•‘μ˜ μ—°κ°„ 증가앑 (annual_increase_in_monthly_investment)**: 맀월 증가할 νˆ¬μžμ•‘(맀년 μ›” 적립식 νˆ¬μžκΈˆμ—μ„œ λŠ˜λ €λ‚˜κ°ˆ κΈˆμ•‘. (ex: 맀년 10λ§Œμ›μ”© 늘릴 μ˜ˆμ •μ΄λΌλ©΄, 100,000 μž…λ ₯)) πŸ“ˆ
        #     - **λ°°λ‹ΉκΈˆ 재투자 μ—¬λΆ€ (reinvest_dividends)**: λ°°λ‹ΉκΈˆμ„ μž¬νˆ¬μžν• μ§€ μ—¬λΆ€ πŸ”„
        #     - **은퇴 μ „ 수읡λ₯  (pre_retirement_roi)**: 은퇴 μ „ μ˜ˆμƒ μ—° 수읡λ₯  πŸ“Š
        #     - **은퇴 μ „ λ°°λ‹Ή 수읡λ₯  (pre_retirement_dividend_yield)**: 은퇴 μ „ λ°°λ‹ΉκΈˆ 수읡λ₯  πŸ“ˆ
        #     - **은퇴 ν›„ 수읡λ₯  (post_retirement_roi)**: 은퇴 ν›„ μ˜ˆμƒ μ—° 수읡λ₯  🌿
        #     - **은퇴 ν›„ λ°°λ‹Ή 수읡λ₯  (post_retirement_dividend_yield)**: 은퇴 ν›„ λ°°λ‹ΉκΈˆ 수읡λ₯  πŸ’΅

        #     ### 2. 계산 κ³Όμ • πŸ”’

        #     **1) 은퇴 μ „ μžμ‚° 계산**

        #     ν˜„μž¬ μžμ‚°κ³Ό 맀월 μΆ”κ°€ νˆ¬μžμ•‘μ„ κ³ λ €ν•΄ 은퇴 μ „ μžμ‚°μ„ κ³„μ‚°ν•΄μš”. 월별 수읡λ₯ μ„ μ μš©ν•˜μ—¬ μžμ‚°μ΄ μ–΄λ–»κ²Œ μ„±μž₯할지 μ˜ˆμΈ‘ν•©λ‹ˆλ‹€.

        #     **곡식:**
        #     \[ \text{μ›”κ°„ 수읡λ₯ } = \left(1 + \frac{\text{μ—° 수읡λ₯ }}{100}\right)^{\frac{1}{12}} - 1 \]

        #     **2) 은퇴 ν›„ μžμ‚° 및 λ°°λ‹Ή 수읡 계산**

        #     은퇴 μ‹œμ μ˜ μžμ‚°κ³Ό λ°°λ‹Ή μˆ˜μ΅μ„ κΈ°λ‘ν•˜κ³ , 은퇴 ν›„ 맀년 μžμ‚°κ³Ό λ°°λ‹Ή μˆ˜μ΅μ„ μ—…λ°μ΄νŠΈν•©λ‹ˆλ‹€. 맀년 ν•„μš”ν•œ μƒν™œλΉ„λ„ λ¬Όκ°€ μƒμŠΉλ₯ μ— 맞좰 μ‘°μ •ν•©λ‹ˆλ‹€.

        #     **3) μΆ”κ°€ ν˜„κΈˆ ν•„μš”λŸ‰ 계산**

        #     λ°°λ‹Ή 수읡과 ν•„μš”ν•œ μƒν™œλΉ„λ₯Ό λΉ„κ΅ν•˜μ—¬ μΆ”κ°€λ‘œ ν•„μš”ν•œ ν˜„κΈˆμ„ κ³„μ‚°ν•΄μš”.

        #     **곡식:**
        #     \[ \text{μ—°κ°„ ν•„μš”ν•œ μƒν™œλΉ„} = \text{월별 ν•„μš”ν•œ μƒν™œλΉ„} \times 12 \]
        #     \[ \text{μΆ”κ°€ ν˜„κΈˆ ν•„μš”λŸ‰} = \text{μ—°κ°„ ν•„μš”ν•œ μƒν™œλΉ„} - \text{μ—°κ°„ λ°°λ‹Ή 수읡} \]

        #     ### 3. κ²°κ³Ό 좜λ ₯ πŸ“ˆ

        #     κ³„μ‚°λœ κ²°κ³ΌλŠ” λ‹€μŒκ³Ό 같은 ν˜•μ‹μœΌλ‘œ μ œκ³΅λ©λ‹ˆλ‹€:

        #     - **은퇴 직후 ν•„μš”ν•œ μƒν™œλΉ„**와 **λ°°λ‹Ή 수읡**을 ν•œλˆˆμ— λ³Ό 수 μžˆμ–΄μš”.
        #     - 은퇴 ν›„ 맀년 μžμ‚°, ν•„μš”ν•œ μƒν™œλΉ„, λ°°λ‹Ή 수읡 등을 ν‘œλ‘œ 확인할 수 μžˆμŠ΅λ‹ˆλ‹€.
        #     - μΆ”κ°€λ‘œ ν•„μš”ν•œ ν˜„κΈˆμ„ κ³„μ‚°ν•˜μ—¬ 총 ν•„μš” ν˜„κΈˆμ„ λ³΄μ—¬μ€λ‹ˆλ‹€.

        #     ### 예제 🎁

        #     **μž…λ ₯ κ°’ μ˜ˆμ‹œ:**

        #     - ν˜„μž¬ λ‚˜μ΄: 40μ„Έ
        #     - 은퇴 λ‚˜μ΄: 65μ„Έ
        #     - 평생 κΈ°λŒ€ 수λͺ…: 85μ„Έ
        #     - 월별 ν•„μš”ν•œ μƒν™œλΉ„: 2,000,000 원
        #     - μΈν”Œλ ˆμ΄μ…˜μœ¨: 2%
        #     - ν˜„μž¬ νˆ¬μžμ•‘: 50,000,000 원
        #     - 월별 μΆ”κ°€ νˆ¬μžμ•‘: 500,000 원
        #     - 월별 투자 증가앑: 50,000 원
        #     - λ°°λ‹ΉκΈˆ 재투자 μ—¬λΆ€: 예
        #     - 은퇴 μ „ 수읡λ₯ : 5%
        #     - 은퇴 μ „ λ°°λ‹Ή 수읡λ₯ : 2%
        #     - 은퇴 ν›„ 수읡λ₯ : 4%
        #     - 은퇴 ν›„ λ°°λ‹Ή 수읡λ₯ : 2%

        #     **좜λ ₯ κ²°κ³Ό:**

        #     - 은퇴 직후 월별 ν•„μš”ν•œ μƒν™œλΉ„: 2,000,000 원
        #     - 은퇴 직후 월별 λ°°λ‹Ή 수읡: 500,000 원
        #     - 총 μΆ”κ°€ ν˜„κΈˆ ν•„μš”λŸ‰: 맀년 μΆ”κ°€λ‘œ ν•„μš”ν•œ κΈˆμ•‘

        #     **κ·Έλž˜ν”„μ™€ CSV 파일 πŸ“‰:**

        #     - 은퇴 κ³„νšμ„ μ‹œκ°μ μœΌλ‘œ λ³΄μ—¬μ£ΌλŠ” κ·Έλž˜ν”„μ™€ 계산 κ²°κ³Όλ₯Ό ν¬ν•¨ν•œ CSV 파일 λ‹€μš΄λ‘œλ“œ 링크도 μ œκ³΅λ©λ‹ˆλ‹€.

        #     은퇴 κ³„νš 계산기λ₯Ό 톡해 μ—¬λŸ¬λΆ„μ˜ μž¬μ • κ³„νšμ„ 미리 μ€€λΉ„ν•˜κ³ , μ•ˆμ •μ μΈ 미래λ₯Ό κ³„νšν•΄λ³΄μ„Έμš”! πŸŒŸπŸ’Ό


        #     ### λ©΄μ±… μ‘°ν•­
        #     이 λ„κ΅¬μ—μ„œ μ œκ³΅ν•˜λŠ” μ •λ³΄λŠ” 일반적인 정보 제곡 λͺ©μ λ§Œμ„ μœ„ν•΄ μ œκ³΅λ©λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ λͺ¨λ“  μ •λ³΄λŠ” μ„ μ˜λ‘œ μ œκ³΅λ˜μ§€λ§Œ, μ‚¬μ΄νŠΈμ˜ μ •λ³΄μ˜ μ •ν™•μ„±, μ μ ˆμ„±, μœ νš¨μ„±, μ‹ λ’°μ„±, κ°€μš©μ„± λ˜λŠ” 완전성에 λŒ€ν•΄ λͺ…μ‹œμ μ΄λ“  λ¬΅μ‹œμ μ΄λ“  μ–΄λ– ν•œ μ’…λ₯˜μ˜ μ§„μˆ μ΄λ‚˜ 보증을 ν•˜μ§€ μ•ŠμŠ΅λ‹ˆλ‹€. μ‚¬μ΄νŠΈμ˜ μ‚¬μš©κ³Ό μ‚¬μ΄νŠΈμ˜ 정보λ₯Ό μ‹ λ’°ν•˜λŠ” 것은 μ „μ μœΌλ‘œ μ‚¬μš©μžμ˜ μ±…μž„μž…λ‹ˆλ‹€.
        #     """,
        #     """
        #     ## πŸ–οΈ Retirement Planning Calculator Guide

        #     Welcome to the Retirement Planning Calculator! 😊 This tool helps you forecast and prepare for your financial situation after retirement. Here’s how it works and what information you need to provide:

        #     ### 1. Input Values πŸ“Š

        #     Please provide the following details:

        #     - **Current Age (current_age)**: Your current age πŸŽ‚
        #     - **Retirement Age (retirement_age)**: Age at which you plan to retire πŸŽ‰
        #     - **Life Expectancy (life_expectancy)**: Expected lifespan 🌟
        #     - **Monthly Income Required (monthly_income_required)**: Monthly expenses needed πŸ’΅
        #     - **Inflation Rate (inflation_rate)**: Rate of inflation πŸ“ˆ
        #     - **Current Investment (current_investment)**: Amount currently invested πŸ’°
        #     - **Monthly Investment (monthly_investment)**: Additional monthly investment πŸ’Έ
        #     - **Annual Increase in Monthly Investment (annual_increase_in_monthly_investment)**: Increase in monthly investment (For example, if you plan to increase your monthly investment by $100,000 each year, enter 100,000.) πŸ“ˆ
        #     - **Reinvest Dividends (reinvest_dividends)**: Whether to reinvest dividends πŸ”„
        #     - **Pre-Retirement ROI (pre_retirement_roi)**: Expected annual return before retirement πŸ“Š
        #     - **Pre-Retirement Dividend Yield (pre_retirement_dividend_yield)**: Dividend yield before retirement πŸ“ˆ
        #     - **Post-Retirement ROI (post_retirement_roi)**: Expected annual return after retirement 🌿
        #     - **Post-Retirement Dividend Yield (post_retirement_dividend_yield)**: Dividend yield after retirement πŸ’΅

        #     ### 2. Calculation Process πŸ”’

        #     **1) Pre-Retirement Asset Calculation**

        #     The calculator uses your current assets and monthly contributions to forecast your asset growth before retirement. Monthly returns are applied to estimate how your assets will grow.

        #     **Formula:**
        #     \[ \text{Monthly Return} = \left(1 + \frac{\text{Annual ROI}}{100}\right)^{\frac{1}{12}} - 1 \]

        #     **2) Post-Retirement Asset and Dividend Income Calculation**

        #     The calculator tracks your assets and dividend income at retirement, then updates these figures annually. It also adjusts monthly income needs for inflation.

        #     **3) Additional Cash Needed Calculation**

        #     It compares dividend income with required income to determine if additional cash is needed.

        #     **Formula:**
        #     \[ \text{Annual Income Required} = \text{Monthly Income Required} \times 12 \]
        #     \[ \text{Additional Cash Required} = \text{Annual Income Required} - \text{Annual Dividend Income} \]

        #     ### 3. Results πŸ“ˆ

        #     The results are displayed as follows:

        #     - **Immediate Post-Retirement Income Needs** and **Dividend Income** for easy comparison.
        #     - Annual asset, required income, and dividend income details in a table.
        #     - Total additional cash required to cover any shortfall.

        #     ### Example 🎁

        #     **Example Input Values:**

        #     - Current Age: 40 years
        #     - Retirement Age: 65 years
        #     - Life Expectancy: 85 years
        #     - Monthly Income Required: $2,000
        #     - Inflation Rate: 2%
        #     - Current Investment: $50,000
        #     - Monthly Investment: $500
        #     - Monthly Increase in Investment: $50
        #     - Reinvest Dividends: Yes
        #     - Pre-Retirement ROI: 5%
        #     - Pre-Retirement Dividend Yield: 2%
        #     - Post-Retirement ROI: 4%
        #     - Post-Retirement Dividend Yield: 2%

        #     **Output Results:**

        #     - Monthly Income Required Immediately After Retirement: $2,000
        #     - Monthly Dividend Income Immediately After Retirement: $500
        #     - Total Additional Cash Required: Amount needed annually

        #     **Graph and CSV File πŸ“‰:**

        #     - Visual graphs of the retirement plan and a CSV file with detailed calculations are available for download.

        #     Use the Retirement Planning Calculator to prepare for your future and ensure a secure retirement! πŸŒŸπŸ’Ό

        #     ### Disclaimer
        #     The information provided by this tool is for general informational purposes only. All information on the site is provided in good faith, but we make no representation or warranty of any kind, express or implied, regarding the accuracy, adequacy, validity, reliability, availability, or completeness of any information on the site. Your use of the site and reliance on any information on the site is solely at your own risk.
        #     """
        # )
        gr.Markdown("""
            
            If you find this tool useful and would like to support the development of such projects, please consider making a donation. Your support is greatly appreciated.

            [![Donate with PayPal](https://www.paypalobjects.com/en_US/i/btn/btn_donateCC_LG.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=M8SBRC396DPBW)

            Or, if you prefer, you can also support us through Toss at:

            <a href="https://toss.me/eichijei" target="_blank">
                <img src="https://static.toss.im/logos/png/1x/logo-toss.png" alt="Donate with Toss" style="width: 150px;">
            </a>
            """)