/* ContentManager Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Uppercase text enforcement */
.uppercase-text {
    text-transform: uppercase;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.4;
    color: #333;
    background-color: #fff;
    margin: 0;
    padding: 0;
}

.container {
    max-width: none;
    margin: 0;
    padding: 20px;
}

header {
    background: transparent;
    color: inherit;
    padding: 0;
    margin-bottom: 20px;
    border-radius: 0;
    text-align: left;
}

header h1 {
    font-size: 32px;
    margin: 0 0 20px 0;
}

header p {
    font-size: 14px;
    opacity: 1;
}

header nav {
    margin-top: 1rem;
}

header nav a {
    color: #0066cc;
    text-decoration: underline;
    font-weight: normal;
    padding: 0;
    border: none;
    border-radius: 0;
    transition: none;
    display: inline;
}

header nav a:hover {
    background: transparent;
    color: #004080;
}

main {
    display: block;
}

section {
    background: transparent;
    padding: 10px;
    border-radius: 0;
    box-shadow: none;
    border: 1px solid #ccc;
    margin: 0;
}

section + section {
    border-top: 0;
}

.content-controls {
    background: #f5f5f5;
}

.button-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.button-group button {
    margin: 0;
}

.content-controls h2,
.content-display h3,
.autogen-dashboard h3 {
    margin-bottom: 1rem;
    color: #2c3e50;
}

.dashboard h3 {
    margin-bottom: 0.75rem;
    color: #2c3e50;
}

.dashboard-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.dashboard-pill {
    border: 1px solid #ccc;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 12px;
}

.dashboard-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ccc;
    padding: 8px 10px;
    cursor: pointer;
}

.dashboard-row:hover {
    border-color: #888;
}

.dashboard-row:focus {
    outline: 2px solid #666;
    outline-offset: 1px;
}

.dashboard-game-name {
    font-weight: bold;
}

.dashboard-status-text {
    font-size: 13px;
}

.dashboard-red {
    background: #ffcccc;
}

.dashboard-orange {
    background: #ffd9a0;
}

.dashboard-yellow {
    background: #fffde6;
}

.dashboard-green {
    background: #e7f7e7;
}

button {
    padding: 5px 15px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: none;
    text-decoration: none;
    display: inline-block;
    color: #333;
}

button:hover {
    background: #e9e9e9;
}

button:active {
    transform: translateY(1px);
}

.btn-primary,
a.btn-primary {
    padding: 5px 15px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: none;
    text-decoration: none;
    display: inline-block;
    color: #333;
}

.btn-primary:hover,
a.btn-primary:hover {
    background: #e9e9e9;
}

button.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary,
a.btn-secondary {
    padding: 5px 15px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: none;
    text-decoration: none;
    display: inline-block;
    color: #333;
}

.btn-secondary:hover,
a.btn-secondary:hover {
    background: #e9e9e9;
}

.btn-orange,
a.btn-orange {
    background: #ff9900;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-block;
}

.btn-orange:hover,
a.btn-orange:hover {
    background: #e68a00;
}

.btn-orange:active,
a.btn-orange:active {
    background: #cc7a00;
}

.btn-link {
    padding: 5px 15px;
    border: 1px solid #ccc;
    background: white;
    cursor: pointer;
    font-size: 14px;
    transition: none;
    text-decoration: none;
    display: inline-block;
    color: #333;
}

.btn-link:hover {
    background: #e9e9e9;
}

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

.form-group label {
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 6px 8px;
    border: 1px solid #ccc;
    border-radius: 0;
    font-size: 14px;
    background: white;
    transition: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #666;
}

.form-group textarea {
    resize: vertical;
}

/* Answer fields are one-line textareas rather than <input type="text">:
   Grammarly only attaches to textareas, and only to ones whose clientHeight
   is at least 35px and clientWidth at least 250px - hence the fixed height
   and min-width (border-box, so the 1px borders come off both). The line
   height centres the single line; edit_modal_embed.js keeps it to one line. */
:where(textarea.answer-text) {
    font-family: Arial, sans-serif;
}

form textarea.answer-text {
    height: 38px;
    min-height: 0;
    min-width: 254px;
    padding-top: 0;
    padding-bottom: 0;
    line-height: 36px;
    box-sizing: border-box;
    resize: none;
    overflow: hidden;
    white-space: nowrap;
    vertical-align: middle;
}

/* The answer marked correct stands out on every edit form that picks it with
   a radio button. Driven by the radio itself, so it follows clicks, loaded
   questions and Move Correct alike. */
form input[type="radio"]:checked ~ textarea.answer-text {
    border-color: #28a745;
    background-color: #e6f6ea;
    box-shadow: inset 4px 0 0 #28a745;
    padding-left: 12px;
    font-weight: bold;
}

form input[type="radio"]:has(~ textarea.answer-text) {
    accent-color: #28a745;
}

.form-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.5rem;
}

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

#content-list,
#content-details {
    min-height: 200px;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1rem;
    margin-top: 1rem;
}

.autogen-dashboard {
    background: transparent;
}

.autogen-folder-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.autogen-folder-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ccc;
    padding: 8px 10px;
}

.autogen-row-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.autogen-row-right {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
}

.autogen-folder-label {
    font-weight: bold;
    white-space: nowrap;
}

.autogen-seq-label {
    font-size: 12px;
    font-weight: bold;
    color: #856404;
    background: #fff3cd;
    border: 1px solid #ffc107;
    padding: 2px 6px;
    border-radius: 3px;
    white-space: nowrap;
}

.autogen-games-wrapper {
    position: relative;
}

.autogen-games-btn {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 13px;
    cursor: default;
    user-select: none;
}

.autogen-games-tooltip {
    display: none;
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 10;
    margin-bottom: 4px;
}

.autogen-games-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #333;
}

.autogen-games-wrapper:hover .autogen-games-tooltip {
    display: block;
}


.loading {
    opacity: 0.6;
    pointer-events: none;
}

.error {
    color: #e74c3c;
    background: #fdf2f2;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #e74c3c;
}

.success {
    color: #27ae60;
    background: #f2fdf5;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #27ae60;
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    header h1 {
        font-size: 32px;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    button {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    a.btn-primary,
    a.btn-secondary {
        width: 100%;
        text-align: center;
    }
}

.cm-header-link {
    color: inherit;
    text-decoration: none;
}

.cm-header-link:hover {
    text-decoration: underline;
}
