/* General layout and containers */
.emotion-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
    box-sizing: border-box;
}

#emotion-wheel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    width: 100%;
    box-sizing: border-box;
    padding: 20px;
}

/* Emotion tile styles */
.emotion-section {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
    cursor: pointer;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}
.emotion-section:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
}

/* Emotion colour blocks */
#joy { background-color: #ffeb3b; }
#sadness { background-color: #2196f3; }
#anger { background-color: #f44336; }
#fear { background-color: #9c27b0; }
#disgust { background-color: #4caf50; }
#surprise { background-color: #ff9800; }
#trust { background-color: #e91e63; }
#anticipation { background-color: #009688; }

#joy p, #joy h2,
#sadness p, #sadness h2,
#anger p, #anger h2,
#fear p, #fear h2,
#disgust p, #disgust h2,
#surprise p, #surprise h2,
#trust p, #trust h2,
#anticipation p, #anticipation h2 {
    color: white;
}

/* Modal overlay */
#modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.6);
    padding: 40px 20px;
    box-sizing: border-box;
}
#modal-content {
    background: white;
    margin: 0 auto;
    padding: 20px;
    max-width: 600px;
    border-radius: 10px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
}

/* Buttons */
.sub-emotion-button,
.back-button {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    position: relative;
    padding: 0;
    width: 40px;
    height: 40px;
}

#modal-back {
    color: black;
    cursor: pointer;
}

.sub-emotion-button::before {
    content: '\f35a';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: inherit;
}

.back-button::before {
    content: '\f359';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: inherit;
}

.back-button-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 20px;
}

/* Sub-emotion view */
.sub-emotions {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.ul-sub-emotions {
    list-style-type: none;
    padding-left: 0;
    margin: 20px 0;
    font-family: 'Arial', sans-serif;
}

.ul-sub-emotions li {
    background-color: white;
    color: black;
    border: 2px solid white;
    padding: 10px 20px;
    margin: 5px 0;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.2s;
}
.ul-sub-emotions li::before {
    content: "■";
    font-size: 1em;
    color: black;
    margin-right: 10px;
}
.ul-sub-emotions li:hover {
    background-color: #f0f0f0;
    color: #000;
}

/* Close modal icon */
.close {
    cursor: pointer;
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .ul-sub-emotions li {
        font-size: 14px;
        padding: 8px 16px;
    }
    .sub-emotion-button,
    .back-button {
        font-size: 20px;
        width: 32px;
        height: 32px;
    }
    #modal-content {
        width: 100%;
    }
}
