/* ========================================================================= */
/* GRUNDLEGENDE STILE & BODY LAYOUT */
/* ========================================================================= */
html,
body {
    overflow-x: hidden;
}

body {
    background: #fcfcfc;
    padding: 2em;
    max-width: 1200px;
    font-family: 'Times New Roman', Times, serif;
    display: block;
    margin-left: auto;
    margin-right: auto;
    /*   background-image: url("hintergrund.png") !important;
    background-repeat: no-repeat;
    background-size: auto;
    background-position: center center; */
}


header {
    margin-bottom: 2em;
    background: #4CAF50;
    color: black;
    padding: 1em 0;
    text-align: center;
    border-radius: 8px;
}



footer {
    background: #4CAF50;
    color: black;
    padding: 1em 0;
    text-align: center;
    border-radius: 8px;
    margin-top: 2em;
    /* Nur Footer braucht Abstand nach oben */
    font-weight: bold;
}

footer a {
    margin: 0.5em 0;
    padding: 0.5em 0;
    text-decoration: none;
    color: black;
    display: block;
    text-align: center;
    background-color: #4CAF50;
    font-weight: bold;
    display: inline;
}





nav {
    display: none;
    flex-direction: column;
    width: 90%;
}

nav.open {
    display: inline;
}

nav a {
    margin: 0.5em 0;
    padding: 0.5em 0;
    text-decoration: none;
    color: black;
    display: block;
    text-align: center;
    background-color: #4CAF50;
    font-weight: bold;
}


/* ========================================================================= */
/* MOBILE HAMBURGER MENU */
/* ========================================================================= */

#mobile-menu-toggle {
    display: block;
    cursor: pointer;
    text-align: center;
    padding: 10px;
    font-size: 1.5em;
    color: black;
    background-color: #4CAF50;
    border: none;
    width: 50px;
    height: 50px;
    line-height: 25px;
    margin: 0 auto;
    border-radius: 50%;
}

/* ========================================================================= */
/* LAYOUT-WRAPPER UND FLEX-STRUKTUR */
/* ========================================================================= */

.main-content-wrapper {
    width: 100%;
    margin-bottom: 20px;
}

.main-content-wrapper hr {
    width: 100%;
    border: 0;
    height: 1px;
    background-color: #ccc;
    margin: 10px 0;
    padding: 0;
}

.content-container {
    display: flex;
    gap: 20px;
    margin: 0 auto;
    align-items: flex-start;
    width: 100%;
}

.rating-details-top {
    flex: 2 1 60%;
}

.image-display {
    flex: 1 1 40%;
    max-height: 350px;
    overflow: hidden;
    flex-shrink: 0;
    margin-top: 0;
}

.image-display img {
    width: 100%;
    height: auto;
    display: block;
    border: 1px solid black;
}

.rating-details-bottom {
    width: 100%;
    margin-top: 20px;
}

/* ========================================================================= */
/* DETAILANSICHT STILE */
/* ========================================================================= */

.detail-content-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    margin-bottom: 20px;
    width: 100%;
}

.detail-text-column {
    flex: 2 1 60%;
}

.detail-image-column {
    flex-shrink: 0;
    width: 300px;
    max-height: 300px;
    overflow: hidden;
    flex: 1 1 40%;
}

.detail-image-column img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid #ccc;
}

/* ========================================================================= */
/* FORMULAR LAYOUT - MOBILE FIRST */
/* ========================================================================= */

.form-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.form-fields {
    flex: 1;
    width: 100%;
}

.form-main {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    width: 100%;
}

.filter-row {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 90%;
    align-items: stretch;
    justify-self: center;
}

.field-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.field-group input[type="text"],
.field-group input[type="date"],
.field-group input[type="number"],
.field-group textarea,
.field-group select {
    width: 100%;
    box-sizing: border-box;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.field-group label {
    font-weight: bold;
    margin-bottom: 3px;
}

.button-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    align-items: center;
}

/* ========================================================================= */
/* MOBILE LAYOUT ANPASSUNGEN (Unter 880px) */
/* ========================================================================= */
@media (max-width: 879px) {
    body {
        padding: 1em;
    }

    .main-content-wrapper {
        align-items: stretch;
    }

    .content-container {
        flex-direction: column;
        align-items: center;
    }

    .detail-content-container {
        flex-direction: column;
        align-items: center;
    }

    .image-display {
        width: 100%;
        max-width: 300px;
        max-height: 200px;
        margin-top: 15px;
        margin-bottom: 15px;
        order: 2;
    }

    .detail-image-column {
        width: 100%;
        max-width: 300px;
        max-height: 200px;
        margin-top: 15px;
        margin-bottom: 15px;
        order: 2;
    }

    .rating-details-top {
        flex: 1 1 100%;
        width: 100%;
        order: 1;
    }

    .detail-text-column {
        flex: 1 1 100%;
        width: 100%;
        order: 1;
    }

    .rating-details-bottom {
        width: 100%;
    }

    .predi-container,
    .data-table {
        min-width: 100%;
        overflow-x: auto;
    }

    .filter-row {
        flex-direction: column;
        gap: 15px;
        width: 100%;
    }

    .field-group {
        width: 100%;
    }

    .button-row {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .mobile-only {
        display: block !important;
    }

    .predi-container.open {
        display: flex;
        overflow-x: auto;
    }

    .hide-on-mobile {
        display: none !important;
    }

    .predi-row .predi-cell.turniername {
        flex: 2 1 150px;
        border-right: 1px solid #4CAF50;
    }

    .predi-row .predi-cell.datum {
        flex: 1 1 80px;
        text-align: center;
        border-right: 1px solid #4CAF50;
    }

    .predi-row .predi-cell.editiern {
        flex: 0 0 70px;
        text-align: center;
        border-right: none;
    }

    .predi-row .predi-cell:nth-child(1),
    .predi-row .predi-cell:nth-child(3),
    .predi-row .predi-cell.sternezahl {
        min-width: initial;
    }
}

/* ========================================================================= */
/* MEDIA QUERY FÜR DESKTOP-ANSICHT (Breiter als 880px) */
/* ========================================================================= */

@media (min-width: 880px) {
    body {
        min-width: 880px;
    }

    #mobile-menu-toggle {
        display: none;
    }

    nav {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        height: 15px;
        /* min-width: 960px; 21.10. 15:54 */
        width: 98%;
        gap: 10px;
        background-color: #4CAF50;
        border-radius: 15px;
        font-weight: bold;
    }

    nav.open {
        display: flex;
    }

    nav a.button {
        display: inline-block;
        padding: 0.5em 1em;
        margin: 0;
        border-radius: 25px;
        color: #000000;
        background-color: #4CAF50;
        gap: 10px;
    }

    .filter-row {
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
        align-items: flex-end;
        gap: 15px;
        width: 90%;
    }

    .filter-row .field-group {
        flex: 1 1 0;
        min-width: 150px;
        width: auto;
    }

    .filter-row-comment {
        flex-direction: column;
    }

    .filter-row-comment .field-group {
        flex: 1 1 100%;
        width: 90%;
    }

    .button-row {
        flex-direction: row;
        justify-content: center;
        width: 90%;
    }

    #desktop {
        display: table-cell !important;
    }

    #mobile {
        display: none !important;
    }

    .mobile-only {
        display: none !important;
    }

    .hide-on-mobile {
        display: initial;
    }

    .data-table-center {
        display: flex !important;
    }

    .table-cell.col-date {
        flex: 1 0 100px;
        text-align: center;
    }

    .table-cell.col-stars,
    .table-cell.col-action {
        flex: 0 0 100px;
        text-align: center;
    }

    /* Desktop: Predi-Spalten auf volle Breite verteilen */
    .predi-container {
        overflow-x: visible !important;
    }

    .predi-cell.bewerten-id {
        flex: 0 0 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        text-align: center;
    }

    .predi-cell.turniername {
        flex: 3 1 auto !important;
        /* min-width: 150px !important; Thomas */
    }

    .predi-cell.ort {
        flex: 2 1 auto !important;
        min-width: 120px !important;
    }

    .predi-cell.datum {
        flex: 0 0 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        text-align: center;
    }

    .predi-cell.sternezahl {
        flex: 0 0 70px !important;
        min-width: 70px !important;
        max-width: 70px !important;
        text-align: center;
    }

    .predi-cell.editiern {
        flex: 0 0 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        text-align: center;
        border-right: none;
    }
}

/* ========================================================================= */
/* RESTLICHE STILE (Boxen, Tabellen, etc.) */
/* ========================================================================= */

.autocomplete-items {
    position: absolute;
    border: 1px solid #ccc;
    background-color: white;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    width: 100%;
}

.autocomplete-item {
    padding: 8px;
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: #e9e9e9;
}

.ort-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.main-container {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 98%;
    margin-bottom: 20px;
}

.map-container {
    flex-shrink: 0;
}

.filter-form {
    margin-bottom: 2em;
    padding: 1em;
    border: 1px solid #ccc;
    border-radius: 5px;
    background-color: #f9f9f9;
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

/* Box Stile */
.box {
    background-color: rgb(211, 130, 144);
    border: 2px solid black;
    border-radius: 25px;
    padding: 20px;
    margin: 10px;
    box-shadow: #c90a0a 5px 5px 15px;
}

.loginbox-container {
    display: flex;
    justify-content: center;
    /* Horizontale Zentrierung */
}


.loginbox {
    background-color: rgb(211, 130, 144);
    border: 2px solid black;
    border-radius: 25px;
    padding: 20px;
    margin: 10px;
    display: inline-block;
    box-shadow: #c90a0a 5px 5px 15px;
}

.box_center {
    background-color: rgb(211, 130, 144);
    border: 2px solid black;
    border-radius: 25px;
    padding: 20px;
    margin: 10px;
    text-align: center;
    box-shadow: #c90a0a 5px 5px 15px;
}

.ratings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
    align-items: stretch;
    margin-top: 20px;
}

.rating-box {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 1.5em;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    flex: 1 1 300px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.rating-box .rating-text {
    margin-bottom: 10px;
}

.rating-box h3 {
    margin-top: 0;
    color: #333;
}

.rating-box p {
    margin: 0.5em 0;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    text-align: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    margin: auto;
    display: block;
    position: relative;
    top: 50%;
    transform: translateY(-50%);
}

.rating-text {
    flex: 1;
}

.rating-image {
    width: 150px;
    height: auto;
    border-radius: 5px;
}

.row {
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #ccc;
    padding: 10px 0;
}

.header-row {
    font-weight: bold;
    background-color: #f2f2f2;
    padding: 10px 0;
}

.cell {
    flex: 1;
    padding: 0 5px;
    box-sizing: border-box;
    word-wrap: break-word;
}

.comment-container {
    width: 100%;
}

.kommentar {
    width: 100%;
}

.full-width-container {
    width: 90%;
    margin: 0 auto;
}

.input-container {
    width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.input-container.focused {
    overflow: visible;
    text-overflow: initial;
    white-space: normal;
}

.field-sterne {
    display: flex;
    flex-direction: row;
}

@media (max-width: 768px) {
    .row {
        flex-direction: column;
    }

    .cell {
        padding: 5px;
    }
}

.center {
    text-align: center;
}

/* Button Basis-Stile */
.button {
    background: #4CAF50;
    color: black;
    border: none;
    padding: 0.5em 1em;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.3s, color 0.3s;
}

.button:hover {
    border-radius: 25px;
    justify-content: center;
    color: #c90a0a;
    background-color: #4CAF50;
    gap: 10px;
}

.button_ori {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 0.5em 1em;
}

.sterne {
    width: 40px;
    background-color: #eee;
}

/* ========================================================================= */
/* TABELLEN-STILE (PREDI & DATA) */
/* ========================================================================= */

.predi-container {
    width: 100%;
    margin: 20px auto;
    border: 1px solid #4CAF50;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.predi-row {
    display: flex;
    border-bottom: 1px solid #4CAF50;
    align-items: center;
}

.predi-header-row {
    font-weight: bold;
    background-color: #f2f2f2;
    white-space: nowrap;
}

.predi-cell {
    padding: 5px 5px;
    text-align: left;
    border-right: 1px solid #4CAF50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    word-break: break-word;
}

.predi-cell.bewerten-id {
    flex: 0 0 40px;
    text-align: center;
}

.predi-cell.turniername {
    flex: 1 1 50px;
}

.predi-cell.ort {
    flex: 1 1 50px;
}

.predi-cell.datum {
    flex: 0 0 100px;
    text-align: center;
}

.predi-cell.sternezahl {
    flex: 0 0 40px;
    text-align: center;
}

.predi-cell.editiern {
    border-right: none;
    flex: 0 0 70px;
    text-align: center;
}

.data-table {
    width: 100%;
    margin: 20px auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.data-table-center {
    /* width: fit-content; thomas */
    width: inherit;

    margin-left: auto;
    margin-right: auto;
    border: 1px solid #ccc;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.table-row {
    display: flex;
    border-bottom: 1px solid #ccc;
    align-items: center;
    min-width: 300px;
}

.table-header {
    font-weight: bold;
    background-color: #f2f2f2;
}

.table-cell {
    padding: 5px 5px;
    text-align: left;
    border-right: 1px solid #4CAF50;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-sizing: border-box;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.table-cell.col-id {
    flex: 0 0 40px;
    text-align: center;
}

.table-cell.col-date {
    flex: 1 0 50px;
    text-align: center;
}

.table-cell.col-stars,
.table-cell.col-action {
    flex: 0 0 70px;
    text-align: center;
}

.table-cell:last-child {
    border-right: none;
}

/* Thomas21.10.
.data-table-center {
    display: none;
}

.data-table-center#mobile {
    display: flex;
    flex-wrap: wrap;
}

.data-table-center.open {
    display: flex;
    flex-wrap: wrap;
}
*/
.small {
    font-size: x-small;
    font-family: sans-serif;
}

.xx-small {
    font-size: .75em;
    font-family: sans-serif;
}

.gesammtbewertung-row {
    padding-left: 50px;
}

/* Input Box Stile */
.input-box {
    position: relative;
    width: 280px;
}

.input-box input {
    width: 100%;
    height: 40px;
    padding: 5px 5px;
    font-size: 14px;
    color: black;
    letter-spacing: 2px;
    margin-bottom: 30px;
    margin-left: 15px;
    border: 2px solid #4CAF50;
    border-radius: 10px;
    outline: none;
    background: transparent;
    transition: all 0.3s ease;
}

.input-box input:focus {
    border-color: #188ccf;
    box-shadow: 0 0 5px rgba(24, 140, 207, 0.4);
    left: 15px;
}

.input-box label {
    position: absolute;
    top: 14px;
    font-size: 16px;
    color: #333;
    pointer-events: none;
    transition: all 0.3s ease;
    padding: 0 25px;
}

.input-box input:focus+label,
.input-box input:valid+label {
    top: -14px;
    color: #188ccf;
    font-size: 12px;
}

/* Mobile/Desktop Toggle */
#desktop {
    display: none;
}

#mobile {
    display: table-cell;
}