/* Base styles */
body {
    font-family: sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f2f2f2;
}

/* Primitive display styles */
.primitive-display {
    width: 100%;
    aspect-ratio: 1;  /* Makes it square like the SVG */
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    /* Increase the base font size */
    font-size: .75em;
}

.primitive-emotion-text {
    font-family: serif;
    text-align: center;
    /* Scale the font size relative to container */
    font-size: 2em !important;
}

/* Header styles */
header {
    background-color: #333;
    color: #fff;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

header h1 {
    text-align: center;
    margin: 0;
}

nav {
    background-color: #444;
    padding: 10px 0;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 20px;
}

nav a {
    color: #fff;
    text-decoration: none;
}

nav a:hover {
    color: #ddd;
}

/* Grid styles */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
    padding: 16px;
}

.tile {
    background-color: #fff;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease-in-out;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tile:hover {
    transform: scale(1.05);
}

.tile img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

.tile h3 {
    margin: 8px 0 0;
    font-size: 16px;
    color: #333;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: #fefefe;
    margin: 5% auto;
    padding: 20px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
}

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

.modal-close:hover {
    color: black;
}

.modal img {
    max-width: 100%;
    height: auto;
    margin-bottom: 16px;
}

.modal .primitive-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 16px;
}

.modal .related-ticket-img {
    max-width: 200px;
    height: auto;
    border: 1px solid #ccc;
    border-radius: 4px;
    margin: 4px;
    display: inline-block;
}

/* TOGGLE NAV */
.display-controls {
    background-color: #444;
    padding: 10px 0;
    text-align: center;
}

.control-item {
    color: white;
    margin: 0 15px;
    cursor: pointer;
}

.control-item input {
    margin-right: 5px;
}

/* Add these classes for the tile content */
.primitive-name {
    display: block;
    margin-top: 8px;
    font-weight: bold;
}

.primitive-emotion {
    display: block;
    color: #666;
    font-size: 0.9em;
}

/* Add these classes for SVG visibility control */
.hide-names text[class*="name"],
.hide-names text[id*="name"],
.hide-names .name,
.hide-names .primitive-name {
    display: none !important;
}

.hide-emotions text[class*="emotion"],
.hide-emotions text[id*="emotion"],
.hide-emotions .emotion,
.hide-emotions .primitive-emotion {
    display: none !important;
}

/* Palette Controls */
.palette-controls {
    background-color: #444;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #555;
}

.palette-item {
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.palette-item:hover {
    background-color: #555;
}

.palette-item input {
    margin-right: 5px;
}

/* Hue Controls */
.hue-controls {
    background-color: #444;
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    border-top: 1px solid #555;
}

.hue-item {
    color: white;
    padding: 5px 10px;
    cursor: pointer;
    background-color: #333;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: background-color 0.2s;
}

.hue-item:hover {
    background-color: #555;
}

.hue-item input {
    margin-right: 5px;
}