/* Layout Overrides */
body::before {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://deadjackdaw.com/assets/images/background_tiles/grass_texture_repeating_patter_by_mas_d188zr-375w-2x.jpg');
}

.master-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: center;
    gap: 20px;
    width: 95vw;
    max-width: 1300px;
}

.trainer-directory-layout {
    display: flex;
    flex-direction: row;
    gap: 20px;
    width: 100%;
    height: 100%;
    align-items: stretch;
}

.trainer-main {
    flex: 4;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.trainer-sidebar {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.main-title {
    min-height: auto;
    margin-top: 15px;
    margin-bottom: 10px;
}

/* Header */
.trainer-header {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #000;
    padding-bottom: 10px;
    align-items: flex-end;
}

.trainer-sprite {
    width: 80px;
    height: 80px;
    image-rendering: pixelated;
    object-fit: contain;
    object-position: bottom center;
    align-self: flex-end;
}

/* Typography */
.trainer-bio h3 {
    margin: 0 0 5px 0;
}

.trainer-bio p {
    margin: 2px 0;
    font-size: 1.1em;
    line-height: 1.4;
}

/* Sidebar Controls */
.companion-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
    overflow-y: auto;
    padding-right: 5px;
}

.trainer-controls select {
    font-family: inherit;
    font-size: 1em;
    padding: 5px;
    border: 2px solid #000;
    width: 100%;
}

/* Tabs */
.tabs-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    flex: 1;
}

.tab-labels {
    display: flex;
    border-bottom: 2px solid #000;
}

.tab-label {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f0f0f0;
    border: 2px solid #000;
    border-bottom: none;
    margin-right: 5px;
    font-family: inherit;
    text-transform: uppercase;
    transition: background-color 0.1s;
}

.tab-radio {
    display: none;
}

.tab-radio:checked + .tab-label {
    background-color: #fff;
    border-bottom: 2px solid #fff;
    margin-bottom: -2px;
}

.tab-content {
    display: none;
    padding: 15px;
    border: 2px solid #000;
    background-color: #fff;
    box-sizing: border-box;
    height: 100%;
    overflow-y: auto;
}

/* Team Grid */
.team-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    align-content: start;
}

/* Cards */
.team-member-detailed {
    border: 2px solid #000;
    padding: 15px;
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
    height: 100%;
}

.team-member-detailed img {
    width: 96px;
    image-rendering: pixelated;
}

/* Showdown Output */
.showdown-text {
    font-family: "VCR OSD Mono", Courier, monospace;
    width: 100%;
    height: 120px;
    resize: none;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 10px;
    margin-top: 10px;
    box-sizing: border-box;
    font-size: 0.85em;
}

/* Companion Display */
.team-member {
    border: 1px solid #ccc;
    padding: 5px;
    text-align: center;
    width: 80px;
}

.team-member img {
    width: 64px;
    image-rendering: pixelated;
}

.team-member p {
    font-size: 0.8em;
    margin: 5px 0 0 0;
}

/* Viewport Adaptability */
@media (max-width: 900px) {
    .master-layout {
        flex-direction: column;
        align-items: center;
    }

    .trainer-directory-layout {
        flex-direction: column;
        width: 100%;
    }

    .side-nav {
        flex-direction: row;
        width: 100%;
        justify-content: center;
        margin-bottom: 20px;
    }

    .trainer-main, .trainer-sidebar {
        width: 100%;
    }

    .team-grid {
        grid-template-columns: 1fr;
    }
}