body {
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #000;
    color: #fff;
    font-family: 'Roboto', 'Helvetica Neue', sans-serif;
    font-weight: 200;
    letter-spacing: 0.02em;
}

#robot-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    display: flex;
    justify-content: center;
    align-items: center;
    transform: scale(0.6);
    transform-origin: center center;
    transition: transform 0.3s ease;
}

/* Create a containing div for all avatar parts to keep them together */
#avatar-wrapper {
    position: relative;
    width: 550px; /* Match the width of the body image */
    height: 800px; /* Approximate height to contain all elements */
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, filter 0.3s ease-in-out;
}

#avatar-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%;
    height: 120%;
    background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, rgba(255,255,255,0) 70%);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
    z-index: -1;
}

#avatar-wrapper.glow-100::before {
    opacity: 1;
}

#avatar-wrapper.glow-50::before {
    opacity: 0.5;
}

#avatar-wrapper.glow-0::before {
    opacity: 0;
}

#robot-face {
    position: absolute;
    top: 130px; /* Fixed position from top of wrapper */
    left: 50%;
    transform: translateX(-50%);
    width: 250px; /* Give it a specific width */
    height: 250px; /* Give it a specific height */
    z-index: 20;
    transform-origin: center center;
}

.speaking #robot-face {
    animation: subtle-bounce 1s infinite;
    filter: none;
}

.listening #robot-face {
    filter: none;
}

.eyes {
    position: absolute;
    top: 84px; 
    left: 50%;
    transform: translateX(calc(-50% + var(--eye-x-offset, 0)));
    width: 130px; /* Increased by 10px to accommodate the wider spacing */
    display: flex;
    justify-content: space-between;
    gap: 0;
    padding: 0;
    --eye-x-offset: 0px;
    transition: transform 0.2s ease-out;
}

.eye {
    width: 35px;
    height: 35px;
    background: #ffffff;
    border-radius: 50%;
    position: relative;
    overflow: visible;
    animation: blink 4s infinite;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.eye-lid {
    position: absolute;
    width: 35px;
    height: 35px;
    background: #ffffff;
    border-radius: 50%;
    transform-origin: center top;
    transition: transform 0.2s;
    transform: scaleY(0);
}

/* Base mouth styles */
#robot-mouth {
    position: absolute;
    top: 155px; /* Moved up 10 more pixels from 165px */
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 60px;
    background: transparent;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.1, 0.25, 1);
    overflow: visible;
    border: none;
    outline: none;
}

/* The two rectangles that make up the mouth */
.mouth-rect {
    background: #ffffff;
    border-radius: 7px;
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
    transform-origin: center;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.5);
}

.mouth-rect-top {
    width: 55px;
    height: 10px;
    margin-bottom: 0;
}

.mouth-rect-bottom {
    width: 55px;
    height: 10px;
    margin-top: 0;
}

/* Speaking state */
.speaking #robot-mouth {
    filter: brightness(1.2);
}

/* Default mouth shape (neutral) - rectangles touching */
.mouth-shape-default .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: scaleX(1) translateY(0);
}

.mouth-shape-default .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: scaleX(1) translateY(0);
}

/* A sound - wide open mouth */
.mouth-shape-A .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-7px) scaleX(1.2);
}

.mouth-shape-A .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(7px) scaleX(1.2);
}

/* E sound - medium open with wider top */
.mouth-shape-E .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-3px) scaleX(1.3);
}

.mouth-shape-E .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(3px) scaleX(0.9);
}

/* I sound - narrow vertical opening */
.mouth-shape-I .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-2px) scaleX(0.5);
}

.mouth-shape-I .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(2px) scaleX(0.5);
}

/* O sound - rounded shape */
.mouth-shape-O .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-5px) scaleX(0.8) scaleY(1.2);
    border-radius: 14px 14px 3px 3px;
}

.mouth-shape-O .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(5px) scaleX(0.8) scaleY(1.2);
    border-radius: 3px 3px 14px 14px;
}

/* U sound - small rounded opening */
.mouth-shape-U .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-3px) scaleX(0.6);
    border-radius: 10px 10px 3px 3px;
}

.mouth-shape-U .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(3px) scaleX(0.6);
    border-radius: 3px 3px 10px 10px;
}

/* M/B sound - closed lips (completely overlapping) */
.mouth-shape-M .mouth-rect-top,
.mouth-shape-B .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(0) scaleX(1.1);
}

.mouth-shape-M .mouth-rect-bottom,
.mouth-shape-B .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(0) scaleX(1.1);
    margin-top: -10px;
}

/* F sound - top lip over bottom */
.mouth-shape-F .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(0) scaleX(1.1);
}

.mouth-shape-F .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(5px) scaleX(0.9);
}

/* L sound - tongue up */
.mouth-shape-L .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-2px) scaleX(0.9);
}

.mouth-shape-L .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(5px) scaleX(1.1);
}

/* W sound - rounded with movement */
.mouth-shape-W .mouth-rect-top {
    width: 55px;
    height: 10px;
    transform: translateY(-4px) scaleX(0.7) scaleY(1.1);
    border-radius: 10px;
}

.mouth-shape-W .mouth-rect-bottom {
    width: 55px;
    height: 10px;
    transform: translateY(4px) scaleX(0.7) scaleY(1.1);
    border-radius: 10px;
}

/* Transitioning between shapes */
#robot-mouth.transitioning .mouth-rect {
    transition: all 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* Debug display */
#phoneme-debug {
    position: fixed;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: #0066cc;
    padding: 10px;
    border-radius: 5px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    z-index: 1000;
}

#conversation-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 800px;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
}

#transcription {
    position: relative;
    max-width: 70%;
    font-size: 18px;
    color: #000;
    text-align: left;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    background-color: #b9b9b9;
    padding: 12px 16px;
    border-radius: 18px 18px 0 18px;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
    margin-right: 0;
    align-self: flex-end;
}

#transcription:empty {
    display: none;
}

#transcription:after {
    content: "";
    position: absolute;
    bottom: 0;
    right: -10px;
    width: 20px;
    height: 20px;
    background-color: #b9b9b9;
    clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

#response-message {
    position: relative;
    max-width: 70%;
    font-size: 18px;
    color: #000;
    text-align: left;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    background-color: #fff;
    padding: 12px 16px;
    border-radius: 18px 18px 18px 0;
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 1;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    word-wrap: break-word;
    line-height: 1.4;
    margin-top: 10px;
    margin-left: 0;
    align-self: flex-start;
}

#response-message:empty {
    display: none;
}

#response-message:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: -10px;
    width: 20px;
    height: 20px;
    background-color: #fff;
    clip-path: polygon(100% 0, 0 100%, 100% 100%);
}

#transcription.active {
    opacity: 1;
}

#status-container {
    position: relative;
    margin: 20px;
    max-width: 600px;
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#status {
    padding: 20px;
    border-radius: 10px;
    width: 100%;
    max-height: 300px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    font-size: 24px; /* Default font size, will be controlled by JS */
    overflow-y: auto;
    line-height: 1.4;
    letter-spacing: var(--letter-spacing-normal);
    transition: all 0.3s ease, font-size 0.3s ease;
}

#status.active {
    /* Original styles go here */
    transition: all 0.3s ease, font-size 0.3s ease;
}

#status.long-content {
    /* The font size will be handled by JS with applyFontSize function */
}

#status.very-long-content {
    /* The font size will be handled by JS with applyFontSize function */
}

/* Add a subtle indicator for the waiting state without changing the overall look */
#status.waiting-for-activation {
    font-style: italic;
    animation: pulse 2s infinite ease-in-out;
}

@keyframes subtle-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

@keyframes glow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

@keyframes blink {
    0%, 96%, 100% { transform: scaleY(1); }
    98% { transform: scaleY(0.1); }
}

@keyframes mouth-pulse {
    0%, 100% { transform: translateX(-50%) scaleY(1); }
    50% { transform: translateX(-50%) scaleY(0.8); }
}

@keyframes mouth-move {
    0% { transform: translateY(0); }
    100% { transform: translateY(-5px); }
}

#robot-container:hover {
    transform: scale(1.02);
    transition: transform 0.3s ease;
}

#robot-face:hover {
    transform: translate(-50%, -50%);
}

#ai-transcription {
    position: fixed;
    top: 40px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 16px;
    color: rgba(255, 255, 255, 0.6);
    text-align: center;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    pointer-events: none;
    transition: opacity 0.3s;
    opacity: 0;
}

#ai-transcription.active {
    opacity: 1;
}

#start-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    z-index: 1000;
    overflow-y: auto;
}

#start-button {
    position: absolute;
    left: 50%;
    margin-top: 40px;
    transform: translateX(-50%);
    padding: 15px 40px;
    font-size: 18px;
    background: #1a90ff;
    color: white;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(26, 144, 255, 0.4);
    font-weight: var(--medium-weight);
    font-family: var(--main-font);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    z-index: 1001; /* Ensure it's above other elements */
}

#start-button:hover {
    box-shadow: 0 6px 20px rgba(26, 144, 255, 0.6);
}

.hidden {
    display: none !important;
}

.config-container {
    margin: 20px 0;
    width: 90%;
    max-width: 800px;
    background: rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.config-container textarea {
    width: 100%;
    min-height: 120px;
    padding: 8px;
    margin: 8px 0;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    resize: vertical;
    overflow-y: hidden;
    transition: height 0.2s ease;
}

.config-container select {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    font-family: var(--main-font);
    font-weight: var(--thin-weight);
}

.config-container label {
    display: block;
    margin-top: 8px;
    color: #fff;
    font-family: var(--main-font);
    font-weight: var(--regular-weight);
    letter-spacing: var(--letter-spacing-normal);
}

.config-group {
    margin: 12px 0;
    position: relative;
}

.config-group input[type="range"] {
    width: 100%;
    margin: 8px 0;
}

.config-group input[type="number"] {
    width: 80px;
    padding: 5px;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: var(--main-font);
    font-weight: var(--thin-weight);
}

.parameter-value {
    color: #1a90ff;
    font-weight: var(--medium-weight);
}

.parameter-description {
    font-size: 0.9em;
    color: #888;
    margin-top: 5px;
    font-family: var(--main-font);
    font-weight: var(--thin-weight);
}

#glow-control {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #1a90ff;
    display: flex;
    align-items: center;
    gap: 10px;
}

#glow-control input[type="range"] {
    width: 100px;
    accent-color: #1a90ff;
}

#glow-control label {
    color: #1a90ff;
    font-size: 14px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
}

/* Add class for slower transitions */
#robot-face.slow-transition {
    transition: box-shadow 2s ease;
}

#robot-face.speaking-transition {
    transition: box-shadow 1s ease;
}

.text-input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    background: #222;
    color: #fff;
    border: 1px solid #444;
    border-radius: 4px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
}

#debug-controls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.style-selector {
    display: flex;
    gap: 5px;
}

.debug-button {
    background: rgba(0, 0, 0, 0.7);
    color: #1a90ff;
    border: 1px solid #1a90ff;
    border-radius: 5px;
    padding: 8px 12px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.debug-button:hover {
    background: rgba(26, 144, 255, 0.2);
}

.style-button.active {
    background: rgba(26, 144, 255, 0.5);
    color: white;
}

/* Position the eye */
.eye {
    position: relative;
}

/* Add this new style for the case when AI is speaking but we're still showing transcription */
.speaking-but-listening {
    opacity: 0.7 !important;
    background-color: rgba(230, 240, 255, 0.8) !important;
    border: 1px solid #1a90ff !important;
    font-style: italic !important;
}

/* Animation to subtly pulse when waiting for activation */
@keyframes pulse {
    0% { opacity: 0.7; }
    50% { opacity: 1; }
    100% { opacity: 0.7; }
}

/* Advanced settings toggle */
.advanced-settings-toggle {
    margin: 20px 0;
    width: 100%;
}

#advanced-toggle {
    width: 100%;
    padding: 12px 15px;
    background: rgba(26, 144, 255, 0.1);
    color: #1a90ff;
    border: 1px solid #1a90ff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: var(--regular-weight);
    font-family: var(--main-font);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    letter-spacing: var(--letter-spacing-normal);
    text-transform: uppercase;
}

#advanced-toggle:hover {
    background: rgba(26, 144, 255, 0.2);
}

#advanced-toggle i {
    transition: transform 0.3s ease;
}

#advanced-toggle.active i {
    transform: rotate(180deg);
}

#advanced-settings {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(26, 144, 255, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 1000px;
}

#advanced-settings.hidden {
    max-height: 0;
    padding: 0 15px;
    margin-top: 0;
    border: none;
    opacity: 0;
}

#advanced-settings label {
    margin-bottom: 5px;
}

#advanced-settings select,
#advanced-settings input {
    margin-bottom: 15px;
}

/* Toggle Switch Styling */
.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
}

.toggle-container label {
    flex: 1;
    margin-right: 10px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    margin-right: 10px;
}

.toggle-switch input {
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    position: absolute;
    z-index: 2;
    cursor: pointer;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #555;
    transition: .3s;
    border-radius: 22px;
    z-index: 1;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: #1e70d8;
}

input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* Debug Panel Styles */
#debug-panel {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    transition: opacity 0.3s ease;
}

#debug-panel.hidden {
    display: none;
}

.debug-buttons {
    display: flex;
    gap: 15px;
}

.debug-btn {
    background: rgba(30, 30, 40, 0.8);
    color: #64ffda;
    border: 1px solid #64ffda;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.debug-btn:hover {
    background: rgba(40, 40, 60, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(100, 255, 218, 0.15);
}

.debug-btn:active {
    transform: translateY(1px);
}

/* Debug Popup Styles */
#debug-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#debug-popup.visible {
    opacity: 1;
    visibility: visible;
}

#debug-popup.hidden {
    display: none;
}

.popup-content {
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    background: rgba(25, 25, 35, 0.95);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(100, 255, 218, 0.3);
    backdrop-filter: blur(10px);
    overflow-y: auto;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.popup-header h3 {
    margin: 0;
    color: #64ffda;
    font-size: 20px;
    font-family: var(--main-font);
    font-weight: var(--medium-weight);
    letter-spacing: var(--letter-spacing-wide);
}

.close-btn {
    background: transparent;
    border: none;
    color: #ccc;
    font-size: 20px;
    cursor: pointer;
    transition: color 0.3s ease;
    padding: 5px;
}

.close-btn:hover {
    color: #fff;
}

/* Countdown Timer */
#countdown-timer {
    position: absolute;
    top: 100px; 
    left: 50%;
    transform: translateX(-50%) scale(0.8);
    width: 300px; /* Wider for a bar shape */
    height: 8px; /* Much thinner for a simple bar */
    z-index: 1000;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
    outline: none;
    border: none;
    filter: none;
    text-shadow: none;
    box-shadow: none !important;
}

#countdown-timer.waiting-mode {
    opacity: 0.9;
    transform: translateX(-50%) scale(1);
    box-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
}

#countdown-timer.visible {
    opacity: 0.8;
    transform: translateX(-50%) scale(1);
}

#countdown-timer.waiting-mode.visible {
    opacity: 0.9;
    transform: translateX(-50%) scale(1);
    box-shadow: none !important;
    filter: none !important;
    border: none !important;
    outline: none !important;
}

#countdown-timer.hidden {
    display: none;
}

.countdown-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* Changed from center to flex-start for left-to-right shrinking */
    filter: none;
    box-shadow: none;
}

.countdown-background {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 4px; /* 4px corners as requested */
    background-color: rgba(0, 0, 0, 0.5);
    box-shadow: none;
    border: none;
}

.countdown-progress {
    position: absolute;
    height: 100%;
    width: var(--progress, 100%); /* Width controlled by progress percentage */
    border-radius: 4px; /* 4px corners as requested */
    background-color: rgba(52, 152, 219, 0.8); /* Solid color instead of gradient */
    transition: width 0.2s linear; /* Animate width instead of background */
    box-shadow: none !important;
    filter: none !important;
    transform: none; /* Remove the rotation transform */
}

/* Grid layout for advanced settings */
.advanced-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-gap: 15px;
    margin-bottom: 10px;
}

.advanced-settings-grid .config-group {
    margin: 0;
}

.advanced-settings-grid .full-width {
    grid-column: 1 / 3;
}

/* Info button and tooltip */
.info-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #1e70d8;
    color: white;
    font-size: 12px;
    margin-left: 6px;
    cursor: pointer;
    position: relative;
}

.tooltip {
    visibility: hidden;
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 8px 12px;
    border-radius: 6px;
    width: 200px;
    font-size: 12px;
    line-height: 1.4;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
}

.info-button:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

/* Hide parameter descriptions, now shown in tooltips */
.parameter-description {
    display: none;
}

.advanced-settings-grid .parameter-description {
    color: #ddd;
    font-size: 13px;
    margin-top: 5px;
}

/* Phrase Activated Functions Styles */
#phrase-functions-toggle {
    width: 100%;
    padding: 12px 15px;
    background: rgba(26, 144, 255, 0.1);
    color: #1a90ff;
    border: 1px solid #1a90ff;
    border-radius: 8px;
    font-size: 14px;
    font-weight: var(--regular-weight);
    font-family: var(--main-font);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    letter-spacing: var(--letter-spacing-normal);
    text-transform: uppercase;
}

#phrase-functions-toggle:hover {
    background: rgba(26, 144, 255, 0.2);
}

#phrase-functions-toggle i {
    transition: transform 0.3s ease;
}

#phrase-functions-toggle.active i {
    transform: rotate(180deg);
}

#phrase-functions-settings {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
    border: 1px solid rgba(26, 144, 255, 0.3);
    transition: all 0.3s ease;
    overflow: hidden;
    max-height: 1000px;
}

#phrase-functions-settings.hidden {
    max-height: 0;
    padding: 0 15px;
    margin-top: 0;
    border: none;
    opacity: 0;
}

.phrase-functions-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.phrase-functions-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 300px;
    overflow-y: auto;
    /* Add styled scrollbar that matches advanced settings */
    scrollbar-width: thin;
    scrollbar-color: rgba(30, 112, 216, 0.5) rgba(0, 0, 0, 0.3);
}

.phrase-functions-list::-webkit-scrollbar {
    width: 8px;
}

.phrase-functions-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.phrase-functions-list::-webkit-scrollbar-thumb {
    background-color: rgba(30, 112, 216, 0.5);
    border-radius: 4px;
}

.phrase-function-item {
    background: rgba(30, 112, 216, 0.1);
    border: 1px solid rgba(30, 112, 216, 0.3);
    border-radius: 4px;
    padding: 15px;
    position: relative;
    transition: background-color 0.2s;
}

.phrase-function-item:hover {
    background: rgba(30, 112, 216, 0.15);
}

.phrase-function-expanded {
    background: rgba(30, 112, 216, 0.2);
}

.phrase-function-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.phrase-function-title {
    font-weight: var(--medium-weight);
    font-family: var(--main-font);
    color: #fff;
    letter-spacing: var(--letter-spacing-normal);
}

.phrase-function-actions {
    display: flex;
    gap: 10px;
}

.phrase-function-action-btn {
    background: none;
    border: none;
    color: #1e70d8;
    cursor: pointer;
    font-size: 16px;
    padding: 5px;
    transition: color 0.2s;
}

.phrase-function-action-btn:hover {
    color: #fff;
}

.phrase-function-content {
    margin-top: 15px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    overflow: hidden;
    transition: opacity 0.3s, max-height 0.3s;
}

.phrase-function-content.closing {
    opacity: 0;
    max-height: 0;
}

.phrase-function-field {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.phrase-function-field label {
    font-size: 14px;
    color: #ccc;
    font-family: var(--main-font);
    font-weight: var(--thin-weight);
}

.phrase-function-field input,
.phrase-function-field textarea {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(30, 112, 216, 0.3);
    border-radius: 4px;
    padding: 10px;
    color: #fff;
    font-size: 14px;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
}

.phrase-function-field textarea {
    min-height: 60px;
    resize: vertical;
}

.add-phrase-btn {
    background: rgba(30, 112, 216, 0.3);
    border: 1px solid #1e70d8;
    border-radius: 4px;
    padding: 10px;
    color: #fff;
    font-size: 13px;
    font-family: var(--main-font);
    font-weight: var(--regular-weight);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color 0.2s;
    letter-spacing: var(--letter-spacing-normal);
    text-transform: uppercase;
}

.add-phrase-btn:hover {
    background: rgba(30, 112, 216, 0.5);
}

.phrase-function-save-btn {
    background: #1e70d8;
    border: none;
    border-radius: 4px;
    padding: 10px;
    color: #fff;
    font-size: 13px;
    font-family: var(--main-font);
    font-weight: var(--regular-weight);
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.2s;
    width: 100%;
    text-align: center;
    letter-spacing: var(--letter-spacing-normal);
    text-transform: uppercase;
}

.phrase-function-save-btn:hover {
    background: #1555a0;
}

/* AI Debug Window */
#ai-debug-window {
    position: fixed;
    top: 10px;
    left: 10px;
    width: 350px;
    max-height: 90vh;
    background-color: rgba(0, 0, 0, 0.85);
    border: 1px solid #1e70d8;
    border-radius: 8px;
    box-shadow: 0 0 15px rgba(30, 112, 216, 0.5);
    z-index: 1000;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #fff;
    font-family: var(--mono-font);
    font-weight: var(--thin-weight);
    display: flex;
    flex-direction: column;
}

#ai-debug-window.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
}

.debug-window-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #1e70d8;
    font-family: var(--main-font);
    font-weight: var(--medium-weight);
}

.debug-window-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: bold;
}

.close-button {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.debug-window-content {
    padding: 10px;
    overflow-y: auto;
    max-height: calc(90vh - 40px);
}

.debug-section {
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

/* Connector symbol between debug sections */
.debug-connector {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    color: #1e70d8;
    margin: 5px 0;
    border-bottom: none;
    padding: 0;
}

.debug-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.debug-section h4 {
    font-size: 12px;
    margin: 0 0 5px 0;
    color: #1e70d8;
    font-family: var(--main-font);
    font-weight: var(--medium-weight);
}

.debug-section pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 11px;
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
    max-height: 200px;
    overflow-y: auto;
}

#debug-dialogue-history {
    font-size: 11px;
    max-height: 300px;
    overflow-y: auto;
}

.dialogue-message {
    margin-bottom: 5px;
    padding: 5px;
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.3);
}

.dialogue-message .role {
    font-weight: bold;
    color: #1e70d8;
}

.dialogue-message .content {
    word-break: break-word;
    white-space: pre-wrap;
}

.dialogue-message.system .role {
    color: #4caf50;
}

.dialogue-message.user .role {
    color: #ff9800;
}

.dialogue-message.assistant .role {
    color: #2196f3;
}

.dialogue-connector {
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    color: #1e70d8;
    margin: 5px 0;
    padding: 0;
}

.dialogue-empty {
    color: #888;
    font-style: italic;
    text-align: center;
    padding: 10px;
}

.dialogue-message.system .role {
    color: #4caf50;
}

/* Computer Vision section in debug window */
.vision-controls {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.vision-btn {
    background: #1e70d8;
    border: none;
    border-radius: 4px;
    padding: 5px 10px;
    color: #fff;
    font-size: 12px;
    font-family: var(--main-font);
    font-weight: var(--regular-weight);
    cursor: pointer;
    transition: background-color 0.2s;
}

.vision-btn:hover {
    background: #1555a0;
}

.eye-offset-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 10px 0;
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    font-family: var(--mono-font);
}

.eye-offset-label {
    font-size: 13px;
    color: #ccc;
    font-weight: var(--regular-weight);
}

.eye-offset-value {
    font-size: 15px;
    font-weight: var(--medium-weight);
    color: #999;
    font-family: monospace;
}

.camera-container {
    position: relative;
    width: 100%;
    margin-bottom: 10px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #000;
}

#camera-feed, #camera-canvas {
    width: 100%;
    height: auto;
    display: block;
}

#camera-canvas {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
}

.vision-results {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 5px;
    border-radius: 4px;
    max-height: 150px;
    overflow-y: auto;
    font-size: 11px;
}

/* Create an inactive state for the vision section when camera is off */
.camera-inactive #camera-feed,
.camera-inactive #camera-canvas {
    opacity: 0.5;
    filter: grayscale(100%);
}

.camera-inactive::before {
    content: "Camera Off";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 0 0 5px black;
    z-index: 2;
}

/* Eye tracking styles */
.eye-tracking-active .new-body-image[alt="New Body Eyebrows"] {
    transition: transform 0.3s ease-out;
}

/* Remove old orb and vest styles */
#robot-vest {
    display: none;
}

#avatar-body {
    display: none;
}

/* Define font variables for consistent usage */
:root {
    --main-font: 'Archivo', sans-serif;
    --mono-font: 'Archivo', 'Consolas', monospace;
    --thin-weight: 200;
    --regular-weight: 300;
    --medium-weight: 400;
    --letter-spacing-normal: 0.02em;
    --letter-spacing-wide: 0.05em;
} 