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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: #0d0d0d;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
    touch-action: manipulation;
}

/* Mobile scrolling fix */
@media (max-width: 768px) {
    body {
        overflow: auto;
        height: auto;
        min-height: 100vh;
        min-height: -webkit-fill-available;
        position: relative;
    }
}

/* iOS Safe Area Support */
@supports (padding: max(0px)) {
    body {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
    
    .input-container {
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
    
    .scroll-to-top {
        bottom: max(5rem, calc(5rem + env(safe-area-inset-bottom)));
    }
}

/* Prevent iOS bounce effect and improve scrolling */
body.ios-standalone {
    position: fixed;
    width: 100%;
    height: 100%;
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari */
    .messages {
        -webkit-overflow-scrolling: touch;
        overflow-y: scroll;
    }
    
    /* Fix iOS input issues */
    input, textarea, select {
        -webkit-user-select: text;
        user-select: text;
    }
    
    /* Prevent iOS zoom on form focus */
    input[type="text"],
    input[type="email"],
    input[type="password"],
    textarea,
    select {
        font-size: 16px !important;
    }
}

.container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
}

/* Mobile container adjustments */
@media (max-width: 768px) {
    .container {
        height: auto;
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
}

header {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 1rem 2rem;
    background-color: #1a1a1a;
    border-bottom: 2px solid #6B46C1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: transform 0.3s ease;
    gap: 1rem;
    overflow-x: auto;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

.logo {
    height: 80px;
    width: auto;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #ffffff;
}

.model-info {
    display: flex;
    gap: 1rem;
    align-items: center;
    font-size: 0.9rem;
    color: #a0a0a0;
    flex-wrap: wrap;
    max-width: 70%;
    justify-content: flex-end;
    overflow: hidden;
}

.header-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-button {
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    line-height: 1;
}

.header-button:hover {
    background-color: #2a2a2a;
    border-color: #9f7aea;
}

.header-button.active {
    background-color: #6B46C1;
    color: white;
}

.model-select {
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
    min-width: 150px;
}

.model-select:focus {
    outline: none;
    border-color: #9F7AEA;
    box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
}

.model-select option {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

.set-default-button {
    padding: 0.25rem 0.75rem;
    background-color: #6B46C1;
    color: #ffffff;
    border: 1px solid #6B46C1;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.set-default-button:hover {
    background-color: #9F7AEA;
    border-color: #9F7AEA;
    transform: translateY(-1px);
}

.set-default-button:active {
    background-color: #553C9A;
}

.set-default-button.success {
    background-color: #238636;
    border-color: #2ea043;
}

.status {
    padding: 0.25rem 0.75rem;
    background-color: #6B46C1;
    color: white;
    border-radius: 1rem;
    font-size: 0.8rem;
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

.gpu-stat {
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-family: monospace;
    min-width: 60px;
    text-align: center;
    cursor: help;
    color: #9F7AEA;
}

.status.loading {
    background-color: #9F7AEA;
    color: #ffffff;
}

.status.error {
    background-color: #da3633;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mobile chat container fix */
@media (max-width: 768px) {
    .chat-container {
        overflow: visible;
        height: auto;
        min-height: calc(100vh - 120px); /* Account for header */
        min-height: calc(calc(var(--vh, 1vh) * 100) - 120px);
    }
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
    padding-top: 7rem; /* Add padding to account for header height */
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    background-color: #0d0d0d;
    margin-top: -5rem; /* Pull messages up behind header */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

.message {
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background-color: #6B46C1;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 1rem 1rem 0.25rem 1rem;
}

.message.assistant {
    align-self: flex-start;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    padding: 1rem;
    border-radius: 0.25rem 1rem 1rem 1rem;
    color: #e0e0e0;
}

.message.assistant.streaming::after {
    content: '▋';
    display: inline-block;
    animation: blink 1s infinite;
    color: #9F7AEA;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.stream-content {
    overflow-wrap: anywhere;
}

.reasoning-section,
.tool-execution-section,
.final-response {
    margin: 0.75rem 0;
    border-radius: 0.75rem;
    padding: 0.875rem;
}

.reasoning-section {
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.tool-execution-section {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.final-response {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.reasoning-summary,
.tool-summary {
    cursor: pointer;
    font-weight: 600;
}

.reasoning-summary {
    color: #fbbf24;
}

.tool-summary {
    color: #60a5fa;
}

.reasoning-content {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
}

.reasoning-content pre {
    margin: 0;
    white-space: pre-wrap;
    font-size: 0.85rem;
}

.tool-section-content {
    margin-top: 0.75rem;
}

.tool-entry {
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid #60a5fa;
    border-radius: 0.5rem;
    margin: 0.5rem 0;
    padding: 0.75rem;
}

.tool-entry-title {
    color: #60a5fa;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tool-entry-body {
    font-size: 0.8rem;
    opacity: 0.95;
}

.tool-label {
    color: #a3a3a3;
    margin-bottom: 0.25rem;
}

.tool-pre {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.4rem;
    color: #f5f5f5;
    font-size: 0.75rem;
    margin: 0 0 0.75rem 0;
    overflow-x: auto;
    padding: 0.6rem;
    white-space: pre-wrap;
}

.tool-output-group .tool-pre {
    color: #86efac;
}

.tool-executing {
    animation: toolPulse 1.5s ease-in-out infinite;
}

@keyframes toolPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.final-response-header {
    color: #4ade80;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
}

.stream-notice {
    border-radius: 0.5rem;
    margin-top: 0.75rem;
    padding: 0.75rem;
}

.stream-notice.error {
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.input-container {
    padding: 1rem 2rem;
    background-color: #1a1a1a;
    border-top: 2px solid #6B46C1;
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.message-input {
    flex: 1;
    background-color: #0d0d0d;
    border: 1px solid #6B46C1;
    color: #e0e0e0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 16px; /* Prevents zoom on iOS */
    resize: vertical;
    min-height: 3rem;
    max-height: 10rem;
    font-family: inherit;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.message-input:focus {
    outline: none;
    border-color: #9F7AEA;
    box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
}

.send-button {
    padding: 0.75rem 1.5rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    min-width: 44px;
    min-height: 44px;
    touch-action: manipulation;
}

.send-button:hover {
    background-color: #9F7AEA;
    transform: translateY(-1px);
}

.send-button:disabled {
    background-color: #333333;
    cursor: not-allowed;
}

/* Stop button styling */
.send-button.stop-button {
    background-color: #dc3545;
    animation: pulse 1.5s infinite;
}

.send-button.stop-button:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Markdown styling */
.message.assistant h1,
.message.assistant h2,
.message.assistant h3,
.message.assistant h4,
.message.assistant h5,
.message.assistant h6 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.message.assistant h1:first-child,
.message.assistant h2:first-child,
.message.assistant h3:first-child {
    margin-top: 0;
}

.message.assistant p {
    margin-bottom: 0.75rem;
}

.message.assistant p:last-child {
    margin-bottom: 0;
}

.message.assistant ul,
.message.assistant ol {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.message.assistant li {
    margin: 0.25rem 0;
}

/* Code blocks */
.message.assistant pre {
    background-color: #0d0d0d;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    padding: 1rem;
    margin: 0.75rem 0;
    overflow-x: auto;
}

.message.assistant pre code {
    background: none;
    padding: 0;
    border: none;
    font-size: 0.875rem;
}

.message.assistant code {
    background-color: #2a2a2a;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
}

/* Inline code */
.message.assistant p code,
.message.assistant li code {
    color: #9F7AEA;
}

/* Blockquotes */
.message.assistant blockquote {
    border-left: 0.25rem solid #6B46C1;
    padding-left: 1rem;
    margin: 0.75rem 0;
    color: #a0a0a0;
}

/* Tables */
.message.assistant table {
    border-collapse: collapse;
    margin: 0.75rem 0;
    width: 100%;
}

.message.assistant th,
.message.assistant td {
    border: 1px solid #333333;
    padding: 0.5rem;
    text-align: left;
}

.message.assistant th {
    background-color: #1a1a1a;
    font-weight: 600;
    color: #9F7AEA;
}

/* Links */
.message.assistant a {
    color: #9F7AEA;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.message.assistant a:hover {
    border-bottom-color: #9F7AEA;
}

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

.messages::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.messages::-webkit-scrollbar-thumb {
    background: #6B46C1;
    border-radius: 4px;
}

.messages::-webkit-scrollbar-thumb:hover {
    background: #9F7AEA;
}

/* Code execution button */
.code-block-container {
    position: relative;
    margin: 0.75rem 0;
}

.execute-button {
    position: absolute;
    top: 0.5rem;
    right: 4rem;  /* Position to the left of copy button */
    padding: 0.25rem 0.75rem;
    background-color: #10b981;  /* Green for run */
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    z-index: 10;
}

.execute-button:hover {
    background-color: #059669;
    transform: translateY(-1px);
}

.execute-button:disabled {
    background-color: #333333;
    cursor: not-allowed;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 3rem;
    height: 3rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 1000;
}

.scroll-to-top:hover {
    background-color: #9F7AEA;
    transform: translateY(-2px);
}

.scroll-to-top.visible {
    display: flex;
}

/* Touch device improvements */
@media (hover: none) and (pointer: coarse) {
    /* Increase touch targets */
    button, .header-button, .send-button, .model-select, select {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects on touch devices */
    button:hover, .header-button:hover, .send-button:hover {
        transform: none;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
        flex-direction: column;
        gap: 1rem;
        position: relative;
        transform: none !important;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        height: 70px;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .model-info {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .messages {
        padding: 1rem;
        padding-top: 6rem; /* Slightly less padding on mobile */
        margin-top: -4.5rem; /* Adjust for mobile header */
        height: auto;
        min-height: calc(100vh - 200px); /* Account for header and input */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .message {
        max-width: 90%;
    }
    
    .input-container {
        padding: 0.75rem 1rem;
        position: sticky;
        bottom: 0;
        background-color: #1a1a1a;
        z-index: 10;
    }
    
    /* Fix input focus zoom on iOS */
    .message-input {
        font-size: 16px !important;
    }
    
    /* Improve button spacing on mobile */
    .header-buttons {
        gap: 0.75rem;
    }
    
    .model-select {
        font-size: 16px;
        max-width: 150px;
    }
}

/* Very small screens (iPhone SE, etc) */
@media (max-width: 375px) {
    header h1 {
        font-size: 1.1rem;
    }
    
    .logo {
        height: 50px;
    }
    
    .header-buttons {
        flex-wrap: wrap;
    }
    
    .model-select {
        max-width: 120px;
        font-size: 14px;
    }
    
    .send-button {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .messages {
        padding: 0.75rem;
    }
    
    .message {
        max-width: 95%;
        font-size: 0.95rem;
    }
}

/* Landscape orientation fixes */
@media (max-width: 768px) and (orientation: landscape) {
    header {
        padding: 0.5rem 1rem;
    }
    
    .logo {
        height: 40px;
    }
    
    .messages {
        padding-top: 4rem;
        margin-top: -3rem;
    }
    
    .input-container {
        padding: 0.5rem 1rem;
    }
    
    .message-input {
        min-height: 2.5rem;
        max-height: 5rem;
    }
    
    /* Move scroll-to-top button higher on mobile to avoid covering send button */
    .scroll-to-top {
        bottom: 5rem; /* Increased from 2rem to 5rem */
        right: 1rem; /* Reduced from 2rem for better mobile fit */
        width: 2.5rem; /* Slightly smaller on mobile */
        height: 2.5rem;
        font-size: 1.2rem;
    }
}

/* Feature buttons */
.feature-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.feature-button {
    padding: 0.25rem 0.5rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.feature-button:hover {
    background-color: #9F7AEA;
}

/* File upload */
.file-upload-container {
    margin-top: 0.5rem;
}

.file-info {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.25rem;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

/* Performance metrics */
.performance-metrics {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.5rem;
    padding: 1rem;
    font-size: 0.875rem;
    font-family: monospace;
    display: none;
}

.performance-metrics.visible {
    display: block;
}

.metric-row {
    display: flex;
    justify-content: space-between;
    margin: 0.25rem 0;
}

.metric-value {
    color: #9F7AEA;
}

/* Model parameters */
.model-params-container {
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 1rem;
}

.param-control {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0.5rem 0;
}

.param-slider {
    flex: 1;
    margin: 0 1rem;
}

/* Copy button */
.copy-button {
    position: absolute;
    top: 0.5rem;
    right: 3.5rem;
    padding: 0.25rem 0.75rem;
    background-color: #333333;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-button:hover {
    background-color: #6B46C1;
}

.copy-button.copied {
    background-color: #238636;
}

/* User info section */
.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.username {
    font-weight: 600;
    color: #9F7AEA;
}

.message-count {
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    font-size: 0.8rem;
}

.logout-button {
    padding: 0.25rem 0.75rem;
    background-color: transparent;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-button:hover {
    background-color: #6B46C1;
    color: white;
}

/* Session container - DEPRECATED - Using sidebar instead */
.session-container {
    display: none; /* Hide the old session container */
}

.session-select {
    flex: 1;
    padding: 0.5rem;
    background-color: #0d0d0d;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.session-select:focus {
    outline: none;
    border-color: #9F7AEA;
    box-shadow: 0 0 0 2px rgba(107, 70, 193, 0.2);
}

.new-session-button {
    padding: 0.5rem 1rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.new-session-button:hover {
    background-color: #9F7AEA;
    transform: translateY(-1px);
}

/* Code output */
.code-output {
    margin-top: 0.5rem;
    background-color: #0d0d0d;
    border: 1px solid #333333;
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.output-header {
    font-size: 0.875rem;
    color: #9F7AEA;
    margin-bottom: 0.5rem;
}

.code-output pre {
    margin: 0;
    font-size: 0.875rem;
    color: #e0e0e0;
}

.code-output .error {
    color: #ff7b72;
}

/* Guest mode styles */
.guest-welcome {
    background-color: #1a1a1a;
    border: 2px solid #6B46C1;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1rem 0;
    text-align: center;
}

.guest-welcome h3 {
    color: #9F7AEA;
    margin-bottom: 0.5rem;
}

.guest-welcome p {
    color: #e0e0e0;
    margin: 0;
}

.guest-welcome a {
    color: #9F7AEA;
    text-decoration: none;
    font-weight: 600;
}

.guest-welcome a:hover {
    text-decoration: underline;
}

.signup-link {
    padding: 0.25rem 0.75rem;
    background-color: #6B46C1;
    color: white !important;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.signup-link:hover {
    background-color: #9F7AEA;
    transform: translateY(-1px);
}

.status.warning {
    background-color: #f59e0b;
    color: white;
}


@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.meeting-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #333333;
}

.meeting-header h3 {
    color: #9F7AEA;
    margin: 0;
    flex: 1;
}

.meeting-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.meeting-toggle-btn:hover {
    background-color: #9F7AEA;
    transform: translateY(-1px);
}

.meeting-toggle-btn.active {
    background-color: #dc2626;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
}

.mic-icon {
    font-size: 1.2rem;
}

.clear-btn, .refresh-btn {
    padding: 0.5rem 0.75rem;
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.clear-btn:hover:not(:disabled), .refresh-btn:hover:not(:disabled) {
    background-color: #6B46C1;
    color: white;
}

.clear-btn:disabled, .refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.meeting-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    height: 300px;
}

.transcript-panel, .suggestions-panel {
    background-color: #0d0d0d;
    border: 1px solid #333333;
    border-radius: 0.375rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.transcript-panel h4, .suggestions-panel h4 {
    color: #9F7AEA;
    margin: 0 0 0.75rem 0;
    font-size: 1rem;
}

.transcript-content, .suggestions-content {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.5rem;
    max-height: 300px; /* Set a maximum height for scrolling */
    min-height: 200px; /* Minimum height */
}

.transcript-placeholder, .suggestions-placeholder {
    color: #666666;
    font-style: italic;
    text-align: center;
    margin-top: 2rem;
}

.transcript-entry {
    margin-bottom: 0.75rem;
    padding: 0.5rem;
    background-color: #1a1a1a;
    border-radius: 0.25rem;
    border-left: 3px solid #6B46C1;
}

.entry-time {
    color: #666666;
    font-size: 0.75rem;
    margin-right: 0.5rem;
}

.entry-speaker {
    color: #9F7AEA;
    font-weight: 600;
    margin-right: 0.5rem;
}

.entry-text {
    color: #e0e0e0;
}

.suggestions-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.suggestion-item {
    padding: 0.75rem;
    background-color: #1a1a1a;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s;
}

.suggestion-item:hover {
    border-color: #9F7AEA;
    transform: translateX(5px);
}

.suggestion-text {
    flex: 1;
    color: #e0e0e0;
    font-size: 0.9rem;
}

.use-suggestion-btn {
    padding: 0.25rem 0.75rem;
    background-color: #6B46C1;
    color: white;
    border: none;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.use-suggestion-btn:hover {
    background-color: #9F7AEA;
}

.suggestions-timestamp {
    text-align: center;
    color: #666666;
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

.loading-suggestions, .error-suggestions {
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

.error-suggestions {
    color: #ff7b72;
}

.suggestion-actions {
    margin-top: 0.75rem;
    text-align: center;
}

.suggestion-mode-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    justify-content: center;
}

.mode-btn {
    padding: 0.4rem 0.8rem;
    background-color: #333333;
    color: #e0e0e0;
    border: 1px solid #555555;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.mode-btn:hover:not(.active) {
    background-color: #444444;
    border-color: #6B46C1;
}

.mode-btn.active {
    background-color: #6B46C1;
    color: white;
    border-color: #6B46C1;
}

.mode-btn.active:hover {
    background-color: #9F7AEA;
    border-color: #9F7AEA;
}

.meeting-status {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #333333;
}

.status-text {
    font-size: 0.875rem;
    color: #666666;
}

.status-text.status-active {
    color: #10b981;
}

.status-text.status-error {
    color: #ff7b72;
}

.status-text.status-inactive {
    color: #666666;
}

.recording-time {
    color: #dc2626;
    font-family: monospace;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Recording button state */
.start-meeting-btn.recording,
.meeting-toggle-btn.recording {
    background-color: #dc2626 !important;
    animation: pulse 2s infinite;
}

.start-meeting-btn.recording:hover,
.meeting-toggle-btn.recording:hover {
    background-color: #ef4444 !important;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.8;
    }
    100% {
        opacity: 1;
    }
}

/* Scrollbar styling for panels */
.transcript-content::-webkit-scrollbar,
.suggestions-content::-webkit-scrollbar {
    width: 6px;
}

.transcript-content::-webkit-scrollbar-track,
.suggestions-content::-webkit-scrollbar-track {
    background: #0d0d0d;
}

.transcript-content::-webkit-scrollbar-thumb,
.suggestions-content::-webkit-scrollbar-thumb {
    background: #6B46C1;
    border-radius: 3px;
}

.transcript-content::-webkit-scrollbar-thumb:hover,
.suggestions-content::-webkit-scrollbar-thumb:hover {
    background: #9F7AEA;
}

/* Meeting Assistant Primary View */
.meeting-primary-view {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.meeting-primary-view .transcript-panel,
.meeting-primary-view .suggestions-panel {
    background: rgba(26, 26, 26, 0.5);
    border: 1px solid #333;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.meeting-primary-view .transcript-content,
.meeting-primary-view .suggestions-content {
    flex: 1;
    overflow-y: auto;
    max-height: 250px;
    min-height: 150px;
    padding: 0.5rem;
}

.meeting-primary-view .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #333;
}

.meeting-primary-view .suggestion-mode-controls {
    display: flex;
    gap: 0.25rem;
}

.meeting-primary-view .mode-btn,
.meeting-primary-view .refresh-btn {
    background: transparent;
    border: 1px solid #333;
    color: #999;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.meeting-primary-view .mode-btn.active {
    background: #6B46C1;
    color: white;
    border-color: #6B46C1;
}

.meeting-primary-view .mode-btn:hover,
.meeting-primary-view .refresh-btn:hover:not(:disabled) {
    border-color: #9F7AEA;
    color: #9F7AEA;
}

.meeting-primary-view .refresh-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Meeting Assistant Tabs */
.meeting-tabs {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
    border-bottom: 2px solid #333;
}

.tab-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: #999;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.tab-btn:hover {
    color: #e0e0e0;
}

.tab-btn.active {
    color: #9F7AEA;
    border-bottom-color: #9F7AEA;
}

/* Secondary Content Area */
.meeting-secondary-content {
    background: rgba(26, 26, 26, 0.3);
    border: 1px solid #333;
    border-radius: 8px;
    min-height: 150px;
    max-height: 200px;
    overflow-y: auto;
}

.tab-content {
    padding: 1rem;
}

.action-controls,
.summary-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.add-action-btn-small,
.generate-summary-btn-small,
.export-btn-small {
    background: #6B46C1;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.add-action-btn-small:hover,
.generate-summary-btn-small:hover,
.export-btn-small:hover {
    background: #9F7AEA;
}

.add-action-btn-small:disabled,
.generate-summary-btn-small:disabled,
.export-btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Responsive layout for smaller screens */
@media (max-width: 768px) {
    .meeting-primary-view {
        grid-template-columns: 1fr;
    }
    
    .meeting-primary-view .transcript-content,
    .meeting-primary-view .suggestions-content {
        max-height: 200px;
    }
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.count-badge {
    background: #6B46C1;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Action Items */
.action-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: rgba(107, 70, 193, 0.05);
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.action-item.completed {
    opacity: 0.6;
    text-decoration: line-through;
}

.action-item input[type="checkbox"] {
    cursor: pointer;
}

.action-item label {
    flex: 1;
    cursor: pointer;
}

.action-meta {
    font-size: 0.8rem;
    color: #666;
}

.add-action-btn {
    background: #6B46C1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 0.5rem;
}

.add-action-btn:hover {
    background: #9F7AEA;
}

/* Key Points */
.key-point {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    background: rgba(159, 122, 234, 0.05);
    border-left: 3px solid #9F7AEA;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.key-point.ai-detected {
    background: rgba(34, 197, 94, 0.05);
    border-left: 3px solid #22c55e;
}

/* Full analysis button */
.analyze-full-btn {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analyze-full-btn:hover {
    background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
    transform: scale(1.05);
}

.analyze-full-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.point-text {
    flex: 1;
}

.point-time {
    font-size: 0.8rem;
    color: #666;
}

/* Summary */
.summary-text {
    line-height: 1.6;
    padding: 1rem;
    background: rgba(107, 70, 193, 0.05);
    border-radius: 4px;
}

.summary-meta {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.5rem;
}

.summary-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.generate-summary-btn, .export-btn {
    background: #6B46C1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
}

.generate-summary-btn:hover, .export-btn:hover {
    background: #9F7AEA;
}

.placeholder {
    color: #666;
    font-style: italic;
    text-align: center;
    padding: 2rem;
}

.loading {
    color: #9F7AEA;
    text-align: center;
    padding: 2rem;
    animation: pulse 2s infinite;
}

/* Meeting Model Selector Styles */
.meeting-model-selector {
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(159, 122, 234, 0.05);
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meeting-model-selector label {
    color: #b0b0b0;
    font-size: 0.9rem;
}

.meeting-model-selector .model-select {
    flex: 1;
    max-width: 250px;
}

/* Meeting Mentor Model Selector in Fullscreen */
.model-select-fs {
    padding: 0.25rem 0.5rem;
    background-color: #1a1a1a;
    border: 1px solid #333333;
    border-radius: 4px;
    color: #e0e0e0;
    font-size: 0.875rem;
    cursor: pointer;
    min-width: 150px;
    margin-right: 1rem;
}

.model-select-fs:hover {
    border-color: #6B46C1;
}

.model-select-fs:focus {
    outline: none;
    border-color: #9F7AEA;
    box-shadow: 0 0 0 2px rgba(159, 122, 234, 0.1);
}

/* Mobile responsiveness for meeting assistant */
@media (max-width: 768px) {
    .meeting-content {
        grid-template-columns: 1fr;
        height: 400px;
    }
    
    .meeting-header {
        flex-wrap: wrap;
    }
    
    .meeting-toggle-btn {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}

/* Meeting button positioning */
.meeting-mentor-toggle {
    position: fixed;
    top: 10px;
    right: 20px;
    z-index: 1000;
}

/* Meeting Mentor specific button styling */
.meeting-mentor-toggle .show-meeting-btn {
    background: #4a5568;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.meeting-mentor-toggle .show-meeting-btn:hover {
    background: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.meeting-mentor-toggle .show-meeting-btn.active {
    background: #3182ce;
}

/* Fix select elements on mobile browsers */
select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Android-specific fixes */
@supports (-webkit-appearance: none) and (not (-webkit-touch-callout: none)) {
    /* Android Chrome */
    input, textarea, select {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Hide meeting assistant containers by default */
#meeting-assistant,
#meeting-mentor {
    display: none;
}

#meeting-assistant.visible,
#meeting-mentor.visible {
    display: block;
}

/* Remove old toggle buttons */
.meeting-assistant-toggle,
.meeting-mentor-toggle {
    display: none;
}

/* Chat History Sidebar */
.history-toggle-btn {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #333333;
    border: 1px solid #555555;
    color: #ffffff;
    font-size: 20px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.history-toggle-btn:hover {
    background-color: #444444;
    transform: translateY(-50%) scale(1.1);
}

.history-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    width: 320px;
    height: 100%;
    background-color: #1a1a1a;
    border-right: 1px solid #333333;
    transition: left 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mobile sidebar adjustments */
@media (max-width: 768px) {
    .history-sidebar {
        width: 280px;
        left: -280px;
    }
    
    .history-toggle-btn {
        left: 10px;
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
    
    .history-toggle-btn.sidebar-open {
        left: 290px;
    }
}

.history-sidebar.open {
    left: 0;
}

.sidebar-header {
    padding: 1rem;
    background-color: #252525;
    border-bottom: 1px solid #333333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    margin: 0;
    color: #ffffff;
    font-size: 1.2rem;
}

.close-sidebar {
    background: none;
    border: none;
    color: #999999;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.close-sidebar:hover {
    background-color: #333333;
    color: #ffffff;
}

.sidebar-controls {
    padding: 1rem;
    background-color: #1a1a1a;
    border-bottom: 1px solid #333333;
}

.new-chat-btn {
    width: 100%;
    padding: 0.75rem;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 0.75rem;
    transition: background-color 0.3s ease;
}

.new-chat-btn:hover {
    background-color: #45a049;
}

#search-sessions {
    width: 100%;
    padding: 0.5rem;
    background-color: #252525;
    border: 1px solid #333333;
    border-radius: 6px;
    color: #ffffff;
    font-size: 14px;
}

#search-sessions::placeholder {
    color: #666666;
}

.sessions-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.no-sessions {
    text-align: center;
    color: #666666;
    padding: 2rem;
    font-style: italic;
}

.session-item {
    background-color: #252525;
    border: 1px solid #333333;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    overflow: hidden;
    transition: all 0.2s ease;
}

.session-item:hover {
    border-color: #555555;
    transform: translateX(2px);
}

.session-item.active {
    border-color: #4CAF50;
    background-color: #2a3a2a;
}

.session-info {
    padding: 0.75rem;
    cursor: pointer;
}

.session-title {
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.session-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999999;
}

.session-model {
    background-color: #333333;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
}

.session-date {
    font-size: 11px;
}

.session-actions {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem;
    background-color: #1a1a1a;
    border-top: 1px solid #333333;
}

.session-action {
    background: none;
    border: 1px solid #333333;
    color: #999999;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.session-action:hover {
    background-color: #333333;
    color: #ffffff;
    border-color: #555555;
}

/* Adjust toggle button when sidebar is open */
.history-toggle-btn.sidebar-open {
    left: 340px;
}

/* Meeting Mentor Fullscreen Styles */
.meeting-fullscreen-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #0d0d0d;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.meeting-fullscreen-header {
    background: #1a1a1a;
    padding: 1rem;
    border-bottom: 1px solid #3a3a3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.meeting-header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.back-to-chat-btn {
    padding: 0.5rem 1rem;
    background: #6B46C1;
    color: white;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.back-to-chat-btn:hover {
    background: #9f7aea;
}

.meeting-timer {
    color: #9f7aea;
    font-family: monospace;
    font-size: 1.1rem;
}

.meeting-fullscreen-content {
    flex: 1;
    display: flex;
    padding: 1rem;
    gap: 1rem;
    overflow: hidden;
}

.transcript-section, .suggestions-section {
    flex: 1;
    background: #1a1a1a;
    border: 1px solid #3a3a3a;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.section-header {
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #3a3a3a;
    margin-bottom: 1rem;
}

.section-header h3 {
    margin: 0;
    color: #e0e0e0;
}

.transcript-content, .suggestions-content {
    flex: 1;
    overflow-y: auto;
    color: #b0b0b0;
}

.meeting-controls {
    padding: 1rem;
    background: #1a1a1a;
    border-top: 1px solid #3a3a3a;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.control-btn {
    padding: 0.75rem 1.5rem;
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #6B46C1;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
}

.control-btn:hover {
    background: #3a3a3a;
    border-color: #9f7aea;
}

.control-btn.active {
    background: #6B46C1;
    color: white;
}

.control-btn.stop {
    background: #dc3545;
    border-color: #dc3545;
}

.control-btn.stop:hover {
    background: #c82333;
}

.transcript-entry {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #2a2a2a;
    border-radius: 0.25rem;
}

.speaker {
    font-weight: bold;
    color: #9f7aea;
}

.timestamp {
    color: #666;
    font-size: 0.85rem;
    margin-left: 0.5rem;
}

.action-item, .suggestion-item {
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #2a2a2a;
    border-left: 3px solid #6B46C1;
    border-radius: 0.25rem;
}

.meeting-status {
    padding: 0.25rem 0.5rem;
    background: #2a2a2a;
    border-radius: 0.25rem;
    font-size: 0.9rem;
}

.meeting-status.active {
    background: #28a745;
    color: white;
}

.meeting-status.error {
    background: #dc3545;
    color: white;
}

/* Tool Execution Display */
.tool-execution {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-left: 4px solid #4CAF50;
    padding: 12px;
    margin: 10px 0;
    border-radius: 8px;
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.tool-execution .tool-header {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

.tool-execution .tool-call {
    background: rgba(255,255,255,0.1);
    padding: 6px 10px;
    margin: 4px 0;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.tool-execution .tool-result {
    background: rgba(0,0,0,0.2);
    padding: 8px 10px;
    margin: 4px 0;
    border-radius: 4px;
    font-size: 12px;
    color: rgba(255,255,255,0.9);
}

.tool-execution .tool-icon {
    margin-right: 6px;
}

/* Message content when tools are used */
.message-content {
    margin-top: 10px;
}

