* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #1a1a1a;
    color: #ffffff;
    overflow: hidden; /* To contain floating symbols */
}

/* Floating scientific symbols background */
.bg-symbols {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.floating-symbol {
    position: absolute;
    font-size: 2rem;
    font-weight: 300;
    user-select: none;
    color: #0ff;
    text-shadow:
        0 0 5px #0ff,
        0 0 10px #0ff,
        0 0 20px #0ff,
        0 0 40px #077,
        0 0 80px #077;
    animation: floatNeon 20s infinite linear;
    opacity: 0;
}

@keyframes floatNeon {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
        filter: hue-rotate(0deg);
    }
    10% {
        opacity: 0.7;
    }
    90% {
        opacity: 0.7;
    }
    100% {
        transform: translateY(-10vh) rotate(360deg);
        opacity: 0;
        filter: hue-rotate(360deg);
    }
}

/* Main container */
.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
    z-index: 10;
    background: rgba(26, 26, 26, 0.8);
}

/* Header */
.header {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(30, 30, 30, 0.85);
    backdrop-filter: blur(10px);
    position: relative;
    z-index: 20;
}

.header-icon {
    width: 32px;
    height: 32px;
    background: #4285f4;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-weight: bold;
    font-size: 18px;
    color: rgb(12, 15, 160);
}

.header-title {
    font-size: 16px;
    font-weight: 500;
    color: #ffffff;
}

/* Chat container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    position: relative;
    z-index: 15;
    overflow: hidden;
}

/* Messages area - scrollable */
.messages-area {
    flex: 1;
    overflow-y: auto;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.message {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    max-width: 85%;
    animation: messageSlide 0.3s ease-out;
}

@keyframes messageSlide {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.message-avatar.ai {
    background: transparent;
}

.message-avatar.user {
    background: #3c4043;
    color: #e8eaed;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* SVG Character used as AI Avatar */
.ai-avatar-svg {
    width: 32px;
    height: 32px;
}

.message-content {
    background: rgba(40, 40, 40, 0.7);
    border-radius: 18px;
    padding: 12px 16px;
    font-size: 15px;
    line-height: 1.4;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.message.user .message-content {
    background: rgba(66, 133, 244, 0.25);
    border: 1px solid rgba(66, 133, 244, 0.3);
}

/* Input area */
.input-area {
    padding: 15px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 20;
    background: rgba(26, 26, 26, 0.8);
}

.input-container {
    position: relative;
    background: #252525;
    border-radius: 28px;
    border: 3px solid transparent;
    background-clip: padding-box;
    overflow: visible;
    width: 100%;
}

.input-container::before {
    content: '';
    position: absolute;
    top: -2px; left: -2px; right: -2px; bottom: -2px;
    background: linear-gradient(
        45deg,
        #ff0080,
        #00ffff,
        #8000ff,
        #ff8000,
        #ff0080
    );
    background-size: 400% 400%;
    border-radius: 30px;
    z-index: -1;
    animation: neonBorder 4s linear infinite;
}

@keyframes neonBorder {
    0% { background-position: 0% 50%; filter: hue-rotate(0deg); }
    25% { background-position: 100% 50%; }
    50% { background-position: 100% 100%; filter: hue-rotate(90deg); }
    75% { background-position: 0% 100%; }
    100% { background-position: 0% 50%; filter: hue-rotate(360deg); }
}

.input-wrapper {
    display: flex;
    align-items: center;
    padding: 6px 6px 6px 24px;
    gap: 10px;
    background: #252525;
    border-radius: 26px;
    margin: 2px;
}

.input-field {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #e0e0e0;
    font-size: 16px;
    padding: 14px 0;
    font-family: inherit;
}

.input-field::placeholder {
    color: #777;
}

.input-buttons {
    display: flex;
    gap: 8px;
}

.input-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: #b0b0b0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.input-button:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1);
    color: #ffffff;
}

.input-button.mic-active {
    background: #ff4444;
    animation: pulse 1s infinite;
    color: white;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.15); opacity: 0.7; }
}

.input-button.send {
    background: #4285f4;
    color: white;
}

.input-button.send:hover {
    background: #5a95f5;
}

.input-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.05);
}

.camera-button {
    /* Styles inherited, specific camera icon handled in JS SVG */
}

.cam-active {
    background-color: #4caf50 !important;
    color: white !important;
}

/* Video Overlay Styles */
.video-overlay {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 300px;
    height: 300px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 25px rgba(0, 255, 255, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.video-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    transform: scale(0.8);
}

.video-overlay.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.video-feed {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    transform: scaleX(-1); /* Mirror the video feed */
    background: #000;
    transition: filter 0.3s ease-in-out;
}

/* ADDED: Style for the background blur effect */
.video-feed.blur-background {
    display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%); /* Centers the video */
  
  /* Adjust size as needed */
  width: 80%;
  max-width: 900px;
  
  border-radius: 15px; /* Optional: for rounded corners */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 2);
}

.camera-status {
    position: relative;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    flex-direction: column;
    gap: 4px;
}

.camera-placeholder {
    text-align: center;
    color: #888;
    font-size: 14px;
    padding: 10px;
}

.processing-indicator {
    color: #ffa726;
    font-size: 12px;
    font-weight: 500;
    animation: processing 1.5s ease-in-out infinite;
}

@keyframes processing {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.emotion-display {
    text-align: center;
    font-size: 12px;
    color: #e0e0e0;
}

.emotion-text {
    font-weight: bold;
    color: #4fc3f7;
    font-size: 13px;
}

.emotion-context {
    margin-top: 5px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    border-left: 3px solid #4fc3f7;
}

.emotion-context small {
    color: #e0e0e0;
    font-style: italic;
    line-height: 1.3;
    font-size: 10px;
}

.error-display {
    color: #ff6b6b;
    font-size: 11px;
    text-align: center;
    font-weight: 500;
}

/* Server status */
.server-status {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
}

.server-status.online {
    background: rgba(76, 175, 80, 0.2);
    color: #4caf50;
}

.server-status.offline {
    background: rgba(244, 67, 54, 0.2);
    color: #f44336;
}

.server-status.checking {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

/* Camera button tooltip */
.input-button[title]:hover::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 5px;
}

/* Icons */
.icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Typing indicator */
.typing-indicator {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: messageSlide 0.3s ease-out;
}

.typing-content {
    background: rgba(40, 40, 40, 0.7);
    border-radius: 18px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    gap: 5px;
}

.typing-dot {
    width: 7px;
    height: 7px;
    background: #89b4f8;
    border-radius: 50%;
    animation: typingAnimation 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: -0.32s; }
.typing-dot:nth-child(2) { animation-delay: -0.16s; }
.typing-dot:nth-child(3) { animation-delay: 0s; }

@keyframes typingAnimation {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.6;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Scrollbar */
.messages-area::-webkit-scrollbar {
    width: 8px;
}

.messages-area::-webkit-scrollbar-track {
    background: rgba(26,26,26,0);
}

.messages-area::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.messages-area::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Responsive design */
@media (max-width: 768px) {
    .chat-container {
        padding: 0 12px;
    }
    
    .header {
        padding: 12px 16px;
    }
    
    .message {
        max-width: 90%;
    }
    
    .input-area {
        padding: 10px 0;
    }

    .input-wrapper {
        padding: 4px 4px 4px 16px;
        gap: 8px;
    }

    .input-field {
        font-size: 15px;
        padding: 12px 0;
    }

    .input-button {
        width: 36px;
        height: 36px;
    }
    
    .icon {
        width: 18px;
        height: 18px;
    }
    
    .video-overlay {
        top: 10px;
        right: 10px;
        width: 200px;
    }
    
    .camera-status {
        min-height: 35px;
        padding: 6px 8px;
    }
    
    .emotion-display, .processing-indicator, .error-display {
        font-size: 11px;
    }
}