/* ================================
   PANELS (SHARED STYLES)
   ================================ */
.panel {
    background: rgba(12, 20, 17, 0.9);
    border: 1px solid var(--dusk);
    border-radius: 8px;
    padding: 8px 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--dusk);
    cursor: pointer;
    color: var(--bud);
    transition: color 0.2s;

    &:hover {
        color: var(--bloom);
    }

    .panel-title {
        font-weight: bold;
        font-size: 16px;

        .icon {
            margin-right: 8px;
        }
    }

    .close-btn {
        color: var(--frond);
        font-size: 18px;
        cursor: pointer;

        &:hover {
            color: var(--bloom);
        }
    }
}

/* ================================
   DAY PANEL (IN HEADER)
   ================================ */
.day-panel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1em;
    height: 100%; /* Fill panel height */

    .day-display {
        color: var(--bloom);
        font-size: var(--base-font-size);
        font-weight: bold;
        white-space: nowrap;
    }

    .time-display {
        color: var(--frond);
        font-size: var(--base-font-size);
    }

    .cog-icon,
    .audio-icon {
        cursor: pointer;
        padding: 4px;
        border-radius: 4px;
        transition: background-color 0.2s ease;

        &:hover {
            background: rgba(255, 255, 255, 0.1);
        }
    }
}

/* ================================
   TURN PANEL (IN HEADER)
   ================================ */
.turn-panel {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 1em;
    height: 100%; /* Fill panel height */

    .moves-display {
        color: var(--frond);
        font-size: var(--base-font-size);
        display: flex;
        align-items: center;
        flex-shrink: 0;
    }

    .auto-turn-label {
        display: flex;
        align-items: center;
        gap: 3px;
        color: #ccc;
        font-size: var(--base-font-size);
        flex-shrink: 0;
        margin-left: auto;

        input {
            margin: 0;
        }
    }
}

/* ================================
   UNIT PANEL (IN FOOTER)
   ================================ */
.unit-panel {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 12px;
    align-items: center;
    transition:
        opacity 0.3s ease-in-out,
        transform 0.3s ease-in-out;

    .base-panel {
        flex: 1;
        gap: 12px;

        .unit-level {
            width: 52px;
            height: 60px;
            background-color: var(--stem);
            clip-path: polygon(
                50% 0%,
                100% 25%,
                100% 75%,
                50% 100%,
                0% 75%,
                0% 25%
            );
            display: flex;
            justify-content: center;
            align-items: center;
            font-size: 30px;
            font-weight: bold;
            color: var(--bloom);
            text-shadow: 1px 1px 2px var(--night);
            flex-shrink: 0;
            align-self: center;
        }

        .unit-level.enemy {
            background-color: #ff4444;
            border-radius: 50%;
            clip-path: none;
            width: 52px;
            height: 52px;
            border: 2px solid #cc3333;
            color: rgba(12, 20, 17, 1);
        }

        .unit-name {
            flex-shrink: 0;
            font-size: 20px;
            font-weight: bold;
            color: var(--bud);
            margin-bottom: 4px;
            transition: color 0.2s;

            &:hover {
                color: var(--bloom);
            }
        }

        /* Unit stats container */
        > div:last-child {
            flex: 1;
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
            gap: 16px;

            > div {
                display: flex;
                align-items: center;
                gap: 6px;

                > span:first-child {
                    font-size: var(--base-font-size);
                    color: var(--frond);
                    font-weight: normal;
                }

                > span:last-child {
                    font-size: var(--base-font-size);
                    color: var(--bud);
                    font-weight: bold;
                }

                &.enemy > span:first-child {
                    color: #ff4444;
                }

                &.enemy > span:last-child {
                    color: #ff4444;
                }
            }
        }
    }
}

/* ================================
   TILE PANEL (IN FOOTER)
   ================================ */
.tile-panel {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition:
        opacity 0.3s ease-in-out,
        transform 0.3s ease-in-out;

    .terrain-type {
        font-size: 12px;
        font-weight: bold;
        color: var(--bud);
        text-align: center;
        line-height: 1;
        text-transform: capitalize;
    }

    .terrain-tile-color {
        margin: 4px 0;
            width: 32px;
            height: 32px;
            border: 1px solid var(--dusk);
            background-color: var(--shade); /* Default background */
            clip-path: polygon(
                50% 0%,
                93.3% 25%,
                93.3% 75%,
                50% 100%,
                6.7% 75%,
                6.7% 25%
            );
            display: flex;
            justify-content: center;
            align-items: center;
            position: relative;

        .terrain-biomass-number {
            font-size: var(--base-font-size);
            font-weight: bold;
            color: var(--night);
            text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.8);
        }
    }

    .terrain-position {
        font-size: 10px;
        font-weight: normal;
        color: var(--frond);
        text-align: center;
        line-height: 1;
    }
}

/* ================================
   ACTION PANEL (IN FOOTER)
   ================================ */
.action-panel {
    display: flex;
    justify-content: center;
    align-items: center;

    .action-buttons {
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
        justify-content: center;
    }
}
