:root {
    --vreugde: #ffdd00;
    --vertrouwen: #00cc66; 
    --angst: #00aa44;
    --verrassing: #33aaff;
    --verdriet: #0033cc;
    --afkeer: #9900cc;
    --woede: #ff3300;
    --verwachting: #ff9500;
    
    /* English equivalents kept for backward compatibility */
    --joy: #ffdd00;
    --trust: #00cc66; 
    --fear: #00aa44;
    --surprise: #33aaff;
    --sadness: #0033cc;
    --disgust: #9900cc;
    --anger: #ff3300;
    --anticipation: #ff9500;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    background: #f5f5f5;
}

.emotion-wheel-container {
    width: 100%;
    max-width: 600px;
    aspect-ratio: 1;
    margin: 20px auto;
    position: relative;
    overflow: hidden;
}

#emotion-wheel {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none; /* Prevent scroll/zoom on touch */
    margin: 0;
    padding: 0;
}

.emotion-arc {
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    touch-action: none;
}

.emotion-arc:hover, .emotion-arc:active {
    opacity: 0.8;
    transform: scale(1.02);
    filter: brightness(1.1);
}

.emotion-label {
    fill: white;
    font-weight: normal;
    pointer-events: none;
    text-shadow: 
        -1px -1px 0 rgba(0,0,0,0.7),
        1px -1px 0 rgba(0,0,0,0.7),
        -1px 1px 0 rgba(0,0,0,0.7),
        1px 1px 0 rgba(0,0,0,0.7);
}

.label {
    pointer-events: none;
}

.emotion-label-background {
    fill: white;
    opacity: 0.7;
}

/* Primary emotions (inner circle) */
.primary-wheel {
    width: 200px;
    height: 200px;
    top: 200px;
    left: 200px;
    z-index: 3;
}

/* Secondary emotions (middle circle) */
.secondary-wheel {
    width: 400px;
    height: 400px;
    top: 100px;
    left: 100px;
    z-index: 2;
}

/* Tertiary emotions (outer circle) */
.tertiary-wheel {
    width: 600px;
    height: 600px;
    top: 0;
    left: 0;
    z-index: 1;
}

.emotion-segment {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-origin: center center;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.emotion-segment:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.emotion-segment svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.emotion-btn {
    padding: 15px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.emotion-btn:active {
    transform: scale(0.95);
}

.history {
    margin-top: 20px;
}

.history-item {
    padding: 10px;
    margin: 5px 0;
    background: white;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

h1, h2 {
    color: #333;
    margin: 20px 0;
}

#emotion-notes {
    width: 100%;
    height: 100px;
    margin: 10px 0;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #ccc;
}

.action-button {
    padding: 10px 20px;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.save-button {
    background: #4CAF50;
}

.share-button {
    background: #2196F3;
}

.manage-emotions-button {
    padding: 10px 20px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
}

.shared-emotion-tag {
    background: #2196F3;
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.shared-emotion-container {
    background: white;
    border-left: 4px solid #2196F3;
    padding: 20px;
    margin: 20px auto;
    max-width: 600px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.emotion-path {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
}

.emotion-description {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
    font-size: 16px;
    line-height: 1.5;
}

.emotion-timestamp {
    color: #666;
    font-size: 14px;
}

.share-history-button {
    padding: 5px 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.action-buttons {
    display: flex;
    gap: 10px;
}

.back-button {
    background: #666;
}

.back-button:hover {
    background: #555;
}

.selected-emotion-details {
    margin-bottom: 20px;
}

.selected-emotion-details h2 {
    margin-bottom: 10px;
}

.emotion-path {
    font-size: 24px;
    margin-bottom: 10px;
    color: #333;
    font-weight: bold;
}

.center-display {
    position: relative;
    z-index: 5;
}

.center-circle {
    transition: all 0.3s ease-in-out;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
    stroke: rgba(0,0,0,0.1);
    stroke-width: 1px;
}

.center-circle:hover {
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
    transform: scale(1.05);
}

.center-circle.has-selection {
    cursor: pointer;
    filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1.15);
        filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    }
    50% {
        transform: scale(1.25);
        filter: drop-shadow(0 6px 20px rgba(0,0,0,0.6));
    }
    100% {
        transform: scale(1.15);
        filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
    }
}

/* Use a separate element for the pointer to avoid SVG positioning issues */
.emotion-wheel-container {
    position: relative;
}

.center-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    text-shadow: 0 0 3px rgba(0,0,0,0.3);
    font-weight: 500;
}

.instruction-text {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: all 0.3s ease-in-out;
    pointer-events: none;
    font-weight: bold;
    animation: fadeInOut 2s infinite alternate;
    text-shadow: 0 0 3px rgba(0,0,0,0.5);
}

@keyframes fadeInOut {
    0% {
        opacity: 0.7;
        transform: translateY(0);
    }
    100% {
        opacity: 1;
        transform: translateY(-2px);
    }
}

@media (max-width: 600px) {
    body {
        padding: 5px;
    }

    .emotion-wheel-container {
        margin: 5px auto;
        touch-action: none; /* Prevent browser gestures */
    }

    h1 {
        font-size: 20px;
        text-align: center;
        margin: 10px 0;
    }

    h2 {
        font-size: 18px;
        text-align: center;
        margin: 10px 0;
    }
    
    .emotion-label {
        font-size: 7px !important;
        text-shadow: 
            -0.5px -0.5px 0 rgba(0,0,0,0.7),
            0.5px -0.5px 0 rgba(0,0,0,0.7),
            -0.5px 0.5px 0 rgba(0,0,0,0.7),
            0.5px 0.5px 0 rgba(0,0,0,0.7);
    }
    
    /* Make the center circle larger on mobile for easier tapping */
    .center-circle {
        transform: scale(1.1);
    }
    
    .center-circle.has-selection {
        transform: scale(1.15);
    }
    
    @keyframes pulse {
        0% {
            transform: scale(1.15);
            filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
        }
        50% {
            transform: scale(1.25);
            filter: drop-shadow(0 6px 20px rgba(0,0,0,0.6));
        }
        100% {
            transform: scale(1.15);
            filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4));
        }
    }
}

/* Extra small devices */
@media (max-width: 400px) {
    body {
        padding: 0;
    }
    
    .emotion-wheel-container {
        margin: 0 auto;
        width: 100vw;
        max-width: 100vw;
    }
    
    h1 {
        font-size: 18px;
        margin: 8px 0;
    }
    
    h2 {
        font-size: 16px;
        margin: 8px 0;
    }
    
    .emotion-label {
        font-size: 6px !important;
    }
}

/* Sound toggle button */
.sound-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    z-index: 10;
}

.sound-toggle:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.05);
}

.sound-toggle.muted .sound-icon::after {
    content: '🔇';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.sound-toggle.muted .sound-icon {
    opacity: 0;
}

/* Make sure the emotion wheel container has position relative for absolute positioning of the button */
.emotion-wheel-container {
    position: relative;
}
