html {
    height: 100%;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 25%, #60a5fa 50%, #93c5fd 75%, #1e3a8a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

::selection {
    background-color: #60a5fa;
}

div {
    margin: 0;
}

body * {
    font-family: "Manrope", sans-serif;
    text-align: center;
    color: white;
    margin: 0;
    padding: 0;
}

body {
    margin: 0;
    overflow: hidden;
    height: 100vh;
    background: linear-gradient(135deg, 
        #1e3c72 0%, 
        #2563eb 25%,
        #3b82f6 50%,
        #1d4ed8 75%,
        #1e3a8a 100%);
}

header {
    display: flex;
    padding: 20px 32px 0;
    width: 100%;
}

h1 {
    text-align: left;
    color: rgb(29, 29, 29);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.48px;
}

#container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    font-size: 16px;
}

.header {
    display: flex;
    flex-direction: column;
    align-items: center
}

.didImage {
    vertical-align: text-bottom;
    padding-right: 0.2rem;
    width: 48px;
}

#previewName {
    font-size: 20px
}

#connectionLabel {
    font-weight: lighter;
    font-size: smaller;
    display: inline-block
}

.inputsDiv {
    display: flex;
    width: 100%;
}

button {
    font-size: 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    border-radius: 15px;
    transition: all 0.3s ease;
}

button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.mainInput {
    height: 52px;
    margin-bottom: 12px;
    width: 100%;
    -ms-flex-item-align: center;
    align-self: center;
    margin-top: 0;
    position: relative;
    height: 52px;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--focus, rgba(255, 255, 255, .6));
    z-index: 4;
    border-radius: 8px;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    padding: 8px 16px;
    -webkit-transition: height .3s ease, background-color .3s ease;
    transition: height .3s ease, background-color .3s ease;
}

.mainInput>textarea {
    position: relative;
    border: none;
    outline: none;
    resize: none;
    font-family: inherit;
    text-align: left;
    width: 100%;
    height: 100%;
    background: transparent;
    font-size: 16px;
    color: var(--did-secondary-shades-800);
    margin-top: 10px;
    -webkit-transition: margin-top .2s ease;
    transition: margin-top .2s ease;
    line-height: 20px;
}

.mainInput .roundButton {
    height: 36px;
}

.roundButton {
    height: 100%;
    aspect-ratio: 1;
    color: #fff;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    background: #efefef;
    border-radius: 100vmax;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-shadow: 0px 3px 3px 0px rgba(0, 0, 0, .07);
    box-shadow: 0 3px 3px #00000012;
    -webkit-transition: background-color .1s ease-out;
    transition: background-color .1s ease-out;
}

.roundButton:disabled * {
    color: rgba(16, 16, 16, 0.3)
}

.roundButton:hover {
    background-color: rgb(249, 249, 249);
}

.roundButton:disabled:hover {
    background-color: #efefef;
}

#speechButton {
    color: black;
}

#speechButton:disabled,
#actionButton:disabled {
    color: rgba(16, 16, 16, 0.3)
}

.button {
    color: rgb(9, 6, 4);
    border: 1px solid rgb(235, 235, 235);
    background-color: rgb(243, 243, 243);
    font-size: 18px;
    font-weight: 600;
    line-height: 28px;
    letter-spacing: -0.4px;
    gap: 16px;
    margin: 0.5rem;
    outline: none;
    cursor: pointer;
    min-width: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    padding: 6px;
    transition: background-color 150ms ease;
}

.button:hover {
    background-color: rgb(249, 249, 249);
}

.button:disabled {
    color: rgb(152, 152, 152);
    background-color: white;
    cursor: default;
}

#buttons {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    justify-content: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    padding: 15px 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

#buttons input[type="radio"] {
    display: none;
}

#buttons input[type="radio"]+label {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

#buttons input[type="radio"]+label:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

/* Label as selected (active radio) */
#buttons input[type="radio"]:checked+label {
    color: white;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transform: scale(1.05);
}

#answers {
    height: 200px;
    width: 100%;
    overflow: scroll;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.agentMessage {
    border-radius: 0 16px 16px;
    border: 1px solid var(--Blacks-300, #dbdbdb);
    margin-right: auto;
    position: relative;
    background: var(--Whites-White, #fff);
    padding: 10px 16px;
    min-width: 50px;
    max-width: 75%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0.5rem;
}

.userMessage {
    border-radius: 14px;
    background: var(--blacks-100, #f3f3f3);
    padding: 10px 16px;
    margin-left: auto;
    min-width: 50px;
    max-width: max-content;
    display: flex;
    justify-content: flex-end;
}

.ratingButtons {
    align-self: flex-end;
}

#videoElement,
#idleVideoElement {
    width: 100%;
    height: 100%;
}



#video-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;
}

#hidden {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 50%;
    height: 75vh;
    margin: 0 auto;
    justify-content: center;
}

#reconnectButton {
    color: white;
    background-color: rgb(9, 6, 4);
}

#reconnectButton:hover {
    background-color: #2B2A28;
}

/* Animations and Effects */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

/* Add floating animation to video wrapper */
#video-wrapper:hover {
    animation: float 3s ease-in-out infinite;
}

/* Add pulse to active speech button */
#speechButton.active {
    animation: pulse 1s ease-in-out infinite;
}

/* Listening indicator */
#speechButton.listening {
    background: rgba(0, 255, 0, 0.8) !important;
    animation: pulse 1.5s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.6);
}

/* Speaking indicator */
#speechButton.speaking {
    background: rgba(255, 0, 0, 0.8) !important;
    animation: pulse 0.8s ease-in-out infinite;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
}

/* Microphone permission indicator */
.mic-status {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.mic-status.granted {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.5);
}

.mic-status.denied {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
}

/* Audio Status Indicator */
.audio-status {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 10px 15px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 1000;
    backdrop-filter: blur(10px);
    display: none;
}

.audio-status.enabled {
    background: rgba(0, 255, 0, 0.2);
    border: 1px solid rgba(0, 255, 0, 0.5);
}

.audio-status.disabled {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.5);
}

/* Chat Sidebar Styles */
#chat-sidebar {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 10;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

#chat-sidebar.open {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
    margin: 0;
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: right;
    direction: rtl;
}

.chat-history-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    direction: rtl;
}

.chat-message {
    margin-bottom: 15px;
    padding: 12px;
    border-radius: 15px;
    max-width: 90%;
    animation: slideInFromRight 0.3s ease;
}

.chat-message.user {
    background: rgba(59, 130, 246, 0.3);
    margin-left: auto;
    text-align: right;
}

.chat-message.agent {
    background: rgba(255, 255, 255, 0.1);
    margin-right: auto;
    text-align: right;
}

.message-time {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 5px;
    display: block;
}

@keyframes slideInFromRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Controls Overlay */
#controls-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 5;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#controls-overlay > * {
    pointer-events: auto;
}

/* Chat Toggle Button */
.chat-toggle {
    position: fixed;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 15;
    transition: all 0.3s ease;
    font-size: 24px;
}

.chat-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.1);
}

/* Smooth transitions for all interactive elements */
* {
    transition: all 0.3s ease;
}