body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
}

.toolbar {
    background-color: #333;
    color: white;
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

button {
    cursor: pointer;
    padding: 8px 15px;
    margin: 0 5px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
}

#main-display {
    padding: 20px;
}

#grid-container {
    font-family: monospace;
    font-size: 20px;
    text-align: center;
    max-height: 80vh;
    min-width: 800px;
    overflow-x: auto;
    overflow-y: auto;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    margin: 20px auto;
    padding: 10px;
}

.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 20px;
    border-radius: 8px;
    width: 400px;
    max-width: 90%;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.close {
    color: #aaa;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover,
.close:focus {
    color: black;
    text-decoration: none;
}

.settings {
    margin: 15px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

input[type="text"], input[type="password"], input[type="number"], textarea, select {
    width: 90%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

.action-btn {
    width: 100%;
    background-color: #2196F3;
    color: white;
    font-size: 16px;
    padding: 10px;
    margin-top: 10px;
    border-radius: 4px;
    border: none;
}

.action-btn:disabled {
    background-color: #aaa;
    cursor: not-allowed;
}

#legend-badges div {
    transition: all 0.2s ease;
    user-select: none;
    font-weight: bold;
}

#legend-badges div:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.highlight-hover {
    transform: scale(1.6) !important;
    border: 3px solid black !important;
    z-index: 10 !important;
    position: relative !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.6) !important;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #bbb; 
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888; 
}

@media print {
    .toolbar, #results-nav, button {
        display: none !important;
    }
    
    body {
        background-color: white;
    }

    #grid-container {
        border: none !important;
        box-shadow: none !important;
        max-height: none !important;
        overflow: visible !important;
        width: 100%;
        min-width: auto;
    }

    span {
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}