body {
    font-family: Arial, sans-serif;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align items to the top to allow scrolling */
    min-height: 100vh; /* Allow content to expand */
    margin: 0;
    background-color: #f4f4f9;
    padding: 20px; /* Add some padding around the main container */
    box-sizing: border-box; /* Include padding in element's total width and height */
}

.container {
    text-align: center;
    width: 100%; /* Make container fluid */
    max-width: 500px; /* Max width for larger screens */
    margin-top: 20px; /* Space from top */
    margin-bottom: 20px; /* Space from bottom */
}

#main-screen {
    width: 100%; /* Make main screen fluid */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 350px;
}

#main-screen h1 {
    font-size: 36px;
    color: #008CBA;
    margin-bottom: 10px;
}

#main-screen h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 15px;
}

#main-screen p {
    font-size: 18px;
    color: #555;
    margin-bottom: 30px;
}

#start-quiz-btn, #begin-quiz-btn, #copy-results-btn, #next-btn { /* Combined buttons with similar styles */
    padding: 15px 40px;
    font-size: 20px;
    font-weight: bold;
    border: none;
    border-radius: 8px;
    background-color: #008CBA;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 20px;
    width: auto; /* Allow buttons to size content */
    max-width: 100%; /* Prevent overflow on small screens */
}

#start-quiz-btn:hover, #begin-quiz-btn:hover, #copy-results-btn:hover, #next-btn:hover {
    background-color: #005f7a;
}

.day-selector-container {
    margin-bottom: 20px;
    font-size: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; /* Space between elements */
    width: 100%;
    max-width: 500px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 30px;
    box-sizing: border-box;
}

.day-selector-container label {
    margin-bottom: 10px;
}

#day-selector {
    padding: 8px 12px;
    font-size: 16px;
    border-radius: 5px;
    border: 1px solid #ccc;
    margin-left: 0; /* Remove previous margin */
    width: 80%; /* Fluid width for selector */
    max-width: 200px;
}

#quiz-container {
    width: 100%; /* Make quiz container fluid */
    min-height: 350px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    box-sizing: border-box;
}

#card-counter {
    font-size: 18px;
    color: #555;
    text-align: left; /* Align to the left */
    margin-bottom: 10px; /* Space below card counter */
    padding-left: 0; /* Indent slightly from the left edge of the quiz container */
}

#question-header {
    display: flex;
    justify-content: center; /* Center question area */
    align-items: center; /* Center question area */
    margin-bottom: 25px; /* Keep some margin */
    width: 100%;
}

#question-area {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    min-height: 60px;
    flex-grow: 1;
    text-align: center;
    margin: 0; /* Remove side margins */
}

#action-buttons {
    display: flex;
    flex-direction: column; /* Stack icons row and next button vertically */
    align-items: center; /* Center horizontally */
    gap: 15px; /* Space between icon row and next button */
    margin-top: 20px; /* Space above action buttons */
}

#icon-buttons { /* New container for dictionary, image, bookmark buttons */
    display: flex;
    flex-direction: row; /* Arrange icons horizontally */
    justify-content: center;
    gap: 10px; /* Space between icons */
}

#bookmark-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: #ccc;
    transition: color 0.2s ease-in-out;
    pointer-events: auto; /* Ensure it's always interactable */
}

#bookmark-btn:disabled {
    display: none;
    pointer-events: none; /* Disable interaction when hidden */
}

.action-btn { /* Style for dictionary and image buttons */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
    color: #ccc; /* Default color */
    transition: color 0.2s ease-in-out;
    pointer-events: auto;
}

.action-btn:disabled {
    display: none;
    pointer-events: none;
}

.action-btn:hover {
    color: #008CBA;
}


#bookmark-btn:hover {
    color: #008CBA;
}

#bookmark-btn.bookmarked {
    color: #008CBA !important; /* Force color change */
    fill: #008CBA !important; /* Force fill change */
}

.bookmark-icon {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
}

.action-icon {
    width: 28px;
    height: 28px;
    stroke: currentColor;
    fill: none;
}

#options-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex-grow: 1;
}

#options-list button {
    width: 100%;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #f9f9f9;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    text-align: left;
}

#options-list button:not(:disabled):hover {
    background-color: #e0f7fa;
    border-color: #008CBA;
}

#options-list button.correct {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
    font-weight: bold;
}

#options-list button.incorrect {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

#feedback-area {
    margin-top: 20px;
    font-size: 20px;
    font-weight: bold;
    min-height: 30px;
}

#feedback-area.correct {
    color: #28a745;
}

#feedback-area.incorrect {
    color: #dc3545;
}

#word-info-display {
    margin-top: 20px;
    padding: 15px;
    background-color: #e9ecef;
    border-radius: 8px;
    text-align: left;
    font-size: 16px;
    color: #333;
}

#word-info-display h4 {
    margin-top: 0;
    margin-bottom: 5px;
    color: #005f7a;
}

#word-info-display p {
    margin-bottom: 5px;
}

/* #next-btn is now part of #action-buttons, removed its margin-left */
#next-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    background-color: #008CBA;
    color: white;
    cursor: pointer;
    font-size: 14px;
    pointer-events: auto; /* Ensure it's always interactable */
}

#next-btn:hover {
    background-color: #005f7a;
}

/* --- Results Screen Styles --- */
#results-container {
    width: 100%; /* Make results container fluid */
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    padding: 30px;
    text-align: left;
    box-sizing: border-box;
}

#results-summary h3 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-top: 0;
}

#results-summary p {
    text-align: center;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 30px;
}

.results-lists h4 {
    font-size: 18px;
    color: #005f7a;
    border-bottom: 2px solid #e0f7fa;
    padding-bottom: 5px;
    margin-top: 20px;
}

.results-lists ul {
    list-style-type: none;
    padding: 0;
    margin: 10px 0 0 0;
    max-height: 150px;
    overflow-y: auto;
}

.results-lists li {
    padding: 8px 5px;
    border-bottom: 1px solid #f0f0f0;
    font-size: 15px;
}

#copy-results-btn {
    display: block;
    width: 100%;
    margin-top: 30px;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 5px;
    background-color: #28a745;
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
}

#copy-results-btn:hover {
    background-color: #218838;
}

#return-to-main-fixed-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 10px 20px;
    font-size: 16px;
    background-color: #008CBA;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}

#return-to-main-fixed-btn:hover {
    background-color: #005f7a;
}

/* --- Mobile Responsiveness --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    .container {
        margin-top: 10px;
        margin-bottom: 10px;
    }

    #main-screen,
    .day-selector-container,
    #quiz-container,
    #results-container {
        padding: 20px;
    }

    #main-screen h1 {
        font-size: 28px;
    }

    #main-screen h2 {
        font-size: 20px;
    }

    #main-screen p {
        font-size: 16px;
    }

    #start-quiz-btn, #begin-quiz-btn, #copy-results-btn, #next-btn {
        padding: 12px 20px;
        font-size: 16px;
        margin-top: 15px; /* Adjust margin for mobile */
    }

    #day-selector {
        width: 100%;
        font-size: 14px;
    }

    #card-counter {
        font-size: 16px;
        margin-bottom: 8px;
    }

    #question-area {
        font-size: 20px;
        min-height: 50px;
    }

    #options-list button {
        padding: 8px;
        font-size: 14px;
    }

    #feedback-area {
        font-size: 16px;
        min-height: 25px;
    }

    #word-info-display {
        padding: 10px;
        font-size: 14px;
    }
    
    .bookmark-icon {
        width: 24px;
        height: 24px;
    }

    #return-to-main-fixed-btn {
        bottom: 10px;
        right: 10px;
        padding: 8px 15px;
        font-size: 14px;
    }

    #action-buttons { /* Adjust for mobile */
        gap: 10px;
    }
}