@import url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100..900;1,100..900&display=swap');

body {
    background-color: rgb(38, 57, 65);
    color: white;
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: normal;
    font-style: normal;
    font-variation-settings:
        "wdth" 100;
}

.character-wrapper {
    flex: none;
    position: absolute;
    top: 0;
    right: 0;
    z-index: 10;
    background: rgba(44,62,80,0.97);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 1em 1.2em;
    margin: 1em 2em 0 0;
    min-width: 180px;
    max-width: 220px;
    width: 200px;
    display: flex;
    flex-wrap: wrap;
    gap: 0.7em;
    justify-content: flex-start;
    align-items: flex-start;
}

.character {
    width: 13em;
    min-width: 11em;
    max-width: 15em;
    padding: 0.5em 0.7em;
    margin: 0;
    border-radius: 8px;
    background: rgb(194, 121, 53);
    box-shadow: 0 0 6px rgba(0,0,0,0.13);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.97em;
    gap: 0.3em;
}

.character-portrait {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    margin-bottom: 0.2em;
}

.character-name {
    font-size: 1.1em;
    font-weight: 500;
    text-align: center;
}

.character-wallet {
    font-size: 0.95em;
    color: #1a4d1a;
    text-align: center;
}

#project_transactions_form_transactions {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;

    input {
        display: none;

        & + label {
            display: block;
            margin: 10px 0;
            padding: 10px;
            background-color: #007bff;
            color: white;
            border-radius: 5px;
            cursor: pointer;

            &:hover {
                background-color: #0056b3;
            }
        }

        &:checked + label {
            background-color: #28a745;
        }
    }
}

a {
    &:visited {
        color: white;
    }
    &:hover {
        color: #007bff;
    }
    &:active {
        color: #0056b3;
    }
    &:focus {
        outline: none;
        box-shadow: 0 0 0 2px #007bff;
    }
    &:focus-visible {
        outline: none;
        box-shadow: 0 0 0 2px #007bff;
    }
    &:focus-within {
        outline: none;
        box-shadow: 0 0 0 2px #007bff;
    }
}

.journal {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    margin-top: 20px;

    /* Journal als Widget kleiner darstellen */
    max-width: 350px;
    min-width: 250px;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    border-radius: 10px;
    background: rgba(44, 62, 80, 0.85);
    padding: 1em;
    margin: 0 auto 1em auto;

    .journal-entry {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        padding: .5em;
        position: relative;
        overflow: visible;

        &:nth-child(even) {
            background-color: rgba(0, 0, 0, 0.05)
        }
        &:nth-child(odd) {
            background-color: rgba(255, 255, 255, 0.05)
        }

        .positive {
            color: #0d0;
        }
        .negative {
            color: red;
        }
        .neutral {
            color: #778899;
        }

    }
}

.journal-title-sticky {
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.95);
    z-index: 2;
    padding-bottom: 0.3em;
    margin-bottom: 0.5em;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    /* Überschrift immer ganz oben, kein Inhalt darüber */
    order: -1;
}

.journal > *:not(.journal-title-sticky) {
    /* Inhalt unterhalb der Überschrift */
    order: 0;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-form {
    background: rgba(44, 62, 80, 0.95);
    padding: 2.5em 2em 2em 2em;
    border-radius: 16px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    display: flex;
    flex-direction: column;
    min-width: 340px;
    max-width: 350px;
    width: 100%;
    gap: 1.2em;
}

.login-title {
    text-align: center;
    font-size: 2em;
    font-weight: 700;
    margin-bottom: 0.5em;
    color: #f7c873;
    letter-spacing: 1px;
}

.login-field {
    display: flex;
    flex-direction: column;
    gap: 0.3em;
}

.login-form label {
    font-weight: 500;
    color: #f7c873;
}

.login-form input.form-control {
    border-radius: 6px;
    border: none;
    padding: 0.7em;
    font-size: 1em;
    background: #2c3e50;
    color: #fff;
    margin-bottom: 0.2em;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

.login-form input.form-control:focus {
    outline: 2px solid #f7c873;
    background: #34495e;
}

.login-btn {
    background: linear-gradient(90deg, #f7c873 0%, #c27a35 100%);
    color: #222;
    font-weight: bold;
    border: none;
    border-radius: 6px;
    padding: 0.8em 0;
    font-size: 1.1em;
    margin-top: 0.5em;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}

.login-btn:hover {
    background: linear-gradient(90deg, #c27a35 0%, #f7c873 100%);
    color: #fff;
}

.login-error {
    text-align: center;
    margin-bottom: 0.5em;
}

.login-user-info {
    text-align: center;
    margin-bottom: 0.5em;
    color: #f7c873;
}

.overview-content {
    display: flex;
    flex-direction: row;
    gap: 2em;
    align-items: flex-start;
    position: relative;
    min-height: 220px; /* Platz für Charakterbox reservieren */
}

.overview-widgets {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5em;
    margin-right: 260px; /* Platz für die Charakterbox im Layout lassen, damit nichts darunter verschwindet */
}

.widget {
    background: rgba(44, 62, 80, 0.95);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    padding: 1em;
}

.widget h2 {
    font-size: 1.2em;
    color: #f7c873;
    margin-bottom: 0.5em;
}

.overview-actions {
    display: flex;
    gap: 1em;
    margin-bottom: 1.5em;
}

.overview-flex-row {
    display: flex;
    flex-direction: row;
    gap: 2em;
    align-items: flex-start;
    margin-top: 1.5em;
}

.journal-side {
    max-width: 340px;
    min-width: 220px;
    width: 100%;
    height: 40vh;
    max-height: 40vh;
    overflow-y: auto;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0,0,0,0.10);
    border-radius: 10px;
    background: rgba(44, 62, 80, 0.85);
    padding: 1em;
    margin-left: 1em;
    word-break: break-word;
    overflow-x: visible;
    position: relative;
}

@media (max-width: 900px) {
    .character-wrapper {
        position: static;
        margin: 1em auto;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }
    .overview-widgets {
        margin-right: 0;
    }
    .overview-content {
        min-height: unset;
    }
}