/* ===== MOBILE & TABLET OPTIMIZATION ===== */

/* Mobile Header / Hamburger Menu */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-subtle);
    position: sticky;
    top: 0;
    z-index: 50;
}

.menu-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
}

.menu-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.mobile-logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-logo-img {
    height: 32px;
    width: auto;
}

/* Sidebar Overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 90;
    opacity: 0;
    transition: opacity var(--duration-base);
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* Responsive Media Queries */
@media (max-width: 768px) {

    /* Show Mobile Header */
    .mobile-header {
        display: flex;
    }

    /* Adjust Main Content */
    .main-content {
        height: 100vh;
        display: flex;
        flex-direction: column;
    }

    .chat-container {
        padding: 0;
        /* Remove padding to let messages touch edges or be managed by inner containers */
        height: calc(100vh - 60px);
        /* Account for header */
    }

    .chat-messages {
        padding: var(--space-3);
        padding-bottom: 160px;
        /* Space for input area */
    }

    .input-area {
        padding: var(--space-3);
    }

    .input-container {
        padding: var(--space-2);
    }

    /* Sidebar Mobile Behavior */
    .sidebar {
        position: fixed;
        right: 0;
        top: 0;
        bottom: 0;
        z-index: 100;
        transform: translateX(100%);
        /* Hidden by default (RTL: moved right) */
        width: 280px;
        box-shadow: -4px 0 15px rgba(0, 0, 0, 0.1);
        transition: transform var(--duration-base) var(--ease-out);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    /* Typography Adjustments */
    .welcome-title {
        font-size: 2rem;
    }

    .welcome-subtitle {
        font-size: var(--font-size-sm);
        white-space: normal !important;
        /* Allow wrapping on mobile */
        text-align: center;
        padding: 0 var(--space-4);
        line-height: 1.5;
    }

    .welcome-features {
        flex-direction: column;
        gap: var(--space-3);
        padding: 0 var(--space-4);
    }

    .feature-item {
        width: 100%;
    }

    /* Message Bubbles */
    .message {
        max-width: 90%;
    }

    .message-content {
        padding: var(--space-3);
        font-size: var(--font-size-base);
    }

    /* Ensure disclaimer is single line on mobile */
    .disclaimer-message {
        white-space: nowrap !important;
        font-size: 10px !important;
        padding: 4px 8px;
    }

    /* Make disclaimer visible but small */
    #disclaimerMessage {
        display: flex !important;
        margin-top: 8px;
        margin-bottom: 20px;
    }
}