body {
    font-family: sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: #f0f0f0;
    margin: 0;
}

.flashcard-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    text-align: center;
    width: 90%;
    max-width: 500px;
}

#flashcard {
    margin-bottom: 25px;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    min-height: 250px; /* Ensure space even if image fails */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#card-image {
    max-width: 80%;
    max-height: 180px;
    height: auto;
    display: block;
    margin: 0 auto 15px auto;
    border-radius: 5px;
}

#card-word {
    font-size: 2.5em; /* Large, clear text */
    font-weight: bold;
    margin: 10px 0 0 0;
    color: #333;
}

.controls button {
    font-size: 1.2em;
    padding: 12px 20px;
    margin: 8px;
    cursor: pointer;
    border: none;
    border-radius: 8px;
    background-color: #007bff;
    color: white;
    transition: background-color 0.3s ease;
}

.controls button:hover {
    background-color: #0056b3;
}

.controls button:active {
    transform: scale(0.98);
}

#record-button {
    background-color: #28a745; /* Green for record */
}

#record-button:hover {
    background-color: #218838;
}

#record-button.recording {
    background-color: #dc3545; /* Red when recording */
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

#feedback-area {
    margin-top: 20px;
    min-height: 50px; /* Reserve space */
}

#feedback-text {
    font-size: 1.2em;
    font-weight: bold;
    min-height: 1.5em; /* Prevent layout shift */
}

#feedback-text.correct {
    color: #28a745; /* Green */
}

#feedback-text.incorrect {
    color: #dc3545; /* Red */
}

#stars-display {
    font-size: 1.3em;
    margin-top: 10px;
    color: #ffc107; /* Yellow for stars */
}

/* Basic responsiveness */
@media (max-width: 600px) {
    .flashcard-container {
        padding: 20px;
    }
    #card-word {
        font-size: 2em;
    }
    .controls button {
        font-size: 1em;
        padding: 10px 15px;
    }
}

