/* Responsive Design Enhancements */
@media (min-width: 481px) {
    body {
        max-width: 100%;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
        background: linear-gradient(45deg, #1a1a1a, #000000);
    }

    .chat-container {
        width: 100%;
        max-width: 800px; 
        margin: 0 auto;
        position: relative;
        display: flex;
        flex-direction: column;
        height: 100vh;
        box-shadow: 0 0 20px rgba(0,0,0,0.3); 
    }

    .chat-messages {
        flex: 1;
        padding: 20px;
        max-height: calc(100vh - 120px); 
        overflow-y: auto;
    }

    .chat-input {
        width: calc(100% - 40px); 
        max-width: 760px;
        margin: 10px auto;
        border-radius: 25px;
    }

    .sidebar-menu {
        position: fixed;
        top: 56px; 
        left: 0;
        width: 300px;
        height: calc(100vh - 56px);
        background-color: #1a1a1a;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }

    .sidebar-menu.open {
        transform: translateX(0);
    }

    .app-header {
        position: sticky;
        top: 0;
        z-index: 1001;
    }
}

/* Fluid Typography for Larger Screens */
@media (min-width: 481px) {
    html {
        font-size: calc(14px + 0.5vw);
        max-width: 100%;
    }

    .message .bubble {
        max-width: 70%; 
    }
}

/* Improved Touch Targets */
@media (pointer: coarse) {
    .chat-input,
    .send-button,
    .new-chat-button,
    .sidebar-menu button,
    .chat-history-item {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Safe Area Insets for Mobile Devices */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .chat-input {
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
    }
}