/* --- GLOBALER STYLE --- */
* {
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

body {
    background-color: #f4f7fa;
    color: #333;
    margin: 0;
    padding: 0;
}

/* --- CONTAINER: Zentrale Ausrichtung und Padding --- */
.container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 30px;
    background: #fff;
    box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 60px !important;
}

/* --- ÜBERSCHRIFTEN --- */
h1 {
    font-size: 28px;
    font-weight: bold;
    color: #1a1a1a;
    border-bottom: 2px solid #1c932b;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

h2 {
    font-size: 22px;
    color: #1c932b;
    font-weight: bold;
    margin-bottom: 15px;
}

/* --- FORMULARE: Einheitlicher Look & Professionelle Abstände --- */
form {
    display: flex;
    flex-direction: column;
}

form label {
    font-weight: bold;
    margin-bottom: 5px;
}

form input, form select, form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    background: #fff;
}

form input:focus, form select:focus, form textarea:focus {
    border-color: #0056b3;
    outline: none;
    box-shadow: 0px 0px 5px rgba(0, 86, 179, 0.2);
}

/* --- BUTTONS: Klar, Modern & Angenehm --- */
.btn {
    display: inline-block;
    padding: 12px 18px;
    font-size: 14px;
    border-radius: 5px;
    text-align: center;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
}

.btn-primary {
    background-color: #1c932b;
    color: white;
}

.btn-primary:hover{
    opacity: 0.9;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
	text-align: center;
}

.btn-secondary:hover {
    background-color: #545b62;
}

.btn-danger {
    background-color: #d9534f;
    color: white;
}

.btn-danger:hover {
    background-color: #c9302c;
}

/* --- TABELLEN: Professioneller Look mit feinen Linien & Hover-Effekten --- */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

table th {
    background-color: #1c932b;
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e9ecef;
}

/* --- RÜCKKNOPF & NAVIGATION --- */
.back-button {
    display: block;
    margin-top: 20px;
    text-align: center;
    color: #0056b3;
    font-weight: bold;
    text-decoration: none;
}

.back-button:hover {
    text-decoration: underline;
}

/* Zurück-Button */
.back-button {
    margin-top: 20px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 10px;
    margin-top: 20px;
    font-size: 14px;
    color: #6c757d;
}

/* Button-Gruppen */
.button-group-top {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 15px;
}


.button-group-top-new {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.button-group-bottom {
    text-align: center;
    margin-top: 20px;
}

/* Buttons */
.btn {
    padding: 12px 18px;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.btn-create {
    background-color: #1c932b;
    color: white;
}

.btn-back {
    background-color: #6c757d;
    color: white;
}

.btn-open {
    background-color: #343a40;
    color: white;
    padding: 8px 14px;
    font-size: 14px;
    border-radius: 4px;
}

.btn:hover {
    opacity: 0.9;
}

/* Tabellen-Design für Mitarbeiter & Material */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

table th {
    background-color: #1c932b;
    color: white;
    padding: 10px;
    text-align: left;
    font-weight: bold;
}

table td {
    padding: 10px;
    border-bottom: 1px solid #ddd;
}

table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table tr:hover {
    background-color: #e9ecef;
}

/* Buttons für Zeilenlöschung */
.btn-danger {
    background-color: #d9534f;
    color: white;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

.btn-danger:hover {
    background-color: #c9302c;
}

.btn-duplicate {
    background-color: #53df1b;;
    color: white;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

.btn-duplicate:hover {
    background-color: #29730c;;
}

.btn-ai-duplicate {
    background-color: #1e520a;;
    color: white;
    padding: 5px 10px;
    border: none;
    cursor: pointer;
    border-radius: 4px;
    font-size: 12px;
}

.btn-ai-duplicate:hover {
    background-color: #29730c;;
}

.image-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.image-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 120px; /* Breite für jedes Bild-Element */
    text-align: center;
}

.preview-image {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border: 1px solid #ccc;
    border-radius: 5px;
}

.image-item label {
    margin-top: 5px;
    font-size: 14px;
}

.font40 {
	font-size: 40px;
}

.button-group {
    display: flex;
    flex-wrap: wrap;  /* Ermöglicht Umbruch auf kleinere Bildschirme */
    gap: 8px; /* Abstand zwischen Buttons */
    justify-content: center; /* Zentriert die Buttons */
    align-items: center;
}

.button-group a,
.button-group button {
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease-in-out;
    white-space: nowrap; /* Verhindert, dass der Button-Text umbricht */
}

.button-group .btn-primary {
    background-color: #1c932b;
    color: white;
    border: none;
}

.button-group .btn-primary:hover {
    background-color: #02510c;
}

.button-group .btn-secondary {
    background-color: #6c757d;
    color: white;
    border: none;
}

.button-group .btn-secondary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.button-group .btn-danger {
    background-color: #dc3545;
    color: white;
    border: none;
}

.button-group .btn-danger:hover {
    background-color: #a71d2a;
}

/* Sanftes Ausblenden */
#customMessage {
  transition: opacity 0.8s ease-out, transform 0.2s ease-out;
  opacity: 1;
}
#customMessage.fade-out {
  opacity: 0;
}

.message-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;

    animation: fadeIn 0.3s ease-in-out;
}

.message-inner {
    background-color: #333;
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    font-size: 16px;
    max-width: 90%;
    min-width: 320px;
    text-align: center;
    position: relative;
}

.message-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 22px;
    color: inherit;
    background: none;
    border: none;
    cursor: pointer;
}

.message-close:focus {
  outline: 2px solid #aaa;
  outline-offset: 2px;
}

.message-success {
    background-color: #28a745;
}
.message-warning {
    background-color: #ffc107;
    color: #222;
}
.message-info {
    background-color: #17a2b8;
}

.fade-out {
    opacity: 0;
    transition: opacity 0.8s ease-out;
}


/* Fade animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide animation */
@keyframes slideDown {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


@media (max-width: 768px) {
    /* Container für mobile Bildschirme anpassen */
    .container {
        width: 95%;
        padding: 20px;
    }

    /* Tabellen scrollbar machen */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table th, table td {
        font-size: 14px;
        padding: 8px;
        min-width: 120px; /* Verhindert zu schmale Spalten */
    }
	
	.button-group {
        flex-direction: column; /* Stapelt die Buttons untereinander */
         /* Sorgt dafür, dass die Buttons gleich breit sind */
    }

    .button-group a,
    .button-group button {
        width: 100%; /* Buttons nehmen die gesamte Breite ein */
        text-align: center; /* Zentrierte Beschriftung */
    }

    /* Button-Gruppen zentrieren und untereinander anordnen */
    .button-group-top, .button-group-bottom {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .button-group-top a,
    .button-group-bottom a {
        width: 100%;
        text-align: center;
    }

    /* Buttons für mobile Bildschirme vergrößern */
    .btn {
        padding: 14px 20px;
        font-size: 16px;
    }

    .btn-open {
        display: block;
        text-align: center;
        width: 100%;
    }

    /* Abstand und Layout für Projekte verbessern */
    .project-list {
        margin-top: 10px;
    }

    .project-list h2 {
        text-align: center;
        font-size: 20px;
    }

    .table td {
        text-align: left;
    }
}

.text-muted {
    color: #888;
    font-style: italic;
}

.abgeschlossen {
    background-color: #f5f5f5;
    color: #888;
}
.abgeschlossen a.btn {
    opacity: 0.7;
}

.drop-area {
    border: 2px dashed #ccc;
    padding: 20px;
    text-align: center;
    margin-bottom: 1rem;
}
.drop-area.dragover {
    background-color: #eef;
    border-color: #00f;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    margin: 5px;
    cursor: zoom-in;
    border: 1px solid #ccc;
    border-radius: 4px;
}
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
#lightbox-overlay img {
    max-width: 95%;
    max-height: 95%;
    border: 2px solid white;
    border-radius: 6px;
}

.image-preview div {
    position: relative;
}
.image-preview span {
    position: absolute;
    top: 5px;
    right: 5px;
    background: red;
    color: white;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
}

.drag-handle {
  cursor: grab;
  text-align: center;
  font-size: 16px;
  color: #888;
  user-select: none;       /* verhindert Text-Markierung */
  -webkit-user-select: none;
  -moz-user-select: none;
}
.drag-handle:active {
  cursor: grabbing;
}
.drag-handle:hover {
  color: #000;
}
