/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

header {
    background-color: #4a90e2;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
}

nav li {
    margin-left: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
}

nav a:hover {
    text-decoration: underline;
}

main {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

footer {
    background-color: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: auto;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.button {
    display: inline-block;
    background-color: #4a90e2;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.button:hover {
    background-color: #3a80d2;
}

.button.secondary {
    background-color: #6c757d;
}

.button.secondary:hover {
    background-color: #5a6268;
}

.flashes {
    margin-bottom: 1rem;
}

.flash {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    background-color: #d4edda;
    color: #155724;
}

/* Form styles */
.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.form-actions {
    margin-top: 1.5rem;
}

/* Auth pages */
.auth-container {
    max-width: 500px;
    margin: 0 auto;
    padding: 2rem;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.auth-links {
    text-align: center;
    margin-top: 1.5rem;
}

/* Welcome page */
.welcome-container {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.intro {
    margin: 2rem 0;
}

.mode-selection {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-top: 2rem;
}

.mode-card {
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    flex: 1;
    max-width: 300px;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Explorer mode */
.explorer-container {
    max-width: 800px;
    margin: 0 auto;
}

.description {
    margin-bottom: 1.5rem;
}

.chat-container {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-history {
    padding: 1.5rem;
    max-height: 500px;
    overflow-y: auto;
}

.message {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
}

.user-message {
    align-items: flex-end;
}

.assistant-message {
    align-items: flex-start;
}

.message-content {
    padding: 0.75rem 1rem;
    border-radius: 18px;
    max-width: 80%;
}

.user-message .message-content {
    background-color: #4a90e2;
    color: white;
    border-bottom-right-radius: 4px;
}

.assistant-message .message-content {
    background-color: #f1f1f1;
    color: #333;
    border-bottom-left-radius: 4px;
}

.welcome-message {
    text-align: center;
    margin: 2rem 0;
    color: #6c757d;
}

.loading .message-content {
    opacity: 0.7;
}

.error .message-content {
    background-color: #f8d7da;
    color: #721c24;
}

.chat-input {
    padding: 1rem;
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
}

.chat-input form {
    display: flex;
    gap: 0.5rem;
}

.chat-input input {
    flex: 1;
}

/* Challenges */
.challenges-container {
    max-width: 800px;
    margin: 0 auto;
}

.challenge-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.challenge-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.challenge-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.category, .difficulty {
    font-size: 0.875rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: #e9ecef;
}

.difficulty {
    background-color: #ffeeba;
}

.challenge-card .button {
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    color: #6c757d;
    margin: 3rem 0;
}

/* Challenge view */
.challenge-view-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.challenge-description {
    margin-bottom: 2rem;
    line-height: 1.8;
}

.previous-response {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #dee2e6;
}

.response-content, .evaluation {
    margin-bottom: 1.5rem;
}

.score {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.navigation {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

/* Parent dashboard */
.parent-dashboard {
    max-width: 800px;
    margin: 0 auto;
}

.dashboard-section {
    margin-bottom: 2rem;
}

.children-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.child-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.child-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.dashboard-actions {
    margin-top: 1rem;
}

/* Create challenge */
.create-challenge-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

/* History view */
.history-container {
    max-width: 800px;
    margin: 0 auto;
}

.history-section {
    margin-bottom: 3rem;
}

.question-item, .response-item {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

.timestamp {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.question-content, .answer-content, .response-content, .evaluation {
    margin-top: 1rem;
}

.challenge-title {
    margin-bottom: 0.5rem;
}

.challenge-description {
    margin-bottom: 1rem;
    font-style: italic;
}

/* Progress view */
.progress-container {
    max-width: 800px;
    margin: 0 auto;
}

.progress-entries {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.progress-card {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.progress-details {
    margin-top: 1rem;
}

.level, .points {
    margin-bottom: 0.5rem;
}

.progress-bar {
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background-color: #4a90e2;
    border-radius: 5px;
}

.progress-text {
    font-size: 0.875rem;
    color: #6c757d;
}
