body {
    font-family: sans-serif;
    line-height: 1.5;
    margin: 20px;
    background-color: #f8f9fa;
    color: #333;
}

h1, h2 {
    text-align: center;
    color: #0056b3;
}

#load-data-area {
    padding: 20px;
    border: 1px solid #ccc;
    background-color: #f8f9fa;
    margin-bottom: 30px;
    border-radius: 5px;
    text-align: center;
}

#load-data-area h1 {
     margin-top: 0;
     color: #333;
}

.load-controls label {
    margin-right: 10px;
    font-weight: bold;
}

.schema-info {
    font-size: 0.9em;
    margin: 10px 0;
    color: #555;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.schema-info code {
    display: block;
    margin-top: 5px;
    padding: 5px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-family: monospace;
    word-break: break-all;
    font-size: 0.9em;
}

.load-controls input[type="url"],
.load-controls input[type="password"] {
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin-right: 10px;
}

.load-controls button {
     padding: 8px 15px;
     font-size: 1em; /* Slightly smaller than main buttons */
     background-color: #28a745;
     color: white;
     border: none;
     border-radius: 5px;
     cursor: pointer;
     transition: background-color 0.2s ease;
}

.load-controls button:hover {
     background-color: #218838;
}

.load-controls button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#load-status-message {
    margin-top: 15px;
    font-style: italic;
    min-height: 1.2em; /* Reserve space */
}

#status-area {
    text-align: center;
    margin-left: 40px 0;
    padding: 10px;
    border-radius: 5px;
    display: flex;
}

#navigation-area {
    margin-left: 10px;
    margin-right: 30px;
}

#comparison-area {
    margin-bottom: 30px;
    margin-left: 20px;
}


#card-container {
    display: flex;
    justify-content: space-around; /* Distribute space */
    align-items: stretch; /* Make cards same height */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 20px; /* Space between cards */
    margin-bottom: 30px;
}

.card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    box-shadow: 2px 2px 5px rgba(0,0,0,0.1);
    width: calc(25% - 27px); /* Adjust width for 3 cards + gap */
    min-width: 200px; /* Prevent cards from becoming too narrow */
    display: flex;
    flex-direction: column;
}

.card h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    width: 100%;
    text-align: center;
    font-size: 1.1em;
}

.card dl {
    margin: 0;
    padding: 0;
    width: 100%;
    flex-grow: 1; /* Allow dl to fill space */
}

.card dt {
    font-weight: bold;
    color: #93aedf;
    float: left;
    clear: left;
    width: 165px;
    text-align: right;
    margin-right: 10px;
    font-size: 0.8em;
}

.card dd {
    margin-left: 100px;
    margin-bottom: 5px;
    color: #333;
    font-size: 0.8em;
}

.card img {
    max-width: 150px;
    height: auto;
    margin: 10px auto 15px auto; /* Center image */
    display: block;
    border-radius: 4px;
}

/* Edit button in cards */
.edit-card-button {
    margin-top: 10px;
    padding: 5px 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s ease, opacity 0.2s ease;
    font-size: 0.9em;
    align-self: center;
    /* Hide by default */
    opacity: 0;
}

.card:hover .edit-card-button {
    /* Show when hovering over the card */
    opacity: 1;
}

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

/* Scoring Form */
#scoring-form {
    padding: 20px;
}

.scoring-inputs {
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
    padding: 20px;
    background-color: white;
    border-left: 4px solid steelblue;
}

.score-input {
    text-align: center;
}

.score-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    font-size: 0.95em;
}

.score-input input[type="number"] {
    width: 70px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
    text-align: center;
}

.notes-input {
    border-top: 1px dashed lightgray;
    padding: 20px;
    background-color: white;
    border-left: 4px solid lightgray;
}

.notes-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    margin-left: 100px;
}

.notes-input textarea {
    width: 80%;
    padding: 10px;
    border: none;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    margin-left: 100px;
}

/* Hide spinner buttons on number inputs */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}


.form-actions {
    text-align: center;
    margin-top: 20px;
    margin-bottom: 10px;
}

.form-actions button, 
#controls-area button,
.primary-button,
.secondary-button {
    padding: 10px 25px;
    font-size: 1.1em;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin: 5px;
}

.form-actions button,
.primary-button {
    background-color: #007bff;
}

.form-actions button:hover,
.primary-button:hover {
    background-color: #0056b3;
}

.secondary-button {
    background-color: #6c757d;
}

.secondary-button:hover {
    background-color: #5a6268;
}

.form-actions button:disabled, 
#controls-area button:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#reset-button {
    background-color: #dc3545;
}

#reset-button:hover {
    background-color: #c82333;
}

/* Card Editing Area */
#edit-card-area {
    margin: 20px auto;
    padding: 20px;
    max-width: 800px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

#edit-form-container {
    margin: 20px 0;
}

/* Ensure edit area fits properly on mobile devices */
@media (max-width: 768px) {
    #edit-card-area {
        margin: 10px;
        padding: 15px;
        max-width: 100%;
    }
}

/* Utility */
.hidden {
    display: none;
}

.error-message {
    color: #dc3545;
    font-weight: bold;
    margin-bottom: 10px;
}

#controls-area {
    display: flex;
    justify-content: center;
}

#submit-status {
    margin-left: 10px;
    font-style: italic;
}
