/* Allgemeine Stile */
body {
    font-family: Arial, sans-serif;
    text-align: center;
    margin: 50px;
    background-color: #cdcdcd;
}

/* Header und Navigation */
.header {
    display: flex;
    justify-content: flex-end;
    padding: 10px 20px;
    background-color: #333;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.username {
    font-weight: bold;
}

.logout-btn {
    padding: 5px 10px;
    background-color: #d32f2f;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s;
}

.logout-btn:hover {
    background-color: #b71c1c;
}

/* Titel und Container */
.title-container {
    width: 80%;
    max-width: 600px;
    margin: 0 auto 15px auto;
	padding-top: 40px;
    text-align: center;
}

h1 {
    color: #333;
    margin: 0;
    padding: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
    width: 100%;
    box-sizing: border-box;
    border-radius: 5px;
}

h1:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
}

/* Anweisungen */
.instructions {
    display: none;
    width: 80%;
    max-width: 600px;
    margin: 10px auto;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-align: left;
}

/* Level-Container */
.level-container {
    width: 300px;
    height: 180px;
    margin: 20px auto;
    border: 3px solid gold;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    background-color: #4CAF50;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background-color 0.3s, border-color 0.3s;
    position: relative;
    overflow: hidden;
    padding: 15px 0 10px 0;
}

.level-container:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.level-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
}

.level-label {
    font-size: 24px;
    margin-bottom: 5px;
}

.level-value {
    font-size: 58px;
    margin-bottom: 10px;
}

/* Fortschrittsbalken */
.progress-container {
    width: 85%;
    height: 25px;
    background-color: #f3f3f3;
    border: 2px solid gold;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin-bottom: 5px;
    margin-top: auto;
}

.progress-bar {
    height: 100%;
    background-color: #3498db;
    width: 0%;
    transition: width 0.3s ease;
    color: white;
    font-weight: bold;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
}

.progress-text {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    font-size: 12px;
    color: black;
    font-weight: bold;
}

/* Eingabefeld und Buttons */
.input-container {
    margin: 20px auto;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.points-input {
    width: 80px;
    padding: 8px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.action-button {
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
    min-width: 150px;
}

.action-button:hover {
    opacity: 0.9;
}

.action-button.subtract {
    background-color: #F44336;
}

.action-button.reset {
    background-color: #880E4F;
}

/* Statistik-Container */
.stats-container {
    display: none;
    width: 80%;
    max-width: 600px;
    margin: 10px auto;
    padding: 15px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    max-height: 400px;
    overflow-y: auto;
}

.stats-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
}

.stats-item {
    margin: 5px 0;
    padding: 8px;
    background-color: #f0f0f0;
    border-radius: 3px;
    text-align: left;
}

.stats-item:nth-child(odd) {
    background-color: #e8e8e8;
}

/* Durchschnitts-Container */
.stats-avg-container {
    background-color: #e8f5e9;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.stats-avg-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.stats-avg-value {
    font-size: 24px;
    font-weight: bold;
    color: #2E7D32;
}

/* Spiel-Container */
.game-container {
    display: none;
}

/* Schwierigkeitsstufen */
.mode-section {
    margin: 20px auto;
    width: 80%;
    max-width: 600px;
    text-align: center;
}

.mode-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.mode-button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

.mode-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.easy-button {
    background-color: #4CAF50;
    color: white;
}

.normal-button {
    background-color: gold;
    color: black;
}

.hard-button {
    background-color: #F44336;
    color: white;
}

/* Rahmenfarben für Modi */
.easy-border {
    border-color: #2E7D32;
}

.normal-border {
    border-color: gold;
}

.hard-border {
    border-color: #D32F2F;
}

/* Anweisungsbuttons mit Beschreibungen */
.instruction-modes {
    margin-top: 15px;
}

.mode-item {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.mode-description {
    margin-left: 15px;
    font-size: 16px;
}

/* Schließen-Button */
.control-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
}

.close-button {
    padding: 8px 16px;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.close-button:hover {
    background-color: #546E7A;
}

/* Spiel-Ende-Meldung */
.end-game-message {
    width: 80%;
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #FFC107;
    border: 3px solid #FF9800;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    font-weight: bold;
}

.congrats-line1 {
    font-size: 28px;
    color: #d32f2f;
    margin-bottom: 10px;
    text-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
}

.congrats-line2 {
    font-size: 22px;
    color: #333;
}

/* Spielabschluss-Container */
.game-complete {
    display: none;
    margin-top: 20px;
}

/* Überschrift für neues Spiel */
.new-game-title {
    font-size: 20px;
    font-weight: bold;
    margin: 20px 0 15px 0;
    color: #333;
}

/* Level 30 Container */
.level-container-completed {
    height: auto;
    padding: 15px 0;
}

/* Trennlinie */
.divider {
    height: 3px;
    background-color: #333;
    width: 80%;
    max-width: 600px;
    margin: 25px auto;
    border-radius: 2px;
}

/* Punkteregeln */
.points-rules {
    margin-top: 20px;
    margin-bottom: 20px;
    position: relative;
}

.points-rules h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.points-text {
    width: 100%;
    min-height: 150px;
    max-width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    resize: vertical;
    font-family: Arial, sans-serif;
    box-sizing: border-box;
}

.points-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

.save-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.reset-button {
    padding: 8px 16px;
    background-color: #F44336;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.save-button:hover, .reset-button:hover {
    opacity: 0.9;
}

/* Popup-Meldung */
.popup {
    display: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: calc(100% + 10px);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 18px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Challenge-Container */
.challenge-container {
    width: 80%;
    max-width: 500px;
    margin: 15px auto;
    border: 2px solid #9C27B0;
    border-radius: 10px;
    padding: 15px;
    background-color: #f8f4fc;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    display: none;
}

.challenge-container.visible {
    display: block;
    animation: fadeIn 0.3s;
}

.challenge-buttons-container {
    margin: 15px auto;
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.challenge-button {
    padding: 10px 15px;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.3s, opacity 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 140px;
}

.challenge-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

.challenge-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.challenge-button-easy {
    background-color: #4CAF50;
}

.challenge-button-easy:hover:not(:disabled) {
    background-color: #388E3C;
}

.challenge-button-medium {
    background-color: gold;
    color: black;
}

.challenge-button-medium:hover:not(:disabled) {
    background-color: #FFC107;
}

.challenge-button-hard {
    background-color: #F44336;
}

.challenge-button-hard:hover:not(:disabled) {
    background-color: #D32F2F;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.challenge-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 15px;
    font-weight: bold;
    text-align: center;
}

.challenge-description {
    font-size: 16px;
    color: #444;
    margin-bottom: 20px;
    padding: 10px 15px;
    background-color: white;
    border-radius: 8px;
    border: 1px solid #ddd;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.challenge-points {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 15px;
}

.point-box {
    padding: 8px 12px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    text-align: center;
    min-width: 100px;
}

.point-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.point-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

.point-value.bonus {
    color: #4CAF50;
}

.point-value.penalty {
    color: #F44336;
}

.challenge-action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

.challenge-complete-btn {
    padding: 8px 15px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.challenge-cancel-btn {
    padding: 8px 15px;
    background-color: #F44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.challenge-complete-btn:hover, .challenge-cancel-btn:hover {
    opacity: 0.9;
}

/* Challenge-Management */
.challenge-mgmt-section {
    margin-top: 30px;
    border-top: 1px solid #ddd;
    padding-top: 20px;
}

.challenge-mgmt-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

.challenge-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.challenge-form-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.challenge-form label {
    width: 120px;
    text-align: right;
    font-weight: bold;
}

.challenge-form input, .challenge-form select {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.challenge-form button {
    align-self: center;
    margin-top: 10px;
    padding: 8px 20px;
    background-color: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.challenge-form button:hover {
    background-color: #1976D2;
}

.challenge-list {
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 10px;
    margin-top: 10px;
}

/* Challenge-Listenelemente */
.challenge-list-item {
    padding: 10px;
    margin-bottom: 8px;
    border-radius: 4px;
    background-color: #ededed;
    display: flex;
    flex-direction: column;
}

.challenge-list-item:last-child {
    margin-bottom: 0;
}

.challenge-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.challenge-list-text {
    font-weight: bold;
    flex-grow: 1;
    text-align: left;
    margin-right: 10px;
    word-break: break-word;
}

.challenge-list-details {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.challenge-detail {
    padding: 4px 8px;
    border-radius: 0px;
    font-size: 13px;
    flex-grow: 0;
    background-color: white;
    border: 1px solid #ddd;
}

.challenge-actions {
    display: flex;
    gap: 5px;
    margin-left: auto;
    flex-shrink: 0;
}

.challenge-edit-btn, .challenge-delete-btn {
    padding: 5px 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.challenge-edit-btn {
    background-color: #2196F3;
}

.challenge-delete-btn {
    background-color: #F44336;
}

.challenge-edit-btn:hover {
    background-color: #1976D2;
}

.challenge-delete-btn:hover {
    background-color: #D32F2F;
}

.no-challenges-msg {
    padding: 20px;
    color: #666;
    text-align: center;
    font-style: italic;
}

/* Challenge abgeschlossen Meldung */
.all-complete-alert {
    background-color: #FFEB3B;
    border: 2px solid #FFC107;
    border-radius: 8px;
    padding: 15px;
    margin: 20px auto;
    width: 80%;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    font-weight: bold;
    color: #333;
    display: none;
}

/* Challenge-Bearbeitungsformular */
.edit-challenge-form {
    margin-top: 10px;
    padding: 10px;
    background-color: #e8f5e9;
    border-radius: 4px;
    width: 100%;
    display: none;
}

.edit-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.edit-form-row label {
    width: 93px;
    text-align: right;
    font-weight: bold;
    font-size: 13px;
}

.edit-form-row input, .edit-form-row select {
    flex-grow: 1;
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.edit-form-row select {
    height: 31px;
}

.edit-form-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

.edit-save-btn, .edit-cancel-btn {
    padding: 5px 10px;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.edit-save-btn {
    background-color: #4CAF50;
}

.edit-cancel-btn {
    background-color: #9E9E9E;
}

/* Challenge-Timer */
.challenge-timer-container {
    width: 100%;
    margin: 15px auto;
}

.challenge-timer-progress {
    width: 100%;
    height: 25px;
    background-color: #f3f3f3;
    border: 2px solid gold;
    border-radius: 5px;
    margin: 15px auto;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

.challenge-timer-progress:hover {
    background-color: #e0e0e0;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.challenge-timer-bar {
    height: 100%;
    background-color: #F3453D;
    width: 100%;
    transition: width 1s linear, background-color 0.3s;
    position: relative;
}

.challenge-timer-progress:hover .challenge-timer-bar {
    background-color: #e53935;
}

.challenge-timer-display {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    top: 0;
    left: 0;
    color: black;
    font-weight: bold;
    z-index: 10;
    pointer-events: none;
}

/* Challenge-Fehlschlag */
.challenge-failed-msg {
    background-color: #FFEBEE;
    border: 2px solid #F44336;
    color: #D32F2F;
    font-weight: bold;
    padding: 15px;
    margin: 15px auto;
    border-radius: 5px;
    display: none;
}

.challenge-close-btn {
    padding: 8px 15px;
    background-color: #607D8B;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 10px;
    cursor: pointer;
}

.challenge-close-btn:hover {
    background-color: #455A64;
}

/* Tagesziel */
.daily-goal-section {
    margin-top: 30px;
    margin-bottom: 30px;
    position: relative;
    border-top: 1px solid #ddd;
    padding-top: 10px;
}

.daily-goal-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.daily-goal-container {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    justify-content: center;
}

.daily-goal-input {
    width: 80px;
    padding: 8px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 5px;
    text-align: center;
}

.daily-goal-button {
    padding: 8px 16px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-size: 14px;
}

.daily-goal-button:hover {
    opacity: 0.9;
}

/* Tagesziel-Fortschrittsbalken */
.daily-progress-container {
    width: 30%;
    max-width: 310px;
    height: 25px;
    background-color: #f3f3f3;
    border: 2px solid #ccc;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    margin: 15px auto;
    display: none;
}

.daily-progress-bar {
    height: 100%;
    background-color: #F3453D;
    width: 0%;
    transition: width 0.3s ease, background-color 0.3s;
}

.daily-progress-text {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    text-align: center;
    font-size: 12px;
    color: black;
    font-weight: bold;
    z-index: 10;
}

.daily-progress-complete {
    background-color: #4CAF50;
}

/* Authentifizierung Styles */
.auth-container {
    width: 80%;
    max-width: 400px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.auth-container h1 {
    margin-bottom: 20px;
    color: #333;
}

.form-group {
    margin-bottom: 15px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
}

.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    box-sizing: border-box;
    margin: 10px 0;
}

.btn-primary {
    background-color: #4CAF50;
    color: white;
}

.btn-primary:hover {
    background-color: #388E3C;
}

.btn-secondary {
    background-color: #2196F3;
    color: white;
}

.btn-secondary:hover {
    background-color: #1976D2;
}

.auth-links {
    margin-top: 20px;
    font-size: 14px;
}

.auth-links p {
    margin: 5px 0;
}

.auth-links a {
    color: #2196F3;
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.error-message {
    background-color: #FFEBEE;
    color: #B71C1C;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #F44336;
}

.success-message {
    background-color: #E8F5E9;
    color: #1B5E20;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 15px;
    border-left: 4px solid #4CAF50;
}

/* Startseite Styles */
.welcome-container {
    width: 80%;
    max-width: 800px;
    margin: 50px auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.welcome-container h1 {
    margin-bottom: 15px;
    color: #333;
    font-size: 32px;
}

.welcome-container p {
    margin-bottom: 20px;
    color: #555;
    font-size: 18px;
}

.auth-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 30px 0;
}

.features {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding: 0 20px;
}

.feature {
    flex: 0 0 calc(30% - 20px);
    padding: 15px;
    background-color: #f3f3f3;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    text-align: center;
}

.feature:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.feature h3 {
    color: #333;
    margin-bottom: 10px;
}

.feature p {
    color: #666;
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        margin: 20px;
    }
    
    .features {
        flex-direction: column;
    }
    
    .feature {
        flex-basis: 100%;
        margin: 10px 0;
    }
    
    .daily-progress-container {
        width: 80%;
    }
    
    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .mode-button {
        width: 80%;
    }
    
    .challenge-buttons-container {
        flex-direction: column;
        align-items: center;
    }
    
    .challenge-button {
        width: 80%;
    }
    
    .challenge-points {
        flex-direction: column;
        align-items: center;
    }
    
    .point-box {
        width: 80%;
        margin-bottom: 10px;
    }
}