body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

header {
    background-color: #333;
    color: white;
    padding: 1rem 0;
    text-align: center;
    width: 100%;
}

main {
    padding: 20px;
    max-width: 400px; /* Mobile-first focus */
    width: 100%;
    box-sizing: border-box;
    background-color: white;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin-top: 20px;
    border-radius: 8px;
}

section {
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
}

h2 {
    margin-top: 0;
    color: #333;
    text-align: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

button {
    display: block;
    width: 100%;
    padding: 12px;
    margin: 10px 0;
    background-color: #5cb85c;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #4cae4c;
}

button.back-btn {
    background-color: #aaa;
}

button.back-btn:hover {
    background-color: #888;
}

#reset-progress-btn {
    background-color: #d9534f;
}

#reset-progress-btn:hover {
    background-color: #c9302c;
}

input[type="text"] {
    width: calc(100% - 22px); /* Account for padding and border */
    padding: 10px;
    margin-bottom: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.mode-screen {
    text-align: center;
}

.hidden {
    display: none;
}

#learn-card, #test-card, #select-card {
    background-color: #e9e9e9;
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 5px;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#learn-card p, #test-card p, #select-card p {
    font-size: 1.2rem;
    margin: 5px 0;
}

#learn-translation {
    font-style: italic;
    color: #555;
}

#test-feedback, #select-feedback {
    margin-top: 10px;
    font-weight: bold;
}

#select-options button {
    background-color: #337ab7;
    margin-top: 5px;
}

#select-options button:hover {
    background-color: #286090;
}

#progress-content {
    text-align: left;
}

#progress-content p {
    margin: 5px 0;
}

/* Add some basic styling for the canvas container */
#progress-content {
    position: relative; /* Needed for chart responsiveness */
    min-height: 300px; /* Minimum space */
    max-height: 75vh; /* Limit height to 75% of viewport height */
    width: 100%;
    padding-bottom: 15px; /* Add padding below chart */
    overflow-y: auto; /* Allow scrolling if content exceeds max-height */
    display: flex; /* Use flexbox to manage chart size */
    flex-direction: column; /* Stack title and chart vertically */
}

#progressChartCanvas {
    display: block; /* Ensure canvas takes block space */
    width: 100% !important; /* Override default canvas sizing */
    max-width: 100%; /* Ensure it doesn't overflow */
    /* Remove fixed height, let it be determined by container/Chart.js */
    /* height: 300px !important; */
    flex-grow: 1; /* Allow canvas to take available space in flex container */
    min-height: 250px; /* Prevent it from becoming too small */
}