body {
    background-color: white;
    color: black;
    font-family: "Times New Roman", Times, serif;
    margin: 0;
    padding: 20px;
}

.page-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

header p {
    margin-bottom: 20px;
    font-size: 1rem;
}

.main-content {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.left-column {
    flex: 0 0 auto;
}

#clueCanvas {
    /* Canvas hidden by default, script handles display */
    display: none;
}

#output {
    display: block;
    /* Always show output container */
}

#clueImage {
    display: block;
    margin-bottom: 10px;
    max-width: 400px;
    height: auto;
}

/* Pre-hide landing clue if URL params are present */
[data-prehide-clue="true"] #clueImage {
    display: none;
}

.right-column {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 4px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.right-top {
    padding: 20px;
    border-bottom: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.right-bottom {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    max-height: 400px;
    background: #fdfdfd;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.history-header h3 {
    margin: 0;
    color: #141b90;
    font-size: 1.1rem;
}

.zip-controls {
    display: flex;
    align-items: center;
    gap: 5px;
}

.both-styles-label {
    font-size: 0.8rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.both-styles-label input {
    cursor: pointer;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

/* Custom scrollbar for history list */
.history-list::-webkit-scrollbar {
    width: 6px;
}

.history-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.history-list::-webkit-scrollbar-thumb {
    background: #141b90;
    border-radius: 3px;
}

.history-item {
    padding: 10px;
    background: white;
    border: 1px solid #eee;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    touch-action: manipulation;
}

.history-item:hover {
    border-color: #141b90;
    background: #f0f1ff;
    transform: translateX(3px);
}

.history-item.selected {
    background: #141b90;
    color: white;
    border-color: #0d1266;
    box-shadow: 0 2px 8px rgba(20, 27, 144, 0.3);
}

.history-item.selected:hover {
    background: #1a23b3;
}

.history-item .item-text {
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.history-item .item-category {
    font-size: 0.75rem;
    color: #888;
    font-style: italic;
    margin-left: 10px;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
}

.history-item .item-style {
    font-size: 0.7rem;
    text-transform: uppercase;
    opacity: 0.7;
    margin: 0 5px;
}

.history-item .delete-button {
    background: none;
    border: none;
    color: #cc0000;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    margin: 0;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.history-item:hover .delete-button {
    opacity: 0.6;
}

.history-item .delete-button:hover {
    opacity: 1 !important;
    background: rgba(204, 0, 0, 0.1);
}

.history-item.selected .delete-button {
    color: white;
}

.history-item.selected .delete-button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.empty-history {
    color: #999;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 20px;
}

.secondary-button {
    background: #fff;
    color: #141b90;
    border: 1px solid #141b90;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    margin-bottom: 0;
}

.secondary-button:hover:not(:disabled) {
    background: #141b90;
    color: white;
}

.secondary-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #ccc;
}

.input-group {
    margin-bottom: 0;
}

.classic-label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    font-weight: bold;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.classic-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: inherit;
}

.format-note {
    display: block;
    margin-top: 5px;
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
}

.interaction-note {
    font-weight: normal;
    color: #888;
    font-size: 0.75rem;
    margin-left: 5px;
}

.metadata-controls {
    margin-top: 5px;
    padding-top: 15px;
    border-top: 1px dashed #eee;
}

textarea {
    width: 100%;
    height: 120px;
    margin-bottom: 5px;
    font-family: Arial, Helvetica, sans-serif;
    padding: 5px;
    border: 1px solid #7f9db9;
    box-sizing: border-box;
}

.form-controls {
    text-align: left;
}

button {
    background-color: #f0f0f0;
    border: 1px solid #7b9ebd;
    /* Windows XP/Classic style border blue-ish */
    color: black;
    padding: 2px 10px;
    font-size: 13px;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
    margin-bottom: 10px;
    margin-right: 10px;
    border-radius: 2px;
}

button:active {
    background-color: #e0e0e0;
    border-style: inset;
}

.size-selector {
    display: inline-block;
}

select {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    padding: 2px;
}

footer p {
    font-size: 0.8rem;
    line-height: 1.4;
}

mark {
    background-color: #ffff00;
    color: black;
    padding: 0;
}

/* Style Panel (Hidden by default) */
.style-panel {
    background: #f9f9f9;
    border: 1px solid #ccc;
    padding: 15px;
    margin-top: 20px;
}

.style-panel h3 {
    margin-top: 0;
    font-size: 1rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
}

.control-row {
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 0.8rem;
    margin-bottom: 3px;
}