/* Body Styles */
body {
    background-color: #BFC5D9;
    padding-bottom: 20px;
    text-align: center;
    font-family: "Microsoft Yahei", monospace, "Microsoft Sans Serif", sans-serif, OpenSans-Light, PingFang SC;
}

body.darkMode {
    background-color: #252725;
}

body.darkMode .github-icon-svg {
    fill: #fff !important;
}

/* Main Container and Grid Layout */
.main-container {
    padding: 20px 15px;
}

.canvas-controls-row {
    margin-bottom: 20px;
}

/* Left Controls Column */
.left-controls {
    padding: 12px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.12);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

body.darkMode .left-controls {
    background-color: rgba(37, 39, 37, 0.85);
}

/* Control Groups */
.control-group {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.control-group:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

/* Layout for Legend and Node Categories in same row */
#label {
    flex: 1;
    margin-right: 8px;
}

#switches-container {
    flex: 1;
    margin-left: 8px;
    display: flex;
    flex-direction: column;
}

.control-label {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

body.darkMode .control-label {
    color: rgba(128, 128, 128, 0.96);
}

.button-group {
    display: flex;
    gap: 0;
}

.button-group span {
    flex: 1;
    padding: 5px 8px;
    border: 1px solid #ccc;
    background-color: #f0f0f0;
    color: #333;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.3s ease;
    text-align: center;
    border-radius: 6px !important;
}

.button-group span:first-child {
    border-radius: 4px 0 0 4px;
}

.button-group span:last-child {
    border-radius: 0 4px 4px 0;
    margin-left: -1px;
}

.button-group span.active {
    background-color: #333;
    color: #fff;
    font-weight: bold;
}

body.darkMode .button-group span {
    border: 1px solid #717171;
    background-color: #1f1f1e;
    color: rgba(128, 128, 128, 0.96);
}

body.darkMode .button-group span.active {
    background-color: rgba(69, 75, 111, 0.96);
    color: #808080;
}

/* Switches Container */
.switches-container {
    margin: 0px 0 20px 0;
}

.switcher-group {
    margin-bottom: 10.5px;
    padding-bottom: 0;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

.switcher-group:first-of-type {
    margin-top: 4.5px;
}

.switcher-label {
    display: none;
}

body.darkMode .switcher-label {
    display: none;
}

.switcher-group .button-group {
    flex: 1;
    gap: 0;
    display: flex;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Canvas Column */
.canvas-column {
    padding: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.canvas-wrapper {
    background-color: rgba(220, 225, 235, 0.98);
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    text-align: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

body.darkMode .canvas-wrapper {
    background-color: rgba(37, 39, 37, 0.95);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

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

/* Right Property Column */
.right-property {
    padding: 12px;
}

.property-panel {
    padding: 16px;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.12);
    max-height: 700px;
    overflow-y: auto;
    text-align: left;
}

body.darkMode .property-panel {
    background-color: rgba(37, 39, 37, 0.85);
}

.property-panel h4 {
    margin-top: 0;
    margin-bottom: 18px;
    font-size: 16px;
    font-weight: bold;
}

.property-panel p {
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.5;
}

/* Property Panel Section Labels */
#subclass,
#description,
#tag1,
#tag2,
#tag3,
#tag4,
#tag5,
#tag6 {
    display: block;
    font-size: 13px;
    font-weight: bold;
    color: #555;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Increase spacing between Subclass/Description labels and their content */
#subclass .label,
#description .label,
#tag1 .label,
#tag2 .label,
#tag3 .label,
#tag4 .label,
#tag5 .label,
#tag6 .label {
    display: inline-block;
    margin-bottom: 6px;
}

/* Add spacing to content that follows Subclass/Description labels */
#subclass > span:not(.label),
#description > span:not(.label),
#description div ~ span {
    display: block;
    margin-top: 6px;
    font-size: 14px;
    line-height: 1.6;
    color: #555;
}

body.darkMode #subclass > span:not(.label),
body.darkMode #description > span:not(.label),
body.darkMode #description div ~ span {
    color: rgba(200, 200, 200, 0.9);
}

body.darkMode #subclass,
body.darkMode #description,
body.darkMode #tag1,
body.darkMode #tag2,
body.darkMode #tag3,
body.darkMode #tag4,
body.darkMode #tag5,
body.darkMode #tag6 {
    color: rgba(128, 128, 128, 0.96);
}

/* Tips Button */
.tips-button {
    width: 100%;
    padding: 8px 10px;
    background-color: rgba(200, 200, 200, 0.3);
    color: #666;
    border: 1px solid rgba(150, 150, 150, 0.4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-block;
}

.tips-button:hover {
    background-color: rgba(200, 200, 200, 0.5);
    color: #333;
}

body.darkMode .tips-button {
    background-color: rgba(69, 75, 111, 0.3);
    color: rgba(180, 180, 180, 0.9);
    border: 1px solid rgba(100, 100, 100, 0.3);
}

body.darkMode .tips-button:hover {
    background-color: rgba(69, 75, 111, 0.5);
    color: rgba(220, 220, 220, 1);
}

/* Tooltips Section */
.tooltips-section {
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    margin-top: 0;
    text-align: left;
    font-size: 11px;
    line-height: 1.6;
    flex: 1;
    display: flex;
    flex-direction: column;
}

body.darkMode .tooltips-section {
    background-color: rgba(69, 75, 111, 0.1);
}

/* Title Header Container */
.title-header-container {
    padding: 0 15px;
    background-color: transparent;
    margin-bottom: 15px;
}

.title-header-row {
    display: flex;
    align-items: center;
    margin: 0;
    gap: 0;
    height: auto;
}

.title-col,
.spacer-col,
.github-icon-col,
.darkmode-col {
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.title-col {
    justify-content: flex-start;
    padding-left: 0;
}

.spacer-col {
    flex: 1;
}

.icons-col {
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.icons-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-right: 5px;
}

/* Desktop layout - ensure proper width and alignment */
@media only screen and (min-width: 993px) {
    .title-header-row {
        min-height: 60px;
    }

    #emotionNetName {
        font-size: 38px;
    }

    .github-icon svg {
        height: 20px !important;
        width: 20px !important;
    }

    #darkMode span {
        font-size: 11px;
        padding: 5px 8px;
    }
}

#emotionNetName {
    color: rgba(60, 80, 100, 1);
    font-size: 38px;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Arial, sans-serif;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin: 0;
    padding: 0;
    text-align: left;
}
#emotionNetName.darkMode {
    color: rgba(200, 220, 240, 1);
}

/* Legend Container */
#label {
    text-align: left;
    color: #f2f2f2;
    font-size: 16px;
}

#label-content {
    margin-top: 8px;
}

#label.darkMode {
    color: rgba(200, 200, 200, 0.96);
}

/* Legend Item Circles */
#label-content > div,
#label>div {
    margin-bottom: 18px;
}

/* Center label - add top margin */
#label-content > div:first-child {
    margin-top: 3px;
}

/* Legend Color Indicators */
#label span,
#label-content span {
    display: inline-block;
    width: 10px;
    height: 10px;
    position: relative;
    top: 2px;
    margin-right: 8px;
    margin-bottom: 2px;
    border-radius: 20px;
}

/* Display Mode Toggle */
#mode {
    /* removed absolute positioning */
    margin-top: 15px;
}

#mode .button-group span {
    display: inline-block;
    border: 1px solid rgba(150, 150, 150, 0.5);
    color: #666;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    background-color: rgba(220, 220, 220, 0.6);
    transition: all .3s ease;
    -o-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease;
    -webkit-transition: all .3s ease;
}

/* Active button state */
#mode .button-group span.active {
    background-color: rgba(100, 120, 140, 0.8);
    color: #fff;
    cursor: pointer;
    border: 1px solid rgba(80, 100, 120, 0.8);
}

/* Hover button state */
#mode .button-group span:hover {
    background-color: rgba(180, 180, 180, 0.7);
    color: #333;
    cursor: pointer;
}

#mode .button-group span.darkMode {
    border: 1px solid rgba(100, 100, 100, 0.4);
    color: rgba(180, 180, 180, 0.9);
    background-color: rgba(50, 50, 50, 0.6);
}

/* Active button state in dark mode */
#mode .button-group span.darkMode.active {
    background-color: rgba(80, 90, 110, 0.9);
    color: rgba(220, 220, 220, 1);
    border: 1px solid rgba(100, 120, 140, 0.6);
}

/* Hover button state in dark mode */
#mode .button-group span.darkMode:hover {
    background-color: rgba(70, 70, 70, 0.8);
    color: rgba(200, 200, 200, 1);
}

#darkMode {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.dark-mode-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(150, 150, 150, 0.4);
    background-color: rgba(220, 220, 220, 0.5);
    transition: all .3s ease;
    -o-transition: all .3s ease;
    -ms-transition: all .3s ease;
    -moz-transition: all .3s ease;
    -webkit-transition: all .3s ease;
}

.dark-mode-toggle:hover {
    background-color: rgba(200, 200, 200, 0.7);
    border: 1px solid rgba(120, 120, 120, 0.5);
}

.dark-mode-toggle .icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
    color: #666;
    transition: color .3s ease, transform .3s ease;
}

.dark-mode-toggle .icon-moon {
    display: block;
}

.dark-mode-toggle .icon-sun {
    display: none;
}

.dark-mode-toggle.darkMode {
    border: 1px solid rgba(100, 100, 100, 0.4);
    background-color: rgba(50, 50, 50, 0.6);
}

.dark-mode-toggle.darkMode:hover {
    background-color: rgba(70, 70, 70, 0.8);
    border: 1px solid rgba(100, 100, 100, 0.6);
}

.dark-mode-toggle.darkMode .icon-moon {
    display: none;
}

.dark-mode-toggle.darkMode .icon-sun {
    display: block;
    color: rgba(255, 200, 100, 0.95);
}

.dark-mode-toggle .icon-moon {
    color: rgba(150, 150, 150, 0.8);
}

.dark-mode-toggle:hover .icon {
    transform: rotate(20deg);
}

/* Legend and Categories Wrapper */
.legend-categories-wrapper {
    display: flex;
    flex-direction: row;
    gap: 8px;
    align-items: flex-start;
    padding-top: 20px;
}

/* Switcher styles - removed absolute positioning */
#switcher1, #switcher2, #switcher3, #switcher4 {
    /* removed absolute positioning - now using flex layout via .switcher-group */
}

/* Switcher button styles - Light Mode */
#switcher1 .button-group span,
#switcher2 .button-group span,
#switcher3 .button-group span,
#switcher4 .button-group span {
    display: inline-block;
    border: none;
    color: #666;
    background-color: rgba(200, 200, 210, 0.5);
    padding: 5px 12px;
    font-size: 11px;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Remove overlap - ensure proper spacing */
#switcher1 .button-group span:first-child,
#switcher2 .button-group span:first-child,
#switcher3 .button-group span:first-child,
#switcher4 .button-group span:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    margin-right: 0;
}

#switcher1 .button-group span:last-child,
#switcher2 .button-group span:last-child,
#switcher3 .button-group span:last-child,
#switcher4 .button-group span:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: 0;
    position: relative;
    left: 0;
}

/* Switcher button dark mode */
#switcher1 .button-group span.darkMode,
#switcher2 .button-group span.darkMode,
#switcher3 .button-group span.darkMode,
#switcher4 .button-group span.darkMode {
    border: none;
    color: rgba(180, 180, 180, 0.85);
    background-color: rgba(50, 50, 50, 0.7);
}

/* Active and hover states for switcher buttons - Light Mode */
#switcher1 .button-group span.active,
#switcher2 .button-group span.active,
#switcher3 .button-group span.active,
#switcher4 .button-group span.active {
    background-color: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 600;
    z-index: 2;
}

#switcher1 .button-group span.darkMode.active,
#switcher2 .button-group span.darkMode.active,
#switcher3 .button-group span.darkMode.active,
#switcher4 .button-group span.darkMode.active {
    background-color: rgba(90, 95, 100, 0.95);
    color: rgba(240, 240, 240, 0.98);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-weight: 600;
    z-index: 2;
}

/* Hover states for switcher buttons - Light Mode */
#switcher1 .button-group span:hover,
#switcher2 .button-group span:hover,
#switcher3 .button-group span:hover,
#switcher4 .button-group span:hover {
    background-color: rgba(230, 230, 240, 0.7);
    color: #555;
    cursor: pointer;
}

/* Hover states for switcher buttons in dark mode */
#switcher1 .button-group span.darkMode:hover,
#switcher2 .button-group span.darkMode:hover,
#switcher3 .button-group span.darkMode:hover,
#switcher4 .button-group span.darkMode:hover {
    background-color: rgba(65, 70, 75, 0.85);
    color: rgba(200, 200, 200, 0.95);
}

/* Paragraph transition effects */
p {
    transition: top .3s;
    -o-transition: top .3s;
    -ms-transition: top .3s;
    -moz-transition: top .3s;
    -webkit-transition: top .3s;
}

/* Active state for switcher4 (legacy style) - Light Mode */
#switcher4 span.active {
    background-color: rgba(255, 255, 255, 0.95);
    color: #4a5568;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    font-weight: 600;
    z-index: 2;
}

#switcher4 span.darkMode.active {
    background-color: rgba(90, 95, 100, 0.95);
    color: rgba(240, 240, 240, 0.98);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    font-weight: 600;
    z-index: 2;
}

/* Active and hover button states - Light Mode */
#switcher4 span:hover{
    background-color: rgba(230, 230, 240, 0.7);
    color: #555;
    cursor: pointer;
}

/* Hover button state - Dark Mode */
#switcher4 span.darkMode:hover {
    background-color: rgba(65, 70, 75, 0.85);
    color: rgba(200, 200, 200, 0.95);
}

/* Property info panel styles */
#labelProperty {
    /* removed absolute positioning */
    text-align: left;
}

#labelProperty p {
    color: #fff;
    font-size: 14px;
    margin-top: 0px;
    margin-bottom: 8px;
    line-height: 1.5;
}

/* Override inline font-size styles in property panel for better readability */
#subclass span,
#description span,
#tag1 span,
#tag2 span,
#tag3 span,
#tag4 span,
#tag5 span,
#tag6 span {
    font-size: 14px !important;
    line-height: 1.6;
}

/* Improve spacing for tag sections */
#tag1,
#tag2,
#tag3,
#tag4,
#tag5,
#tag6 {
    margin-top: 2px;
    margin-bottom: 4px;
}

/* Spacing for labels within tag sections */
#tag1 .label,
#tag2 .label,
#tag3 .label,
#tag4 .label,
#tag5 .label,
#tag6 .label {
    margin-bottom: 6px;
    margin-top: 4px;
}

/* Improve spacing between sections - showImage after tags */
#tag1 + .showImage,
#tag2 + .showImage,
#tag3 + .showImage,
#tag4 + .showImage,
#tag5 + .showImage,
#tag6 + .showImage {
    margin-top: 2px;
}

/* Reduce excessive spacing after description section */
#description + .showImage {
    margin-top: 4px;
}

/* Increase top margin for Human Face Expressions label */
#description .label[style*="background-color:#665d91"],
#description div .label[style*="#665d91"] {
    margin-top: 8px;
    display: inline-block;
}

/* Alternative: target labels with the specific background color */
#description div .label {
    margin-top: 8px;
}

/* Tooltips Section */
#tooltips {
    color: rgba(16,23,38,0.92);
    font-size: 12px;
    font-family: "Microsoft Yahei", monospace, "Microsoft Sans Serif";
}

#tooltips.darkMode {
    color: rgba(111, 110, 109, 0.92);
}

/* Search Input Styles */
#search input {
    color: #fff;
    border: none;
    outline: none;
    box-shadow: none;
    width: 100%;
    background-color: rgba(158, 162, 157, 0.72);
    padding: 8px 10px;
    border-radius: 4px;
}

#search input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Search Input Dark Mode */
#search input.darkMode {
    background-color: #1f1f1e;
    color: rgba(200, 200, 200, 0.9);
}

#search input.darkMode::placeholder {
    color: rgba(128, 128, 128, 0.6);
}


#project-footer{
    position: relative;
    top: 10em;
    text-align: center;
}

/* GitHub icon styles */
.github-icon {
    color: rgba(236, 235, 234, 0.85) !important;
    transition: color 0.3s ease, opacity 0.3s ease;
    opacity: 0.9;
}

.github-icon:hover {
    color: rgba(236, 235, 234, 1) !important;
    opacity: 1;
}

body.darkMode .github-icon {
    color: rgba(69, 75, 111, 0.85) !important;
    opacity: 0.9;
}

body.darkMode .github-icon:hover {
    color: rgba(69, 75, 111, 1) !important;
    opacity: 1;
}

/* Tooltips toggle button - Hidden on desktop, shown on mobile/tablet */
#tooltips-toggle {
    display: none; /* Hidden by default on desktop */
    position: absolute;
    left: 40px;
    top: 380px;
    background-color: rgba(236, 235, 234, 0.2);
    color: rgba(60, 60, 60, 0.9);
    border: 1px solid rgba(200, 200, 200, 0.4);
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

#tooltips-toggle:hover {
    background-color: rgba(236, 235, 234, 0.35);
    transform: translateY(-2px);
}

body.darkMode #tooltips-toggle {
    background-color: rgba(69, 75, 111, 0.25);
    color: rgba(236, 235, 234, 0.9);
    border: 1px solid rgba(69, 75, 111, 0.5);
}

body.darkMode #tooltips-toggle:hover {
    background-color: rgba(69, 75, 111, 0.4);
}

/* Tooltips visibility states */
#tooltips.tooltips-visible {
    display: block;
}

#tooltips.tooltips-hidden {
    display: none;
}

/* =====================================
   RESPONSIVE DESIGN STYLES
   ===================================== */

/* Tablets and smaller devices (max-width: 992px) */
@media only screen and (max-width: 992px) {
    .main-container {
        padding: 15px 10px;
    }

    .left-controls,
    .canvas-column,
    .right-property {
        padding: 10px;
    }

    .emotion-canvas {
        max-width: 100%;
    }

    .property-panel {
        max-height: 400px;
        font-size: 11px;
    }

    .control-label {
        font-size: 12px;
    }

    .switcher-group {
        flex-direction: column;
    }

    /* Tablet header */
    .title-header-container {
        padding: 0 10px;
        margin-bottom: 8px;
    }

    .title-header-row {
        height: auto;
        min-height: 45px;
        align-items: center;
    }

    #emotionNetName {
        font-size: 24px;
        margin: 0;
        padding: 0;
    }

    .github-icon svg {
        height: 16px !important;
        width: 16px !important;
    }

    #darkMode span {
        font-size: 9px;
        padding: 2px 4px;
    }

    #project-footer {
        font-size: 10px;
    }
}

/* Mobile devices (max-width: 768px) - Custom layout */
@media only screen and (max-width: 768px) {
    body {
        padding-bottom: 10px;
    }

    .main-container {
        padding: 10px 8px;
    }

    /* Mobile header with Bootstrap grid */
    .title-header-container {
        padding: 0 10px;
        margin-bottom: 8px;
    }

    .title-header-row {
        height: auto;
        min-height: 50px;
        align-items: center;
    }

    .title-col,
    .spacer-col {
        padding: 0 3px;
    }

    #emotionNetName {
        font-size: 16px;
        margin: 0;
        padding: 0;
    }

    .icons-col {
        padding: 0 3px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
    }

    .icons-container {
        display: flex;
        align-items: center;
        gap: 5px;
        padding-right: 5px;
    }

    .github-icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .github-icon svg {
        height: 20px !important;
        width: 20px !important;
    }

    #darkMode {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    .dark-mode-toggle {
        padding: 6px 8px;
        border-radius: 6px;
        border: 1px solid rgba(150, 150, 150, 0.4);
        background-color: rgba(220, 220, 220, 0.5);
    }

    .dark-mode-toggle:hover {
        background-color: rgba(200, 200, 200, 0.7);
        border: 1px solid rgba(120, 120, 120, 0.5);
    }

    .dark-mode-toggle .icon {
        width: 18px;
        height: 18px;
        color: rgba(150, 150, 150, 0.8);
    }

    .dark-mode-toggle.darkMode {
        border: 1px solid rgba(100, 100, 100, 0.4);
        background-color: rgba(50, 50, 50, 0.6);
    }

    .dark-mode-toggle.darkMode:hover {
        background-color: rgba(70, 70, 70, 0.8);
        border: 1px solid rgba(100, 100, 100, 0.6);
    }

    .dark-mode-toggle.darkMode .icon-sun {
        color: rgba(255, 180, 80, 0.95);
    }

    /* Mobile layout: Canvas first, then Display/Property side by side, Tips last */
    .canvas-controls-row {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Order: Canvas (1) -> Display (2) -> Property (2) -> Tips (3) */
    .canvas-column {
        order: 1;
        width: 100%;
        padding: 8px;
        margin-bottom: 8px;
        margin-left: 16px;
    }

    .canvas-wrapper {
        padding: 8px;
    }

    .left-controls {
        order: 2;
        width: calc(50% - 4px);
        padding: 8px 10px;
        margin-bottom: 0;
        margin-right: 0;
        margin-left: 0;
    }

    .right-property {
        order: 2;
        width: calc(50% - 4px);
        padding: 8px 10px;
        margin-bottom: 0;
        margin-left: 0;
        margin-right: 0;
    }

    /* Stack legend and node categories on mobile */
    #label,
    #switches-container {
        display: flex;
        flex-direction: column;
    }

    /* Adjust property panel height on mobile */
    .property-panel {
        max-height: 400px;
        font-size: 11px;
    }

    /* Tips button styling for mobile */
    #tooltips-toggle {
        display: block;
        width: 100%;
        margin-top: 0;
    }

    .emotion-canvas {
        width: 100% !important;
        height: auto !important;
        max-width: 100%;
    }

    .property-panel {
        max-height: 300px;
        font-size: 12px;
        padding: 10px;
    }

    .property-panel h4 {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .property-panel .label {
        font-size: 11px;
        padding: 3px 6px;
    }

    #subclass span,
    #description span,
    #tag1 span,
    #tag2 span,
    #tag3 span,
    #tag4 span,
    #tag5 span,
    #tag6 span {
        font-size: 12px !important;
    }

    .control-group {
        margin-bottom: 8px;
        padding-bottom: 8px;
    }

    /* Mode toggle button - mobile specific */
    #mode {
        margin-top: 0 !important;
        margin-bottom: 8px;
        padding-top: 0;
        padding-bottom: 4px;
    }

    #mode.control-group {
        margin-bottom: 8px;
        padding-bottom: 4px;
    }

    #mode .button-group span {
        padding: 4px 6px;
        font-size: 9px;
    }

    .control-label {
        font-size: 17px;
        margin-bottom: 5px;
        font-weight: 600;
    }

    #search input {
        font-size: 10px;
        padding: 6px 8px;
    }

    .switcher-group {
        flex-direction: row;
        align-items: center;
    }

    .switcher-label {
        min-width: 45px;
        font-size: 10px;
    }

    .switcher-group .button-group {
        flex: 1;
    }

    .switcher-group .button-group span {
        padding: 4px 7px;
        font-size: 9px;
    }

    .tips-button {
        display: block;
        padding: 8px 12px;
        font-size: 11px;
    }

    #tooltips {
        display: none !important;
    }

    #tooltips small {
        font-size: 7px;
        line-height: 1.3;
    }

    /* Legend - mobile adjustments */
    .legend-categories-wrapper {
        gap: 4px;
        padding-top: 10px;
        margin-left: 6px;
    }

    #label-content {
        font-size: 12px;
        font-weight: 500;
    }

    #label-content > div {
        margin-bottom: 10px;
    }

    #label span,
    #label-content span {
        width: 14px;
        height: 14px;
        margin-right: 8px;
    }

    .switcher-group {
        margin-bottom: 6px;
    }

    #project-footer {
        font-size: 9px;
        position: static;
        margin-top: 15px;
        padding: 10px;
    }
}