/* Basis-Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    transition: background-color 0.3s, color 0.3s;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

#setup-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    font-size: 18px;
}

#setup-button:hover {
    background: #5a6268;
}

/* Hauptinhalt */
main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Rätsel-Container */
#riddle-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#riddle-display {
    margin-bottom: 20px;
}

#riddle-text {
    font-size: 1.2em;
    font-weight: bold;
}

#answer-section {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

#answer-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#submit-answer, #tip-button, #skip-button {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#submit-answer:hover, #tip-button:hover, #skip-button:hover {
    background: #0056b3;
}

#tip-button {
    background: #ffc107;
    color: black;
}

#tip-button:hover {
    background: #e0a800;
}

#skip-button {
    background: #dc3545;
}

#skip-button:hover {
    background: #c82333;
}

#tries-counter {
    font-weight: bold;
    margin-bottom: 10px;
    color: #666;
}

#feedback {
    font-weight: bold;
}

#tip-display {
    background: #e3f2fd;
    border: 1px solid #2196f3;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 10px 0;
    font-style: italic;
    font-size: 0.9em;
}

#feedback small {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
    display: block;
    margin-top: 5px;
    line-height: 1.4;
}

/* Fortschritt */
#progress-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#progress-bar {
    width: 100%;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

#progress-fill {
    height: 100%;
    background: #28a745;
    width: 0%;
    transition: width 0.3s;
}

#new-challenge-button {
    margin-top: 10px;
    padding: 8px 16px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9em;
}

#new-challenge-button:hover {
    background: #5a6268;
}

/* Gutschein */
#voucher-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

#voucher-code {
    font-size: 1.5em;
    font-weight: bold;
    color: #28a745;
    margin: 10px 0;
}

#reset-button {
    padding: 10px 20px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#reset-button:hover {
    background: #c82333;
}

/* Lade- und Fehlerzustände */
#loading, #error {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#retry-button {
    padding: 10px 20px;
    background: #ffc107;
    color: black;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1em;
}

#retry-button:hover {
    background: #e0a800;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 20px;
    border-radius: 8px;
    width: 80%;
    max-width: 400px;
    text-align: center;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

#model-select {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#save-model {
    padding: 10px 20px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#save-model:hover {
    background: #0056b3;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 30px;
    color: #666;
}

/* Altersgruppen-Themen */
.age-kids {
    background-color: #fff3cd;
    color: #856404;
}

.age-kids #app {
    background: linear-gradient(135deg, #ffeaa7, #fab1a0);
}

.age-kids h1 {
    color: #d63031;
}

.age-kids #submit-answer {
    background: #fdcb6e;
    color: #2d3436;
}

.age-kids #submit-answer:hover {
    background: #e17055;
}

.age-kids #progress-fill {
    background: #fdcb6e;
}

.age-kids #voucher-code {
    color: #fdcb6e;
}

.age-teens {
    background-color: #d1ecf1;
    color: #0c5460;
}

.age-teens #app {
    background: linear-gradient(135deg, #a29bfe, #fd79a8);
}

.age-teens h1 {
    color: #6c5ce7;
}

.age-teens #submit-answer {
    background: #a29bfe;
}

.age-teens #submit-answer:hover {
    background: #6c5ce7;
}

.age-teens #progress-fill {
    background: #a29bfe;
}

.age-teens #voucher-code {
    color: #a29bfe;
}

.age-adults {
    background-color: #f8f9fa;
    color: #212529;
}

.age-adults #app {
    background: linear-gradient(135deg, #dfe6e9, #b2bec3);
}

.age-adults h1 {
    color: #2d3436;
}

.age-adults #submit-answer {
    background: #636e72;
}

.age-adults #submit-answer:hover {
    background: #2d3436;
}

.age-adults #progress-fill {
    background: #636e72;
}

.age-adults #voucher-code {
    color: #636e72;
}

/* Individuelle Farbschemata für Personen */
.person-Melina {
    background-color: #fff9c4;
    color: #f57f17;
}

.person-Melina #app {
    background: linear-gradient(135deg, #fff9c4, #ffeb3b);
}

.person-Melina h1 {
    color: #f57f17;
}

.person-Melina #submit-answer {
    background: #ffeb3b;
    color: #f57f17;
}

.person-Melina #submit-answer:hover {
    background: #f57f17;
    color: white;
}

.person-Melina #progress-fill {
    background: #ffeb3b;
}

.person-Melina #voucher-code {
    color: #f57f17;
}

.person-Naomi {
    background-color: #fce4ec;
    color: #c2185b;
}

.person-Naomi #app {
    background: linear-gradient(135deg, #fce4ec, #e91e63);
}

.person-Naomi h1 {
    color: #c2185b;
}

.person-Naomi #submit-answer {
    background: #e91e63;
}

.person-Naomi #submit-answer:hover {
    background: #c2185b;
}

.person-Naomi #progress-fill {
    background: #e91e63;
}

.person-Naomi #voucher-code {
    color: #c2185b;
}

.person-Fenja {
    background-color: #fff3e0;
    color: #e65100;
}

.person-Fenja #app {
    background: linear-gradient(135deg, #fff3e0, #ff9800);
}

.person-Fenja h1 {
    color: #e65100;
}

.person-Fenja #submit-answer {
    background: #ff9800;
}

.person-Fenja #submit-answer:hover {
    background: #e65100;
}

.person-Fenja #progress-fill {
    background: #ff9800;
}

.person-Fenja #voucher-code {
    color: #e65100;
}

.person-Emilia {
    background-color: #e8f5e8;
    color: #2e7d32;
}

.person-Emilia #app {
    background: linear-gradient(135deg, #e8f5e8, #4caf50);
}

.person-Emilia h1 {
    color: #2e7d32;
}

.person-Emilia #submit-answer {
    background: #4caf50;
}

.person-Emilia #submit-answer:hover {
    background: #2e7d32;
}

.person-Emilia #progress-fill {
    background: #4caf50;
}

.person-Emilia #voucher-code {
    color: #2e7d32;
}

.person-Kesara {
    background-color: #fafafa;
    color: #424242;
}

.person-Kesara #app {
    background: linear-gradient(135deg, #fafafa, #e0e0e0);
}

.person-Kesara h1 {
    color: #424242;
}

.person-Kesara #submit-answer {
    background: #9e9e9e;
}

.person-Kesara #submit-answer:hover {
    background: #424242;
}

.person-Kesara #progress-fill {
    background: #9e9e9e;
}

.person-Kesara #voucher-code {
    color: #424242;
}

.person-Talita {
    background-color: #e3f2fd;
    color: #1565c0;
}

.person-Talita #app {
    background: linear-gradient(135deg, #e3f2fd, #2196f3);
}

.person-Talita h1 {
    color: #1565c0;
}

.person-Talita #submit-answer {
    background: #2196f3;
}

.person-Talita #submit-answer:hover {
    background: #1565c0;
}

.person-Talita #progress-fill {
    background: #2196f3;
}

.person-Talita #voucher-code {
    color: #1565c0;
}

.person-OO {
    background-color: #f3e5f5;
    color: #6a1b9a;
}

.person-OO #app {
    background: linear-gradient(135deg, #f3e5f5, #9c27b0);
}

.person-OO h1 {
    color: #6a1b9a;
}

.person-OO #submit-answer {
    background: #9c27b0;
}

.person-OO #submit-answer:hover {
    background: #6a1b9a;
}

.person-OO #progress-fill {
    background: #9c27b0;
}

.person-OO #voucher-code {
    color: #6a1b9a;
}

.person-BC {
    background-color: #ffebee;
    color: #b71c1c;
}

.person-BC #app {
    background: linear-gradient(135deg, #ffebee, #f44336);
}

.person-BC h1 {
    color: #b71c1c;
}

.person-BC #submit-answer {
    background: #f44336;
}

.person-BC #submit-answer:hover {
    background: #b71c1c;
}

.person-BC #progress-fill {
    background: #f44336;
}

.person-BC #voucher-code {
    color: #b71c1c;
}

/* Responsive Design */
@media (max-width: 600px) {
    #app {
        padding: 10px;
    }

    h1 {
        font-size: 2em;
    }

    #setup-button {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    #answer-section {
        flex-direction: column;
    }

    #answer-input {
        width: 100%;
    }

    #submit-answer, #tip-button, #skip-button {
        width: 100%;
        margin-bottom: 5px;
    }

    #progress-bar {
        height: 15px;
    }

    #new-challenge-button {
        width: 100%;
        margin-top: 10px;
    }
}