/* Base Function Shape Style */
.function-shape {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 600;
    font-size: 1.2em;
    color: #fff;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    user-select: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.1), inset 0 1px rgba(255,255,255,0.3);
    position: relative;
    -webkit-tap-highlight-color: transparent; /* Remove tap highlight on mobile */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    transform-style: preserve-3d;
    transform: translateZ(0);
}

/* Perceiving Functions (Knowledge) - Circles */
.function-shape.perceiving {
    border-radius: 50%;
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
}
.function-shape#Ne { background-color: #ff7043; } /* Deep Orange light */
.function-shape#Si { background-color: #42a5f5; } /* Blue light */
.function-shape#Ni { background-color: #ab47bc; } /* Purple light */
.function-shape#Se { background-color: #ffca28; } /* Amber light */

/* Judging Functions (Wisdom) - Squares */
.function-shape.judging {
    border-radius: 12px; /* More rounded squares for modern look */
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.1) 0%, rgba(0,0,0,0.05) 100%);
}
.function-shape#Te { background-color: #ef5350; } /* Red light */
.function-shape#Fi { background-color: #66bb6a; } /* Green light */
.function-shape#Ti { background-color: #29b6f6; } /* Light Blue light */
.function-shape#Fe { background-color: #ffa726; } /* Orange light */

/* Hover Effects */
.function-shape:hover {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.4);
}

/* Active/Press Effect */
.function-shape:active {
    transform: scale(0.98) translateY(1px);
    box-shadow: 0 2px 3px rgba(0,0,0,0.15), inset 0 1px 2px rgba(0,0,0,0.1);
    transition-duration: 0.1s;
}

/* Highlight Styles (Applied via JavaScript) */
.function-shape.highlighted {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.25), 0 4px 6px rgba(0,0,0,0.15), inset 0 1px rgba(255,255,255,0.5);
    z-index: 10;
    border: 3px solid rgba(255,255,255,0.7);
}

.function-shape.pair-highlighted {
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2), 0 2px 4px rgba(0,0,0,0.1), inset 0 1px rgba(255,255,255,0.3);
    z-index: 5;
    border: 2px solid rgba(255,255,255,0.5);
}

/* Different borders for introverted/extroverted */
.function-shape.introverted {
    border-style: dashed;
    opacity: 0.9;
}
.function-shape.extroverted {
    border-style: solid;
    border-width: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.1), inset 0 2px rgba(255,255,255,0.4);
}

/* Focus state for accessibility */
.function-shape:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 125, 250, 0.6), 0 8px 15px rgba(0,0,0,0.25);
}

/* Pulse animation for selected item */
@keyframes gentle-pulse {
    0% { box-shadow: 0 10px 20px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.4); }
    50% { box-shadow: 0 12px 24px rgba(0,0,0,0.35), 0 3px 6px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.5); }
    100% { box-shadow: 0 10px 20px rgba(0,0,0,0.25), 0 2px 4px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.4); }
}

.function-shape.highlighted {
    animation: gentle-pulse 2s infinite ease-in-out;
}

/* --- Sidebar Content in Description Area --- */
#sidebar-content {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

#sidebar-content h3, #sidebar-content h4 {
    margin-top: 15px;
    color: #343a40;
}

/* Style the original description in perceiving functions section */
.original-description {
    background-color: #fff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.original-description h3 {
    margin-bottom: 12px;
    font-size: 1.2em;
    color: #1d1d1f;
}

/* Hide the empty sidebar elements since we moved the content */
.sidebar-toggle-btn, 
.details-sidebar {
    display: none !important;
}

/* Make sure the sidebar content in description area has proper spacing */
#description-area {
    padding-bottom: 30px;
}

/* Update media queries for the new layout */
@media (max-width: 768px) {
    #sidebar-content {
        padding: 15px;
    }
    
    .original-description {
        padding: 15px;
    }
}

/* --- Sidebar Styles --- */
/* Removed styles for sidebar-toggle-btn and details-sidebar */

/* Position the container element as relative so the absolute positioning of the button works */
.container {
    position: relative;
    padding-top: 10px; /* Add a bit of padding to prevent overlap with the title */
}

/* Media Query for smaller screens */
@media (max-width: 768px) {
    
}

/* Remove the indicator styling since we're using the toggle button */
/* .sidebar-indicator {
    display: none;
} */

/* Add specific color classes for each function type */
.function-color-Ne {
    color: #ff7043 !important; /* Deep Orange light */
}
.function-color-Si {
    color: #42a5f5 !important; /* Blue light */
}
.function-color-Ni {
    color: #ab47bc !important; /* Purple light */
}
.function-color-Se {
    color: #ffca28 !important; /* Amber light */
}
.function-color-Te {
    color: #ef5350 !important; /* Red light */
}
.function-color-Fi {
    color: #66bb6a !important; /* Green light */
}
.function-color-Ti {
    color: #29b6f6 !important; /* Light Blue light */
}
.function-color-Fe {
    color: #ffa726 !important; /* Orange light */
}

/* Mantine-inspired Function Shape/Badge Styles */
.function-shape {
    padding: 1rem 1.5rem;
    border-radius: var(--mantine-radius-md);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--mantine-shadow-xs), 0 3px 5px rgba(0,0,0,0.15), inset 0 1px rgba(255,255,255,0.3);
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    min-width: 80px;
    display: inline-block; /* Ensure proper layout */
    transform: translateZ(0);
}

.function-shape.perceiving {
    background-color: var(--mantine-color-blue-1);
    color: var(--mantine-color-blue-9);
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.05) 100%);
}

.function-shape.judging {
    background-color: var(--mantine-color-red-1);
    color: var(--mantine-color-red-9);
    background-image: linear-gradient(to bottom, rgba(255,255,255,0.15) 0%, rgba(0,0,0,0.05) 100%);
}

/* Hover Effects */
.function-shape.perceiving:hover {
    background-color: var(--mantine-color-blue-2);
    box-shadow: var(--mantine-shadow-sm), 0 5px 10px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.4);
    transform: translateY(-2px);
}

.function-shape.judging:hover {
    background-color: var(--mantine-color-red-2);
    box-shadow: var(--mantine-shadow-sm), 0 5px 10px rgba(0,0,0,0.2), inset 0 1px rgba(255,255,255,0.4);
    transform: translateY(-2px);
}