:root {
    --bg-dark: #0a120c;
    --sidebar-bg: rgba(18, 28, 22, 0.9);
    --accent: #4CAF50;
    --accent-glow: rgba(76, 175, 80, 0.4);
    --text-primary: #ffffff;
    --text-secondary: #a0b0a5;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --user-msg: #2d3a2f;
    --bot-msg: rgba(76, 175, 80, 0.15);
    --success: #8BC34A;
    --error: #ff5252;
    --gold: #FFD700;
}


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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    display: flex;
}

h1,
h2,
.logo h1 {
    font-family: 'Outfit', sans-serif;
}

/* App Container */
.app-container {
    display: flex;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 10;
}

.main-chat {
    flex: 1;
    width: 100%;
    display: flex;
    flex-direction: column;
}


/* Sidebar Styles Removed - App is now Full Width Chat */
.sidebar-content {
    display: none;
}


/* Logo Styles Removed */

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes float3d {

    0%,
    100% {
        transform: translateY(0) rotateX(0deg);
        filter: drop-shadow(0 4px 6px rgba(124, 77, 255, 0.3));
    }

    25% {
        transform: translateY(-3px) rotateX(2deg);
        filter: drop-shadow(0 8px 12px rgba(124, 77, 255, 0.4));
    }

    50% {
        transform: translateY(-5px) rotateX(0deg);
        filter: drop-shadow(0 12px 20px rgba(124, 77, 255, 0.5));
    }

    75% {
        transform: translateY(-3px) rotateX(-2deg);
        filter: drop-shadow(0 8px 12px rgba(124, 77, 255, 0.4));
    }
}




/* Sidebar Tools and Status Removed */

/* Main Chat Styling */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: transparent;
    position: relative;
}

.chat-header {
    height: 64px;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    background: rgba(10, 18, 12, 0.8);
    backdrop-filter: blur(10px);
}

.chat-header-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon {
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-text {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, #4CAF50, #8BC34A);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    white-space: nowrap;
}

@keyframes headerGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.model-badge {
    background: var(--accent);
    color: white;
    font-size: 12px;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    box-shadow: 0 0 15px var(--accent-glow);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(124, 77, 255, 0.7);
    }

    70% {
        box-shadow: 0 0 0 6px rgba(124, 77, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(124, 77, 255, 0);
    }
}


.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    scroll-behavior: smooth;
}

.message {
    max-width: 80%;
    padding: 16px 20px;
    border-radius: 20px;
    line-height: 1.5;
    font-size: 15px;
    position: relative;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.assistant-message {
    background: transparent;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(124, 77, 255, 0.2);
}

.user-message {
    background: var(--user-msg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    border: 1px solid var(--glass-border);
}

.message-content h3 {
    margin-bottom: 10px;
}

.message-content p {
    margin-bottom: 15px;
}

.message-content ul,
.message-content ol {
    margin-left: 20px;
    margin-bottom: 15px;
}

.message-content pre {
    background: rgba(0, 0, 0, 0.3);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 15px;
    border: 1px solid var(--glass-border);
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 10px 0;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease;
}

.message-content img:hover {
    transform: scale(1.02);
}

/* Input Area */
.input-area {
    padding: 20px 40px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-container {
    width: 100%;
    max-width: 800px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    backdrop-filter: blur(10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: border-color 0.2s;
    gap: 10px;
}

.tool-selector-container {
    width: 100%;
    position: relative;
    z-index: 100;
}

.input-row {
    display: flex;
    align-items: flex-end;
    width: 100%;
}

.tool-dropdown {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
    padding: 10px 14px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    outline: none;
    transition: all 0.2s;
    -webkit-appearance: menulist;
    appearance: menulist;
    pointer-events: auto;
}

.tool-dropdown:hover,
.tool-dropdown:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.tool-dropdown option {
    background: var(--bg-dark);
    color: var(--text-primary);
    padding: 10px;
}

.input-container:focus-within {
    border-color: var(--accent);
}

textarea {
    flex: 1;
    background: none;
    border: none;
    color: white;
    font-family: inherit;
    font-size: 15px;
    resize: none;
    padding: 8px 0;
    max-height: 200px;
    outline: none;
}

.send-button {
    background: var(--accent);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, background 0.2s;
    margin-left: 12px;
}

.send-button:hover {
    background: #6a3de8;
    transform: scale(1.05);
}

.send-button svg {
    width: 20px;
    height: 20px;
}

.mic-button {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    border: 1px solid var(--glass-border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: 8px;
}

.mic-button:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.mic-button.recording {
    background: rgba(255, 68, 68, 0.2);
    color: #ff4444;
    border-color: #ff4444;
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(255, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(255, 68, 68, 0);
    }
}

/* Voice Visualizer */
.voice-visualizer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 60px;
    padding: 10px;
    background: rgba(124, 77, 255, 0.05);
    border-top: 1px solid var(--glass-border);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.voice-visualizer.hidden {
    height: 0;
    padding: 0;
    opacity: 0;
    pointer-events: none;
    border: none;
}

.v-bar {
    width: 6px;
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    animation: voice-bounce 1s infinite ease-in-out;
}

.v-bar:nth-child(1) {
    animation-delay: 0.1s;
}

.v-bar:nth-child(2) {
    animation-delay: 0.2s;
}

.v-bar:nth-child(3) {
    animation-delay: 0.3s;
}

.v-bar:nth-child(4) {
    animation-delay: 0.4s;
}

.v-bar:nth-child(5) {
    animation-delay: 0.5s;
}

@keyframes voice-bounce {

    0%,
    100% {
        height: 10px;
        opacity: 0.3;
    }

    50% {
        height: 40px;
        opacity: 1;
    }
}

.mic-button svg {
    width: 20px;
    height: 20px;
}

.disclaimer {
    font-size: 11px;
    color: var(--text-secondary);
    margin-top: 12px;
}

/* Background Blurs */
.bg-blur {
    position: fixed;
    width: 40vw;
    height: 40vw;
    border-radius: 50%;
    filter: blur(120px);
    z-index: 1;
    opacity: 0.15;
    pointer-events: none;
}

.blur-1 {
    top: -10%;
    right: -10%;
    background: var(--accent);
}

.blur-2 {
    bottom: -10%;
    left: -10%;
    background: #00bcd4;
}

/* Thinking Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 4px 10px;
}

.dot {
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.dot:nth-child(1) {
    animation-delay: -0.32s;
}

.dot:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* Scrollbar - High Visibility */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 6px;
    border: 3px solid transparent;
    background-clip: padding-box;
    opacity: 1;
}

::-webkit-scrollbar-thumb:hover {
    background: #6a3de8;
}

/* Main Chat Area */
.main-chat {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    background: var(--bg-dark);
    min-width: 0;
    /* Prevent flex overflow */
}


/* Session History Styles Removed */

/* ============ VOICE MODE BUTTON ============ */
.voice-mode-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.2), rgba(0, 229, 255, 0.15));
    border: 1px solid rgba(124, 77, 255, 0.4);
    border-radius: 25px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
}

.voice-mode-button:hover {
    background: linear-gradient(135deg, rgba(124, 77, 255, 0.35), rgba(0, 229, 255, 0.25));
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(124, 77, 255, 0.3);
}

.voice-mode-button:active {
    transform: translateY(0) scale(0.98);
}


/* Widget/Mobile Layout Adjustments */
@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
    }

    .chat-messages {
        padding: 20px;
    }

    .message {
        max-width: 95%;
    }
}

.voice-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.voice-icon svg {
    width: 20px;
    height: 20px;
    stroke: #00e5ff;
    transition: stroke 0.3s;
}

.voice-mode-button:hover .voice-icon svg {
    stroke: #7c4dff;
}

.voice-mode-button.active .voice-icon svg {
    stroke: #00e676;
    animation: voicePulseIcon 1s infinite;
}

.voice-mode-button.working {
    opacity: 0.7;
    cursor: wait !important;
    transform: scale(0.95);
    filter: brightness(1.2);
}

.voice-mode-button.working .voice-icon svg {
    animation: rotate 1s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.voice-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #7c4dff, #00e5ff);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    transition: all 0.3s;
}

.voice-mode-button:hover .voice-text {
    background: linear-gradient(135deg, #00e5ff, #7c4dff);
    -webkit-background-clip: text;
    background-clip: text;
}

.voice-mode-button.active .voice-text {
    background: linear-gradient(135deg, #00e676, #00e5ff);
    -webkit-background-clip: text;
    background-clip: text;
}

/* Animated pulse ring behind button */
.voice-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 25px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    opacity: 0;
}

.voice-mode-button.active .voice-pulse {
    animation: voiceRingPulse 1.5s infinite;
}

@keyframes voiceRingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0.4);
        opacity: 1;
    }

    70% {
        box-shadow: 0 0 0 15px rgba(0, 230, 118, 0);
        opacity: 0;
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 230, 118, 0);
        opacity: 0;
    }
}

@keyframes voicePulseIcon {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.15);
    }
}

/* Voice button shimmer effect */
.voice-mode-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: 0.5s;
}

.voice-mode-button:hover::before {
    left: 100%;
}

/* Mobile adjustments - ONLY for voice button positioning, no size changes */
@media (max-width: 768px) {
    .chat-header {
        padding: 0 15px;
        justify-content: space-between;
        gap: 8px;
    }

    .header-text {
        font-size: 14px;
    }

    .header-icon {
        font-size: 18px;
    }

    .voice-mode-button {
        padding: 8px 14px;
    }

    .voice-text {
        font-size: 12px;
    }

    .voice-icon {
        width: 20px;
        height: 20px;
    }

    .voice-icon svg {
        width: 16px;
        height: 16px;
    }
}

/* FORCE HIDE SIDEBAR per user request */
.sidebar,
.left-sidebar,
.sidebar-content,
#sidebar,
.app-sidebar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    visibility: hidden !important;
}

/* Ensure Main Chat is Full Width */
.main-chat {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 !important;
}

/* User Requested Fix: Mobile Sidebar Hiding & Layout Adjustment */
@media (max-width: 768px) {

    .sidebar,
    .sidebar-content,
    #sidebar {
        display: none !important;
    }

    .desktop-only {
        display: none !important;
    }

    .app-container {
        flex-direction: column;
    }

    /* Ensure full width for mobile */
    .main-chat {
        width: 100%;
        max-width: 100vw;
    }
}