/* ----------------------------------------
   Grundlegendes Styling
---------------------------------------- */
body {
    font-family: Arial, sans-serif;
    margin: 20px;
    background: #f7f7f7;
}

/* ----------------------------------------
   Grid-Liste
---------------------------------------- */
.grid-container {
    display: grid;
    grid-template-columns: 3fr 1fr 2fr 1fr; /* Titel | Preis | Datum | Details */
    gap: 10px;
    background: white;
    padding: 10px;
    border-radius: 5px;
}

.grid-header {
    font-weight: bold;
    background: #f0f0f0;
    padding: 10px;
    border-radius: 5px;
}

.grid-item {
    padding: 10px;
    border-bottom: 1px solid #ddd;
    word-wrap: break-word;
}

.grid-row:nth-child(even) .grid-item {
    background: #fafafa;
}

/* Details Button in der Liste */
.details-button {
    display: inline-block;
    padding: 6px 10px;
    background: #0077cc;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    text-align: center;
    font-size: 14px;
}

.details-button:hover {
    background: #005fa3;
}

/* Responsive für kleine Screens */
@media (max-width: 768px) {
    .grid-container {
        display: block;
    }

    .grid-row {
        display: grid;
        grid-template-columns: 1fr;
        margin-bottom: 15px;
        padding: 10px;
        border-bottom: 2px solid #ddd;
        background: white;
        border-radius: 5px;
    }

    .grid-item::before {
        content: attr(data-label);
        font-weight: bold;
        display: inline-block;
        width: 120px;
    }

    .grid-item {
        border: none;
        padding: 5px 0;
    }

    .details-button {
        width: 100%;
        display: inline-block;
        text-align: center;
        margin-top: 10px;
    }
}

/* ----------------------------------------
   Formular
---------------------------------------- */
.form-container {
    background: white;
    padding: 20px;
    border-radius: 5px;
    max-width: 600px;
    margin: 20px 0;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
}

.form-container label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-container input[type="text"],
.form-container input[type="email"],
.form-container input[type="number"],
.form-container textarea {
    width: 100%;
    padding: 8px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.form-container input[type="submit"] {
    padding: 10px 20px;
    background: #0077cc;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.form-container input[type="submit"]:hover {
    background: #005fa3;
}

/* ----------------------------------------
   Top-Button "Anzeige aufgeben"
---------------------------------------- */
.top-button {
    display: inline-block;
    margin-bottom: 20px;
    padding: 10px 15px;
    background: #28a745;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.top-button:hover {
    background: #218838;
}

/* Zurück-Button auf Detailseite */
.back-button {
    display: inline-block;
    margin-top: 20px;
    padding: 8px 14px;
    background: #6c757d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.back-button:hover {
    background: #565e64;
}


/* Fehlerdarstellung */
.input-error {
    border: 2px solid #ff3333 !important;
    background: #ffe9e9;
}

.error-msg {
    color: #cc0000;
    font-size: 0.9em;
    margin-bottom: 5px;
    font-weight: bold;
}

#preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid #ccc;
}


.message {
    padding: 12px;
    margin: 10px 0;
    border-radius: 5px;
    font-weight: bold;
}

.message.success {
    background-color: #dff0d8;
    color: #3c763d;
}

.message.error {
    background-color: #f2dede;
    color: #a94442;
}

.image-gallery {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.image-gallery .thumb img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform .2s;
}

.image-gallery .thumb img:hover {
    transform: scale(1.05);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    padding-top: 60px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.85);
    cursor: zoom-out;
}

.modal-content {
    display: block;
    margin: auto;
    max-width: 90%;
    max-height: 85%;
    border-radius: 8px;
}

.close {
    position: absolute;
    top: 20px;
    right: 35px;
    font-size: 40px;
    color: #fff;
    cursor: pointer;
}
