body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #2c3e50;
    color: #ecf0f1;
    margin: 0;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.container {
    background-color: #34495e;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-top: 20px;
}

h1 {
    color: #ffffff;
    margin-bottom: 25px;
}

nav ul {
    list-style-type: none;
    padding: 0;
}

nav ul li {
    margin-bottom: 15px;
}

nav ul li a, button {
    display: block;
    background-color: #3498db;
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    font-size: 1.1em;
    border: none;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
}

nav ul li a:hover, button:hover {
    background-color: #2980b9;
}

button {
    margin-top: 15px;
}

input[type="text"], input[type="file"] {
    width: calc(100% - 22px);
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 5px;
    border: 1px solid #566573;
    background-color: #ecf0f1;
    color: #2c3e50;
    font-size: 1em;
}

label {
    display: block;
    margin-bottom: 5px;
    text-align: left;
    font-weight: bold;
}

#output a {
    display: inline-block;
    background-color: #2ecc71;
    color: white;
    padding: 10px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin: 10px 5px 0 5px;
    transition: background-color 0.2s ease;
}

#output a:hover {
    background-color: #27ae60;
}

#output p, #instructions p {
    background-color: #2c3e50;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #566573;
    text-align: left;
    line-height: 1.6;
}

#quiz-list ul {
    list-style-type: none;
    padding: 0;
}

#quiz-list li {
    background-color: #4a6f8a;
    margin-bottom: 10px;
    padding: 10px 15px; /* Adjusted padding */
    border-radius: 5px;
    display: flex; /* For aligning items */
    justify-content: space-between; /* Space between quiz name and actions */
    align-items: center; /* Vertically align items */
}

#quiz-list li .quiz-name-display { /* Style for the quiz name text */
    flex-grow: 1; /* Allow quiz name to take available space */
    text-align: left;
    color: #ecf0f1;
    font-weight: bold;
    margin-right: 10px; /* Space between name and buttons */
}

#quiz-list li .quiz-actions { /* Container for action buttons */
    display: flex;
    gap: 10px; /* Space between buttons */
}

#quiz-list li .action-btn { /* General style for action buttons in list items */
    text-decoration: none;
    color: white;
    font-weight: bold;
    padding: 8px 12px; 
    border-radius: 5px; 
    font-size: 0.9em;
    transition: background-color 0.2s ease;
}

#quiz-list li .action-btn:hover {
    opacity: 0.85;
}

#quiz-list li a.take-quiz-btn {
    background-color: #3498db; /* Blue for take quiz */
}
#quiz-list li a.take-quiz-btn:hover {
    background-color: #2980b9;
}

#quiz-list li a.download-json-link { /* Renamed from download-json-btn for consistency */
    background-color: #27ae60; /* Green for download */
}

#quiz-list li a.download-json-link:hover {
    background-color: #229954;
}

#quiz-list li a { /* General style for links in list items */
    text-decoration: none;
    color: #ecf0f1;
    font-weight: bold;
    padding: 5px 8px; /* Add some padding to links */
    border-radius: 3px; /* Slightly rounded corners for links */
}

#quiz-list li a.quiz-link { /* Specific style for the quiz link itself */
    flex-grow: 1; /* Allow quiz name to take available space */
    text-align: left;
}

#quiz-list li a:hover {
    color: #3498db;
    background-color: #566573; /* Add a subtle background on hover */
}

.home-link {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.2s ease;
    font-size: 0.9em;
    margin-bottom: 20px; /* Space below the button */
    border: none;
    cursor: pointer;
}
.home-link:hover {
    background-color: #2980b9;
}

/* Styles for JSON Format Example */
#json-format-example {
    background-color: #34495e; /* Similar to container, or a bit darker like #2c3e50 */
    border: 1px solid #4a6f8a; /* var(--border-color) or slightly lighter */
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 25px;
    text-align: left;
}

#json-format-example h2 {
    color: #ecf0f1; /* var(--text-color) */
    font-size: 1.2em;
    margin-top: 0;
    margin-bottom: 10px;
}

#json-format-example pre {
    background-color: #2c3e50; /* Darker background for the code block itself */
    color: #d0d3d4; /* Lighter text for code */
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #566573; /* var(--border-color) */
    white-space: pre-wrap; /* Wrap long lines */
    word-wrap: break-word; /* Break words if necessary */
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

/* Styles for the success page (can also be in server.js <style> block or here) */
.success-container {
    background-color: #34495e; /* var(--container-bg) */
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.3);
    text-align: center;
    color: #ecf0f1; /* var(--text-color) */
}

.success-container h1 {
    color: #2ecc71; /* Green for success */
    margin-bottom: 20px;
}

.success-container p {
    margin-bottom: 30px;
    font-size: 1.1em;
}

.success-container a {
    margin: 5px 10px; /* Adjusted margin for better wrapping */
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 5px;
    color: white;
    font-weight: bold;
    display: inline-block; /* Allow wrapping */
    transition: background-color 0.2s ease;
}

.success-container a.view-quiz-btn {
    background-color: #2ecc71;
}
.success-container a.view-quiz-btn:hover {
    background-color: #27ae60;
}

.success-container a.other-actions-btn {
    background-color: #3498db;
}
.success-container a.other-actions-btn:hover {
    background-color: #2980b9;
}
