<mat-card class="my-3">
    <mat-card-header class="text-bg-warn d-flex rounded-top py-2 px-3">
        <div class="flex-fill">
            <mat-card-title>
                Guild War Day {{ warInfo.day }} VS {{ warInfo.clanEnemyName }}
            </mat-card-title>
        </div>
        <span class="flex-spacer"></span>
        <div class="align-self-center text-end">
            <span class="fs-5 font-light"> {{ warInfo.endTime | date: 'dd/MM/yyyy HH:mm:ss' }}</span>
        </div>
    </mat-card-header>
    <mat-card-content>
        <mat-divider class="mb-3"></mat-divider>
        <div class="d-flex align-items-center ps-2 mb-3">
            <dl class="dl-horizontal dl-large mt-3 mb-0">
                <dt>Server End Time</dt>
                <dd class="font-monospace">{{ warInfo.endTime | date: 'dd/MM/yyyy HH:mm:ss' }}</dd>
                <dt>Next War Time</dt>
                <dd class="font-monospace">{{ warInfo.nextWarTime| date: 'dd/MM/yyyy HH:mm:ss' }}</dd>
                <dt>Next Lock Time</dt>
                <dd class="font-monospace">{{ warInfo.nextLockTime | date: 'dd/MM/yyyy HH:mm:ss' }}</dd>
            </dl>
        </div>
    </mat-card-content>
</mat-card>
<mat-divider class="my-3"></mat-divider>
<mat-card class="my-3">
    <mat-card-header class="text-bg-danger d-flex rounded-top py-2 px-3">
        <div class="flex-fill">
            <mat-card-title>
                {{ warInfo.clanEnemyName }} Members
            </mat-card-title>
        </div>
        <span class="flex-spacer"></span>
        <div class="align-self-center text-end">
            <span class="fs-5 font-light">{{ subtitle }} {{ warInfo.endTime | date: 'dd/MM/yyyy HH:mm:ss' }}</span>
        </div>
    </mat-card-header>
    <mat-card-content class="p-0">
        <table class="table table-striped table-condensed border-top border-light">
            <thead>
                <tr role="row" class="text-bg-danger bg-opacity-50">
                    <th class="align-middle w-auto ps-4">
                        <div class="text-start">
                            #
                        </div>
                    </th>
                    <th scope="col" class="align-middle w-auto">
                        <div class="d-flex align-items-center text-start">
                            Name
                            <mat-icon fontIcon="arrow_upward" class="ms-1 icon-xsmall"></mat-icon>
                        </div>
                    </th>
                    <th scope="col" class="align-middle w-auto">
                        <div class="text-start">
                            Last Login
                        </div>
                    </th>
                    <th class="align-middle w-auto">
                        <div class="text-end">
                            Heroes
                        </div>
                    </th>
                    <th class="align-middle w-auto pe-4">
                        <div class="text-end">
                            Titans
                        </div>
                    </th>
                </tr>
            </thead>
            <tbody>
                @for (enemy of getEnemies(); track enemy; let index = $index) {
                    <tr role="row" class="align-middle{{ enemy.champion ? '' : ' text-muted' }}">
                        <td class="cell text-start ps-4">
                            {{ (index+1) }}
                        </td>
                        <td class="cell text-start">
                            <div class="d-flex{{ enemy.champion ? ' text-green' : '' }}">
                                <mat-icon [fontIcon]="enemy.champion ? 'gpp_good' : 'gpp_bad'" class="me-2 icon-small"></mat-icon>
                                {{ enemy.name }}
                            </div>
                        </td>
                        <td class="cell font-monospace text-start">
                            <span class="me-3">{{ enemy.lastLoginTime + '000' | date: 'dd/MM HH:mm' }}</span>
                        </td>
                        <td class="cell font-monospace text-end">
                            {{ enemy.heroes.power | number : '1.0' }}
                        </td>
                        <td class="cell font-monospace text-end">
                            {{ enemy.titans.power | number : '1.0' }}
                        </td>
                    </tr>
                }
            </tbody>
        </table>
    </mat-card-content>
</mat-card>
<mat-divider class="my-3"></mat-divider>
<div class="row g-0">
    <div class="col col-md-6 pe-md-2">
        <mat-card>
            <mat-card-header class="bg-accent text-navy d-flex rounded-top py-2 px-3">
                <div class="flex-fill">
                    <mat-card-title>
                        {{ warInfo.clanEnemyName }} Heroes {{ title }}
                    </mat-card-title>
                </div>
                <span class="flex-spacer"></span>
                <div class="align-self-center text-end">
                    <span class="fs-5 font-light">{{ subtitle }}</span>
                </div>
            </mat-card-header>
            <mat-card-content class="pt-3">
                <app-fortification-card-content type="heroes" [fortification]="getLighthouse()" [members]="guildEnemies"></app-fortification-card-content>
                <app-fortification-card-content type="heroes" [fortification]="getBarracks()" [members]="guildEnemies"></app-fortification-card-content>
                <app-fortification-card-content type="heroes" [fortification]="getMageAcademy()" [members]="guildEnemies"></app-fortification-card-content>
                <mat-divider class="my-3"></mat-divider>
                <app-fortification-card-content type="heroes" [fortification]="getFoundry()" [members]="guildEnemies"></app-fortification-card-content>
                <mat-divider class="my-3"></mat-divider>
                <app-fortification-card-content type="heroes" [fortification]="getCitadel()" [members]="guildEnemies"></app-fortification-card-content>
            </mat-card-content>
        </mat-card>
    </div>
    <div class="col col-md-6 ps-md-2">
        <mat-card>
            <mat-card-header class="bg-accent text-navy d-flex rounded-top py-2 px-3">
                <div class="flex-fill">
                    <mat-card-title>
                        {{ warInfo.clanEnemyName }} Titans {{ title }}
                    </mat-card-title>
                </div>
                <span class="flex-spacer"></span>
                <div class="align-self-center text-end">
                    <span class="fs-5 font-light">{{ subtitle }}</span>
                </div>
            </mat-card-header>
            <mat-card-content class="pt-3">
                <app-fortification-card-content type="titans" [fortification]="getBridge()" [members]="guildEnemies"></app-fortification-card-content>
                <mat-divider class="my-3"></mat-divider>
                <app-fortification-card-content type="titans" [fortification]="getGatesOfNature()" [members]="guildEnemies"></app-fortification-card-content>
                <app-fortification-card-content type="titans" [fortification]="getBastionOfFire()" [members]="guildEnemies"></app-fortification-card-content>
                <app-fortification-card-content type="titans" [fortification]="getBastionOfIce()" [members]="guildEnemies"></app-fortification-card-content>
                <mat-divider class="my-3"></mat-divider>
                <app-fortification-card-content type="titans" [fortification]="getSpringOfElements()" [members]="guildEnemies"></app-fortification-card-content>
            </mat-card-content>
        </mat-card>
    </div>
</div>