/* OffGrid AI Complete Theme - Brand-Aligned Styles */

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Black+Ops+One&family=Inter:wght@400;500;600;700;800;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #ffffff;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header */
.header {
    background: #2c1810; /* Dark brown */
    border-bottom: 2px solid #b8860b; /* Gold border */
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.logo:hover {
    transform: scale(1.15) rotate(10deg);
}

.title {
    font-family: 'Black Ops One', 'Inter', sans-serif;
    font-size: 18px;
    font-weight: 400;
    color: #b8860b; /* Gold color */
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: #deb887; /* Light gold for text */
}

.status-dot {
    width: 8px;
    height: 8px;
    background: #10b981;
    border-radius: 50%;
    animation: subtlePulse 2s ease-in-out infinite;
}

.status-dot.disconnected {
    background: #ef4444;
    animation: subtlePulse 2s ease-in-out infinite;
}

/* QR Code Container */
#qrContainer {
    position: fixed;
    top: 70px;
    right: 20px;
    background: white;
    padding: 12px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    z-index: 1000;
    border: 1px solid #b8860b;
}

#qrcode {
    padding: 8px;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
}

#qrcode canvas {
    display: block;
}

#qrContainer .qr-label {
    font-size: 12px;
    margin-top: 8px;
    color: #2c1810;
    font-weight: 500;
}

#mobileUrl {
    font-size: 11px;
    color: #6b4423;
    margin-top: 4px;
}

/* Hide QR on mobile */
@media (max-width: 768px) {
    #qrContainer {
        display: none;
    }
}

@keyframes subtlePulse {
    0%, 100% { 
        opacity: 1; 
        transform: scale(1);
    }
    50% { 
        opacity: 0.7;
        transform: scale(1.1);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes slideUp {
    from {
        transform: translateX(-50%) translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Main Layout */
.main-container {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* Sidebar with brown checkered pattern */
.sidebar {
    width: 280px;
    background-color: #2c1810;
    background-image: 
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 20px,
            rgba(74, 44, 26, 0.3) 20px,
            rgba(74, 44, 26, 0.3) 40px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 20px,
            rgba(74, 44, 26, 0.3) 20px,
            rgba(74, 44, 26, 0.3) 40px
        );
    border-right: 2px solid #b8860b;
    padding: 20px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #b8860b transparent;
}

/* Custom scrollbar for Webkit browsers */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background-color: #b8860b;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background-color: #daa520;
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-title {
    font-size: 12px;
    font-weight: 600;
    color: #daa520;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Resource Card Styling */
.resource-card {
    background: white;
    border: 1px solid #b8860b;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.resource-card:hover {
    border-color: #daa520;
    box-shadow: 0 2px 8px rgba(184, 134, 11, 0.3);
    transform: translateY(-1px);
}

.resource-card-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.resource-card-content {
    flex: 1;
    min-width: 0;
}

.resource-card-title {
    font-weight: 600;
    color: #2c1810;
    font-size: 14px;
    margin-bottom: 2px;
}

.resource-card-desc {
    font-size: 11px;
    color: #6b4423;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tool Button Styling */
.tool-button {
    width: 100%;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 13px;
    color: #2c1810;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.tool-button:hover {
    background: #f9fafb;
    border-color: #daa520;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.2);
}

.emergency-button {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
}

.emergency-button:hover {
    background: #fee2e2;
    border-color: #f87171;
}

/* Saved Conversations */
.saved-conversations-list {
    max-height: 200px;
    overflow-y: auto;
}

.saved-conversation-item {
    padding: 8px;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 4px;
    margin-bottom: 4px;
    cursor: pointer;
    font-size: 12px;
}

.saved-conversation-item:hover {
    background: #faf8f5;
    border-color: #daa520;
}

.conversation-accordion {
    margin-top: 8px;
}

.accordion-toggle {
    width: 100%;
    padding: 8px;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    color: #2c1810;
    font-weight: 500;
}

.accordion-toggle:hover {
    background: #faf8f5;
}

.accordion-content {
    display: none;
    margin-top: 8px;
}

.accordion-content.open {
    display: block;
}

/* Chat Container */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-right: 180px; /* Make room for QR code */
    display: flex;
    flex-direction: column;
    gap: 24px;
    background: white;
}

/* Welcome Screen */
.welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 16px;
    padding-top: 8px;
}

.welcome-icon {
    width: 110px;
    height: 110px;
    margin-bottom: 14px;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.welcome-icon:hover {
    transform: scale(1.1) rotate(15deg);
}

.welcome h2 {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #2c1810;
    margin-bottom: 8px;
}

.welcome p {
    color: #6b4423;
    margin-top: 12px;
    margin-bottom: 20px;
    font-weight: 500;
}

.feature-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.feature-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: #2c1810;
    color: #daa520;
    padding: 6px 14px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #b8860b;
    white-space: nowrap;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    width: 100%;
    max-width: 600px;
}

.quick-action {
    padding: 16px;
    background: white;
    border: 1px solid #daa520;
    border-radius: 8px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
    transform: translateY(-2px);
}

.quick-action:hover {
    background: linear-gradient(135deg, #2c1810 0%, #4a2c1a 100%);
    border-color: #b8860b;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(-3px);
}

.quick-action-title {
    font-weight: 600;
    color: #2c1810;
    margin-bottom: 4px;
    transition: all 0.3s;
}

.quick-action:hover .quick-action-title {
    color: #daa520;
    font-family: 'Black Ops One', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quick-action-desc {
    font-size: 14px;
    color: #111827;
    transition: all 0.3s;
}

.quick-action:hover .quick-action-desc {
    color: #f5e6d3;
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    max-width: 100%;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.message.user .message-avatar {
    background: #f3f4f6;
    color: #374151;
}

.message.assistant .message-avatar {
    background: #b8860b;
    color: white;
}

.message-content {
    flex: 1;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.message-text {
    color: #111827;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: hidden;
}

/* Only use pre-wrap for non-markdown content */
.message.user .message-text {
    white-space: pre-wrap;
}

/* Markdown content styling */
.markdown-content {
    color: #111827;
    line-height: 1.5;
}

/* Tighter markdown spacing for cleaner display */
.message-text.markdown-content p {
    margin: 0.5em 0;
}

.message-text.markdown-content ul,
.message-text.markdown-content ol {
    margin: 0.3em 0;
    padding-left: 1.5em;
}

.message-text.markdown-content li {
    margin: 0.15em 0;
    line-height: 1.4;
}

/* First paragraph after nothing should have no top margin */
.message-text.markdown-content > p:first-child {
    margin-top: 0;
}

/* Reduce space between list and preceding paragraph */
.message-text.markdown-content p + ul,
.message-text.markdown-content p + ol {
    margin-top: 0.2em;
}

/* Fix gaps before numbered sections */
.message-text.markdown-content p + p {
    margin-top: 0.3em;
}

/* Handle bold text that starts sections */
.message-text.markdown-content p strong:first-child {
    display: inline-block;
    margin-top: -0.2em;
}

.message-text.markdown-content h1,
.message-text.markdown-content h2,
.message-text.markdown-content h3,
.message-text.markdown-content h4 {
    margin: 0.6em 0 0.4em 0;
}

.message-text.markdown-content h1:first-child,
.message-text.markdown-content h2:first-child,
.message-text.markdown-content h3:first-child,
.message-text.markdown-content h4:first-child {
    margin-top: 0;
}

.message-text.markdown-content > *:first-child {
    margin-top: 0;
}

.message-text.markdown-content > *:last-child {
    margin-bottom: 0;
}

.markdown-content h1 {
    font-size: 1.8em;
    font-weight: 700;
    color: #111827;
    border-bottom: 2px solid #e5e7eb;
    padding-bottom: 8px;
}

.markdown-content h2 {
    font-size: 1.4em;
    font-weight: 600;
    color: #374151;
}

.markdown-content h3 {
    font-size: 1.2em;
    font-weight: 600;
    color: #4b5563;
}

.markdown-content code {
    background: #f3f4f6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.markdown-content pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 16px 0;
}

.markdown-content pre code {
    background: transparent;
    padding: 0;
    color: #e2e8f0;
}

.markdown-content blockquote {
    border-left: 4px solid #b8860b;
    padding-left: 16px;
    margin: 16px 0;
    color: #4b5563;
    font-style: italic;
}

.markdown-content strong {
    font-weight: 600;
    color: #111827;
}

/* Table styling for markdown content */
.markdown-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.markdown-content th {
    background: #f3f4f6;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #e5e7eb;
}

.markdown-content td {
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
}

.markdown-content tr:hover {
    background: #f9fafb;
}

/* Clickable prompts styling */
.markdown-content li code {
    cursor: pointer;
    padding: 8px 12px;
    display: inline-block;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    transition: all 0.2s;
    margin: 4px 0;
    font-size: 13px;
    max-width: 100%;
    word-wrap: break-word;
}

.markdown-content li code:hover {
    background: #faf8f5;
    border-color: #b8860b;
    transform: translateX(2px);
}

.markdown-content em {
    font-style: italic;
}

.markdown-content hr {
    border: none;
    border-top: 2px solid #e5e7eb;
    margin: 24px 0;
}

.message-image {
    max-width: 300px;
    border-radius: 8px;
    margin-top: 8px;
    cursor: pointer;
}

.message-time {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* Input Area */
.input-area {
    border-top: 2px solid #b8860b;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f9fafb 0%, #faf8f5 100%);
}

.input-container {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper {
    flex: 1;
    position: relative;
}

.message-input {
    width: 100%;
    padding: 12px 48px 12px 44px;
    border: 1px solid #b8860b;
    border-radius: 8px;
    font-size: 15px;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
    font-family: inherit;
    line-height: 1.5;
    max-height: 120px;
    overflow-y: hidden;
}

.message-input:focus {
    border-color: #daa520;
    box-shadow: 0 0 0 2px rgba(184, 134, 11, 0.1);
}

/* Image Upload Button (Camera) */
.image-upload-btn {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #6b4423;
    transition: color 0.2s;
}

.image-upload-btn:hover {
    color: #b8860b;
}

/* Gallery Upload Button */
.gallery-upload-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    color: #6b4423;
    transition: color 0.2s;
}

.gallery-upload-btn:hover {
    color: #b8860b;
}

.image-upload-input {
    display: none;
}

/* Image Preview */
.image-preview {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: none;
    align-items: center;
    gap: 8px;
}

.image-preview.active {
    display: flex;
}

.preview-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.preview-info {
    flex: 1;
}

.preview-filename {
    font-size: 14px;
    font-weight: 500;
    color: #2c1810;
}

.remove-image {
    padding: 4px 8px;
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

/* Model Selector */
.model-selector {
    position: relative;
    min-width: 200px;
}

/* Model Helper Text */
.model-helper {
    position: absolute;
    bottom: calc(100% + 48px);
    left: 0;
    right: 0;
    background: #1e40af;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: none;
    z-index: 1001;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.model-helper.show {
    display: block;
}

.model-helper::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #1e40af;
}

.model-button {
    width: 100%;
    padding: 12px 16px;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    transition: all 0.2s;
}

.model-button:hover {
    border-color: #daa520;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.2);
}

.model-dropdown {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #b8860b;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0,0,0,0.1);
    display: none;
    overflow: hidden;
    z-index: 1000;
}

.model-dropdown.open {
    display: block;
}

.model-list {
    max-height: 200px;
    overflow-y: auto;
}

.model-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f3f4f6;
}

.model-item:hover {
    background: #faf8f5;
}

.model-item.selected {
    background: linear-gradient(135deg, #faf8f5 0%, #f5e6d3 100%);
    border-left: 3px solid #b8860b;
}

.model-item-name {
    font-weight: 500;
    color: #2c1810;
}

.model-item-desc {
    font-size: 12px;
    color: #6b4423;
}

/* Send Button */
.send-button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(184, 134, 11, 0.3);
}

.send-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #daa520 0%, #cd853f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(184, 134, 11, 0.4);
}

.send-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toggle Sidebar Button */
.toggle-sidebar {
    position: fixed;
    left: 10px;
    bottom: 80px;
    width: 40px;
    height: 40px;
    background: #b8860b;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 100;
    display: none !important; /* Permanently hidden on all devices */
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.sidebar.hidden {
    display: none;
}

/* Hide desktop-only items on mobile */
@media (max-width: 768px) {
    .desktop-only {
        display: none !important;
    }
    
    .saved-conversations-list {
        display: none !important;
    }
}

/* Mobile-specific quick actions */
.mobile-quick-actions {
    display: none;
}

.desktop-quick-actions {
    display: grid;
}

@media (max-width: 768px) {
    .desktop-quick-actions {
        display: none !important;
    }
    
    .mobile-quick-actions {
        display: flex !important;
        flex-direction: column;
        gap: 12px;
        width: 90%;
        max-width: 400px;
        margin: -10px auto 0 auto;
    }
    
    .mobile-quick-actions .quick-action {
        display: flex;
        align-items: center;
        gap: 16px;
        padding: 16px;
        background: white;
        border: 1px solid #b8860b;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        text-align: left;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    }
    
    .mobile-quick-actions .quick-action:hover {
        background: white;
        border-color: #daa520;
        box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
    }
    
    .mobile-quick-actions .quick-action-icon {
        font-size: 24px;
        flex-shrink: 0;
    }
    
    .mobile-quick-actions .quick-action-content {
        flex: 1;
    }
    
    .mobile-quick-actions .quick-action-title {
        font-size: 15px;
        font-weight: 600;
        color: #2c1810;
        margin-bottom: 2px;
    }
    
    .mobile-quick-actions .quick-action-desc {
        font-size: 12px;
        color: #111827;
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #qrContainer {
        display: none !important;
    }
    
    .messages {
        padding: 12px !important;
        padding-bottom: 160px !important;
        padding-top: 75px !important;
        overflow-x: auto !important;
        max-width: 100vw !important;
    }
    
    .message {
        max-width: calc(100vw - 24px) !important;
    }
    
    .message-content {
        max-width: calc(100vw - 60px) !important;
        overflow-x: auto !important;
    }
    
    .message-text,
    .markdown-content {
        max-width: 100% !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    .markdown-content pre {
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    .markdown-content table {
        display: block !important;
        max-width: 100% !important;
        overflow-x: auto !important;
    }
    
    .message:last-child {
        margin-bottom: 20px;
    }
    
    body {
        height: 100vh;
        overflow: hidden;
    }
    
    .main-container {
        height: calc(100vh - 60px);
    }
    
    .chat-container {
        height: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        height: 100%;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s;
        width: 280px;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    .sidebar.mobile-visible {
        transform: translateX(0);
    }
    
    .toggle-sidebar {
        display: block !important;
        position: fixed;
        left: 50% !important;
        transform: translateX(-50%);
        top: 75px !important;
        right: auto !important;
        bottom: auto !important;
        z-index: 1000;
        width: 45px;
        height: 45px;
        font-size: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.15);
        background: #b8860b;
        display: flex !important;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease;
    }
    
    .sidebar.mobile-visible ~ .toggle-sidebar,
    .toggle-sidebar.menu-open {
        opacity: 0.4;
    }
    
    .header {
        padding: 10px 12px;
        height: 60px;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 50;
    }
    
    .title {
        font-size: 14px;
    }
    
    .logo {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    
    .input-area {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 10px;
        background: linear-gradient(135deg, #f9fafb 0%, #faf8f5 100%);
        border-top: 2px solid #b8860b;
        z-index: 100;
        box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    }
    
    .input-container {
        display: flex;
        flex-direction: column !important;
        gap: 8px;
        align-items: stretch;
        max-width: 100%;
    }
    
    .input-wrapper {
        width: 100% !important;
        position: relative;
    }
    
    .message-input {
        width: 100% !important;
        min-height: 40px !important;
        max-height: 80px !important;
        padding: 10px 12px 10px 40px !important;
        font-size: 16px !important;
        border-radius: 20px !important;
    }
    
    .image-preview {
        position: fixed;
        bottom: 140px;
        left: 10px;
        right: 10px;
        max-width: calc(100% - 20px);
        z-index: 101;
    }
    
    .image-preview.active {
        display: flex;
        animation: slideUp 0.3s ease;
    }
    
    @keyframes slideUp {
        from {
            transform: translateY(20px);
            opacity: 0;
        }
        to {
            transform: translateY(0);
            opacity: 1;
        }
    }
    
    .message-image {
        max-width: 100%;
        height: auto;
        margin-top: 8px;
    }
    
    .button-row {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px;
        width: 100%;
    }
    
    .model-selector {
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    .model-button {
        height: 40px !important;
        border-radius: 20px !important;
        font-size: 13px !important;
    }
    
    .send-button {
        padding: 10px 24px !important;
        height: 40px !important;
        border-radius: 20px !important;
        font-size: 14px !important;
    }
    
    .model-dropdown {
        bottom: calc(100% + 4px) !important;
        top: auto !important;
        max-height: 200px !important;
    }
    
    .welcome {
        padding: 20px;
        padding-top: 75px;
        padding-bottom: 60px;
    }
    
    .welcome h2 {
        font-size: 20px;
    }
    
    .welcome p {
        font-size: 14px;
    }
    
    .quick-actions {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .quick-action {
        padding: 12px;
    }
    
    .feature-badges {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .feature-badge {
        font-size: 10px;
        padding: 2px 8px;
    }
    
    .status {
        font-size: 12px;
    }
    
    .typing-indicator {
        padding: 12px 0;
    }
    
    .typing-dot {
        width: 10px;
        height: 10px;
    }
}

.upload-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(44, 24, 16, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    z-index: 2000;
    display: none;
    text-align: center;
    border: 1px solid #b8860b;
}

.upload-indicator.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #6b7280;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

/* Modal Styles */
.modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 30px;
    border: 2px solid #b8860b;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s;
}

.close-modal {
    color: #9ca3af;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    margin-top: -10px;
}

.close-modal:hover,
.close-modal:focus {
    color: #b8860b;
}

.setup-steps ol {
    line-height: 2;
    margin: 20px 0;
}

.setup-steps li {
    margin-bottom: 15px;
}

.highlight {
    background: rgba(184, 134, 11, 0.2);
    color: #b8860b;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.info-box {
    background: linear-gradient(135deg, #faf8f5 0%, #f5e6d3 100%);
    border-left: 4px solid #b8860b;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.info-box ul {
    margin: 10px 0 0 20px;
}

.primary-button {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    margin: 20px 0;
    transition: all 0.3s;
}

.primary-button:hover {
    background: linear-gradient(135deg, #daa520 0%, #cd853f 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(184, 134, 11, 0.3);
}

.note {
    color: #6b7280;
    font-style: italic;
    margin-top: 20px;
    text-align: center;
    font-size: 14px;
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.prompt-item {
    padding: 10px;
    background: #faf8f5;
    border: 1px solid #b8860b;
    border-radius: 6px;
    margin: 8px 0;
    cursor: pointer;
    transition: all 0.2s;
}

.prompt-item:hover {
    background: linear-gradient(135deg, #faf8f5 0%, #f5e6d3 100%);
    border-color: #daa520;
    transform: translateX(2px);
}
@media (max-width: 768px) {
    /* Hide all conversation save/load features on mobile */
    button[onclick*="saveCurrentConversation"],
    button[onclick*="exportConversation"],
    .conversation-accordion {
        display: none !important;
    }
}
/* First Run Banner Styles */

.first-run-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.5s ease;
}

.first-run-content {
    background: linear-gradient(135deg, #2c1810 0%, #1a0f05 100%);
    border: 3px solid #b8860b;
    border-radius: 20px;
    padding: 40px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 
        0 0 50px rgba(184, 134, 11, 0.3),
        0 20px 40px rgba(0, 0, 0, 0.5),
        inset 0 1px 0 rgba(184, 134, 11, 0.2);
    animation: slideUp 0.6s ease;
}

.first-run-logo {
    font-family: 'Black Ops One', cursive;
    font-size: 32px;
    color: #daa520;
    text-transform: uppercase;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.first-run-tagline {
    color: #cd853f;
    font-size: 14px;
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: 1px;
}

.first-run-message {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 25px;
}

.first-run-message p {
    color: #deb887;
    margin: 10px 0;
    line-height: 1.6;
}

.first-run-message strong {
    color: #f5e6d3;
}

.first-run-terms {
    margin-bottom: 25px;
}

.terms-checkbox {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.terms-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.terms-checkbox span {
    color: #deb887;
    text-align: left;
    font-size: 14px;
    line-height: 1.4;
}

.terms-checkbox a {
    color: #daa520;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.terms-checkbox a:hover {
    color: #f5e6d3;
}

.first-run-button {
    background: linear-gradient(135deg, #b8860b 0%, #daa520 100%);
    color: #1a0f05;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 8px;
    cursor: not-allowed;
    opacity: 0.5;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.first-run-button:not(:disabled) {
    cursor: pointer;
    opacity: 1;
    box-shadow: 0 4px 15px rgba(184, 134, 11, 0.3);
}

.first-run-button:not(:disabled):hover {
    background: linear-gradient(135deg, #daa520 0%, #cd853f 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(184, 134, 11, 0.4);
}

.first-run-footer {
    margin-top: 20px;
    color: #8b7355;
    font-size: 12px;
    font-style: italic;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .first-run-content {
        padding: 30px 20px;
        width: 95%;
    }
    
    .first-run-logo {
        font-size: 24px;
    }
    
    .first-run-message {
        padding: 15px;
    }
    
    .terms-checkbox {
        font-size: 13px;
    }
}
/* Hide hamburger menu on mobile - OffGrid AI ToolKit */
@media (max-width: 768px) {
    .toggle-sidebar {
        display: none !important;
    }
    
    /* Ensure sidebar stays hidden on mobile */
    .sidebar {
        display: none !important;
    }
    
    /* Adjust chat container to use full width */
    .chat-container {
        width: 100% !important;
        margin-left: 0 !important;
    }
    
    /* Adjust messages padding since no QR code on mobile */
    .messages {
        padding-right: 24px !important;
    }
    
    /* Remove the extra padding that was added for the hamburger menu */
    .welcome {
        padding-top: 45px !important;  /* Your custom 45px for compass visibility */
    }
    
    /* Also adjust the messages container top padding if needed */
    .messages:has(.welcome) {
        padding-top: 20px !important;
    }
    
    /* Enlarge the compass icon by 25% on mobile */
    .welcome-icon {
        width: 137.5px !important;  /* 110px * 1.25 = 137.5px */
        height: 137.5px !important;  /* 110px * 1.25 = 137.5px */
    }
}
/* Hide Verified Drive badge on mobile and tablet portrait */
@media (max-width: 768px) {
    #driveBadge {
        display: none !important;
    }
}

/* Hide on tablet portrait specifically (if you want more granular control) */
@media (max-width: 1024px) and (orientation: portrait) {
    #driveBadge {
        display: none !important;
    }
}
/* Hide first-run terms popup on mobile/tablet - not needed since mobile 
   access is only possible after desktop user has already accepted terms */
@media (max-width: 768px) {
    .first-run-banner {
        display: none !important;
    }
}

/* Also hide on tablets to cover larger mobile devices */
@media (max-width: 1024px) and (orientation: portrait) {
    .first-run-banner {
        display: none !important;
    }
}