/* style.css */

/* Grundlegende Reset-Regeln */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Gesamthintergrund und Grundstil */
body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: #ffffff;
    min-height: 100vh;
}

/* Container */
.container {
    max-width: 900px;
    margin: 50px auto;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 15px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Überschriften */
h1, h2 {
    font-family: 'Bangers', cursive;
    color: #ffcc00;
    text-align: center;
    margin-bottom: 20px;
    text-shadow: 2px 2px #000000;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

/* Buttons und Links */
button, .button-link {
    display: inline-flex; /* Ermöglicht die Verwendung von Icons innerhalb der Buttons */
    align-items: center;  /* Vertikale Zentrierung der Icons und Text */
    padding: 8px 12px;    /* Kleinere Padding für kleinere Buttons */
    font-size: 0.9rem;    /* Kleinere Schriftgröße */
    font-family: 'Bangers', cursive;
    color: #ffffff;
    background: #ff5733;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    text-decoration: none;
    text-align: center;
    margin: 5px;
}

button:hover, .button-link:hover {
    background: #c70039;
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

button:active, .button-link:active {
    transform: scale(0.95);
}

/* Spezifische Button-Farben */
.start-button {
    background: #00ff9c;
}

.stop-button {
    background: #ff4242;
}

.edit-button, .delete-button {
    padding: 5px 8px; /* Kleinere Padding */
    font-size: 0.8rem; /* Kleinere Schriftgröße */
}

.edit-button {
    background-color: #00bb70; /* Grün für Edit */
}

.delete-button {
    background-color: #ff4242; /* Rot für Delete */
}

.add-button {
    background: #00bb70;
}

.update-gift-button {
    background: #007bff;
}

.delete-all-button {
    background: #ff4242;
}

.confirm-yes-button {
    background: #ff4242;
}

.confirm-no-button {
    background: #00bb70;
}

.logout-button {
    background: #555;
}

.logout-button:hover {
    background: #333;
}

/* Formulare */
form {
    width: 100%;
    max-width: 500px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form-inline {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    width: 100%;
    max-width: 500px;
}

.form-group {
    width: 100%;
    max-width: 300px;
    margin-bottom: 15px;
}

.form-group label {
    font-size: 1rem;
    margin-bottom: 5px;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 5px;
}

.update-gift-form input[type="text"] {
    width: 70%;
}

.update-gift-form button {
    width: 25%;
    justify-content: center;
}

/* Inline-Formulare für Bearbeiten und Löschen */
.inline-form {
    display: inline-flex;
    align-items: center;
}

/* Hinzufügen neuer Bedingungen */
.add-condition-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

input[type="text"] {
    flex: 1;
    padding: 8px;
    border: none;
    border-radius: 5px;
}

.add-condition-form button {
    flex: none;
}

/* Tabellen */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: #333333;
    color: #ffcc00;
    font-family: 'Bangers', cursive;
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.1);
}

tr:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Gewinneranzeige */
#gewinner {
    font-size: 2rem;
    color: #ff0000;
    text-align: center;
    margin-top: 30px;
    text-shadow: 3px 3px #000000;
}

/* Teilnehmerbedingungen */
.conditions {
    background: rgba(255, 255, 255, 0.1);
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    width: 100%;
}

.conditions h2 {
    color: #ffcc00;
    text-shadow: 1px 1px #000000;
    margin-bottom: 10px;
}

.conditions ul {
    list-style-type: disc;
    margin-left: 20px;
}

.conditions li {
    margin-bottom: 8px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.conditions li form.inline-form {
    margin-left: 10px;
}

/* Fehlermeldungen und Erfolgsmeldungen */
.error-message {
    color: #ff0000;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

.success-message {
    color: #00ff00;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

/* Modal für Teilnehmerbedingungen */
.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    padding-top: 100px; /* Location of the box */
    left: 0;
    top: 0;
    width: 100%; /* Full width */
    height: 100%; /* Full height */
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.6); /* Black w/ opacity */
}

.modal-content {
    background-color: #fefefe;
    color: #000000; /* Textfarbe auf Schwarz setzen */
    margin: auto;
    padding: 20px;
    border: 1px solid #888;
    width: 80%;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.3);
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

/* Bestätigungsabfrage für Teilnehmerliste löschen */
.confirmation-text {
    color: #ff4242;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.confirmation button {
    margin: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        margin: 30px 20px;
        padding: 15px;
    }

    h1, h2 {
        font-size: 1.8rem;
    }

    button, .button-link {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    th, td {
        padding: 10px;
        font-size: 0.9rem;
    }

    #gewinner {
        font-size: 1.5rem;
    }

    .modal-content {
        width: 90%;
        padding: 15px;
    }

    .conditions ul {
        margin-left: 15px;
    }

    .form-inline {
        flex-direction: column;
        align-items: stretch;
    }

    .update-gift-form, .add-condition-form {
        width: 100%;
    }

    .conditions li {
        flex-direction: column;
        align-items: flex-start;
    }

    .conditions li form.inline-form {
        margin-left: 0;
        margin-top: 5px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 20px 10px;
        padding: 10px;
    }

    h1, h2 {
        font-size: 1.5rem;
    }

    button, .button-link {
        padding: 6px 10px;
        font-size: 0.7rem;
    }

    th, td {
        padding: 8px;
        font-size: 0.8rem;
    }

    #gewinner {
        font-size: 1.2rem;
    }

    .modal-content {
        width: 95%;
        padding: 10px;
    }

    .conditions ul {
        margin-left: 15px;
    }

    .form-inline {
        flex-direction: column;
        gap: 5px;
    }

    .update-gift-form input[type="text"],
    .winner-selection-form input[type="text"] {
        width: 100%;
    }
}
