"""ASCII logos for different operating systems and distributions."""

from typing import List


def get_macos_logo() -> List[str]:
    """Return the macOS ASCII logo."""
    return [
        "                  ,MMMM.          ",
        "                .MMMMMM           ",
        "                MMMMM,            ",
        "      .;MMMMM:' MMMMMMMMMM;.      ",
        "    MMMMMMMMMMMMNWMMMMMMMMMMM:    ",
        "  .MMMMMMMMMMMMMMMMMMMMMMMMWM.    ",
        "  MMMMMMMMMMMMMMMMMMMMMMMMM.      ",
        " ;MMMMMMMMMMMMMMMMMMMMMMMM:       ",
        " :MMMMMMMMMMMMMMMMMMMMMMMM:       ",
        " .MMMMMMMMMMMMMMMMMMMMMMMMM.      ",
        "  MMMMMMMMMMMMMMMMMMMMMMMMMMM.    ",
        "   .MMMMMMMMMMMMMMMMMMMMMMMMMM.   ",
        "     MMMMMMMMMMMMMMMMMMMMMMMM     ",
        "      ;MMMMMMMMMMMMMMMMMMMM.      ",
        "        .MMMM,.    .MMMM,.        ",
    ]


def get_linux_logo() -> List[str]:
    """Return a generic Linux/Tux ASCII logo."""
    return [
        "         .88888888:.           ",
        "        88888888.88888.        ",
        "      .8888888888888888.       ",
        "      888888888888888888       ",
        "      88' _`88'_  `88888       ",
        "      88 88 88 88  88888       ",
        "      88_88_::_88_:88888       ",
        "      88:::,::,:::::8888       ",
        "      88`:::::::::'`8888       ",
        "     .88  `::::'    8:88.      ",
        "    8888            `8:888.    ",
        "  .8888'             `888888.  ",
        " .8888:..  .::.  ...:'8888888: ",
        ".8888.'     :'     `'::`88:88. ",
        ".888'                    `8:88.",
    ]


def get_ubuntu_logo() -> List[str]:
    """Return the Ubuntu ASCII logo."""
    return [
        "            .-/+oossssoo+/-.               ",
        "        `:+ssssssssssssssssss+:`           ",
        "      -+ssssssssssssssssssyyssss+-         ",
        "    .ossssssssssssssssss+:.  .ossssso.     ",
        "   /ssssssssssshdmmNNmmyNMMMMhssssss/      ",
        "  +ssssssssshmydMMMMMMMNddddyssssssss+     ",
        " /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    ",
        ".ssssssssdMMMNhsssssssssshNMMMdssssssss.   ",
        "+sssshhhyNMMNyssssssssssssyNMMMysssssss+   ",
        "ossyNMMMNyMMhsssssssssssssshmmmhssssssso   ",
        "ossyNMMMNyMMhsssssssssssssshmmmhssssssso   ",
        "+sssshhhyNMMNyssssssssssssyNMMMysssssss+   ",
        ".ssssssssdMMMNhsssssssssshNMMMdssssssss.   ",
        " /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    ",
        "  +sssssssssdmydMMMMMMMMddddyssssssss+     ",
    ]


def get_debian_logo() -> List[str]:
    """Return the Debian ASCII logo."""
    return [
        "       _,met$$$$$gg.          ",
        "    ,g$$$$$$$$$$$$$$$P.       ",
        '  ,g$$P"     """Y$$."`.       ',
        " ,$$P'              `$$$.     ",
        "',$$P       ,ggs.     `$$b:   ",
        "`d$$'     ,$P\"'   .    $$$    ",
        " $$P      d$'     ,    $$P    ",
        " $$:      $$.   -    ,d$$'    ",
        " $$;      Y$b._   _,d$P'      ",
        ' Y$$.    `.`"Y$$$$P"\'         ',
        ' `$$b      "-.__              ',
        "  `Y$$                        ",
        "   `Y$$.                      ",
        "     `$$b.                    ",
        "       `Y$$b.                 ",
    ]


def get_fedora_logo() -> List[str]:
    """Return the Fedora ASCII logo."""
    return [
        "             .',;::::;,'.             ",
        "         .';:cccccccccccc:;,.         ",
        "      .;cccccccccccccccccccccc;.      ",
        "    .:cccccccccccccccccccccccccc:.    ",
        "  .;ccccccccccccc;.:dddl:.;ccccccc;.  ",
        " .:ccccccccccccc;OWMKOOXMWd;ccccccc:.  ",
        ".:ccccccccccccc;KMMc;cc;xMMc:ccccccc:. ",
        ",cccccccccccccc;MMM.;cc;,WW::cccccccc, ",
        ":cccccccccccccc;MMM.;cccccccccccccccc: ",
        ":ccccccc;oxOOOo;MMM.;ccccccccccccccccc:",
        "cccccc;0MMKxdd:;MMMkdddddddcccccccccccc",
        "ccccc:XM0';cccc;MMMMMMMMMMcccccccccccc;",
        "ccccc;MMo;ccccc;MMMMMMMMMMcccccccccccc;",
        "ccccc;0MNc.ccc.xMMd,,,,,,,cccccccccccc;",
        "cccccc;dNMWXXXWM0:cccccccccccccccccccc:",
    ]


def get_arch_logo() -> List[str]:
    """Return the Arch Linux ASCII logo."""
    return [
        "                   -`                  ",
        "                  .o+`                 ",
        "                 `ooo/                 ",
        "                `+oooo:                ",
        "               `+oooooo:               ",
        "               -+oooooo+:              ",
        "             `/:-:++oooo+:             ",
        "            `/++++/+++++++:            ",
        "           `/++++++++++++++:           ",
        "          `/+++ooooooooooooo/`         ",
        "         ./ooosssso++osssssso+`        ",
        "        .oossssso-````/ossssss+`       ",
        "       -osssssso.      :ssssssso.      ",
        "      :osssssss/        osssso+++.     ",
        "     /ossssssss/        +ssssooo/-     ",
    ]


def get_redhat_logo() -> List[str]:
    """Return the Red Hat ASCII logo."""
    return [
        "           .MMM..:MMMMMMM              ",
        "          MMMMMMMMMMMMMMMMMM            ",
        "          MMMMMMMMMMMMMMMMMMMM.         ",
        "         MMMMMMMMMMMMMMMMMMMMMM         ",
        "        ,MMMMMMMMMMMMMMMMMMMMMM:        ",
        "        MMMMMMMMMMMMMMMMMMMMMMMM        ",
        "  .MMMM'  MMMMMMMMMMMMMMMMMMMMMM        ",
        " MMMMMM    `MMMMMMMMMMMMMMMMMMMM.       ",
        "MMMMMMMM      MMMMMMMMMMMMMMMMMM .      ",
        "MMMMMMMMM.       `MMMMMMMMMMMMM' MM.    ",
        "MMMMMMMMMMM.                     MMMM   ",
        "`MMMMMMMMMMM.                 .MMMMMM.  ",
        " `MMMMMMMMMMM.              .MMMMMMMM.  ",
        "  `MMMMMMMMMMM           .MMMMMMMMMM.   ",
        "    MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM    ",
    ]


def get_popos_logo() -> List[str]:
    """Return the Pop!_OS ASCII logo."""
    return [
        "             /////////////             ",
        "         /////////////////////         ",
        "      ///////*767////////////////      ",
        "    //////7676767676*//////////////    ",
        "   /////76767//7676767//////////////   ",
        "  /////767676///*76767///////////////  ",
        " ///////767676///76767.///7676*//////  ",
        "/////////767676//76767//767676////////*",
        "//////////76767676767////76767/////////",
        "///////////76767676//////7676//////////",
        "////////////,7676,///////767///////////",
        "/////////////*7676///////76////////////",
        "///////////////7676////////////////////",
        " ///////////////7676///767//////////// ",
        "  //////////////////////'////////////  ",
    ]


def get_manjaro_logo() -> List[str]:
    """Return the Manjaro ASCII logo."""
    return [
        "██████████████████  ████████          ",
        "██████████████████  ████████          ",
        "██████████████████  ████████          ",
        "██████████████████  ████████          ",
        "████████            ████████          ",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
        "████████  ████████  ████████  ████████",
    ]


def get_centos_logo() -> List[str]:
    """Return the CentOS ASCII logo."""
    return [
        "                 ..                    ",
        "               .PLTJ.                  ",
        "              <><><><>                 ",
        "     KKSSV' 4KKK LJ KKKL.'VSSKK        ",
        "     KKV' 4KKKKK LJ KKKKAL 'VKK        ",
        "     V' ' 'VKKKK LJ KKKKV' ' 'V        ",
        "     .4MA.' 'VKK LJ KKV' '.4Mb.        ",
        "   . KKKKKA.' 'V LJ V' '.4KKKKK .      ",
        " .4D KKKKKKKA.'' LJ ''.4KKKKKKK FA.    ",
        "<QDD ++++++++++++  ++++++++++++ GFD>   ",
        " 'VD KKKKKKKK'.. LJ ..'KKKKKKKK FV     ",
        "   ' VKKKKK'. .4 LJ K. .'KKKKKV '      ",
        "      'VK'. .4KK LJ KKA. .'KV'         ",
        "     A. . .4KKKK LJ KKKKA. . .4        ",
        "     KKA 'KKKKK LJ KKKKK' AKK          ",
    ]


def get_windows_logo() -> List[str]:
    """Return the Windows ASCII logo."""
    return [
        "                                ..,    ",
        "                    ....,,:;+ccllll    ",
        "      ...,,+:;  cllllllllllllllllll    ",
        ",cclllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "                                       ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "llllllllllllll  lllllllllllllllllll    ",
        "`'ccllllllllll  lllllllllllllllllll    ",
    ]


def get_logo_for_os(os_name: str, distro_name: str = "") -> List[str]:
    """
    Get the appropriate logo based on OS and distribution.

    Args:
        os_name: The operating system name (Darwin, Linux, Windows)
        distro_name: The distribution name (ubuntu, debian, fedora, etc.)

    Returns:
        List of strings representing the ASCII logo
    """
    if os_name == "Darwin":
        return get_macos_logo()
    elif os_name == "Windows":
        return get_windows_logo()
    elif os_name == "Linux":
        # Normalize distro name to lowercase for comparison
        distro_lower = distro_name.lower()

        if "ubuntu" in distro_lower:
            return get_ubuntu_logo()
        elif "debian" in distro_lower:
            return get_debian_logo()
        elif "fedora" in distro_lower:
            return get_fedora_logo()
        elif (
            "red hat" in distro_lower
            or "redhat" in distro_lower
            or "rhel" in distro_lower
        ):
            return get_redhat_logo()
        elif "arch" in distro_lower:
            return get_arch_logo()
        elif "manjaro" in distro_lower:
            return get_manjaro_logo()
        elif "pop" in distro_lower:
            return get_popos_logo()
        elif "centos" in distro_lower:
            return get_centos_logo()
        else:
            # Default to generic Linux logo
            return get_linux_logo()
    else:
        # Fallback to generic Linux logo for unknown OS
        return get_linux_logo()
