/* Mobile Responsive Fixes with Tailwind-like approach */

/* Base reset for mobile */
@media screen and (max-width: 768px) {
    html {
        overflow-x: hidden;
    }
    
    body {
        width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }
    
    .container {
        width: 100vw;
        min-width: 0;
        overflow-x: hidden;
    }
    
    .main-content {
        width: 100vw;
        min-width: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .chat-container {
        width: 100%;
        min-width: 0;
        padding: 0;
    }
    
    .messages {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 60px 1rem 1rem 1rem;
    }
    
    .message {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    .message-wrapper {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }
    
    .message-content {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }
    
    /* Code blocks scroll horizontally */
    .message-content pre,
    .code-block-wrapper,
    pre {
        max-width: calc(100vw - 4rem);
        overflow-x: auto;
        white-space: pre;
    }
    
    .message-content code:not(pre code) {
        word-break: break-word;
    }
    
    /* Input area */
    .input-container {
        width: 100%;
        min-width: 0;
        padding: 0.75rem;
    }
    
    .input-box {
        width: 100%;
        min-width: 0;
        max-width: none;
        margin: 0;
    }
    
    .input-toolbar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    /* Sidebar mobile */
    .sidebar {
        position: fixed;
        left: -280px;
        width: 280px;
        height: 100dvh;
        z-index: 1000;
        transition: left 0.3s;
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-toggle-fixed {
        position: fixed;
        top: 0.75rem;
        left: 0.75rem;
        z-index: 1001;
    }
}


/* Critical flex overflow fix */
@media screen and (max-width: 768px) {
    .message,
    .message-wrapper,
    .message-content,
    .messages,
    .chat-container,
    .main-content,
    .container {
        min-width: 0 !important;
        flex-shrink: 1 !important;
    }
    
    /* Force text to wrap */
    p, li, span, div, a {
        overflow-wrap: break-word !important;
        word-wrap: break-word !important;
    }
}
